![]() Ratio = float(logo.Height)/ float(logo.Width) #needs to be a float as int will round to the nearest whole number WinSize = Size(1000,600) #consistant window size # Global defs #ītn.Anchor = (AnchorStyles.Bottom | AnchorStyles.Right)ītn.BackColor = Color.FromArgb(220, 220, 220)īitmapImage = (“C:\Me\Dynamo\WPF in Dynamo\” “dyna-sco-logo-text.png”) Spacing = 20 #spacing size for GUI elements to form a consistent borderįontCK = Font("Helvetica ", 8) #set Checkbox Font TitleText = “Dimensioning” #text that appears in the GUI titlebarītnHeight = 40 #declared here as used for btn locations TitleIcon = Icon.FromHandle(bitmapImage.GetHicon()) #titlebar logo as icon #these variables are static through the 2 windowsīitmapImage = (“C:\Me\Dynamo\WPF in Dynamo\” “dyna-sco-logo.png”) #titlebar logo as bmp Import System.IO # Define some variables # #system location C:\Windows\ Microsoft.NET\Framework64\v9 (pyt_path) # UI additional references #įrom import Application, Form, FormWindowState, Screen, Label, PictureBox, PictureBoxSizeMode, AnchorStyles, BorderStyle, ComboBox, ComboBoxStyle, FormBorderStyle, CheckBox, TextBox, TextBoxBaseįrom import Button, LinkLabel, Panel, Buttonįrom System.Drawing import Icon, Color, Font, Point, Size#, Image Pyt_path = r’C:\Program Files (x86)\IronPython 2.7\Lib’ I tried to get bitmaps from a web address but I couldn’t get that working without saving locally (which seemed a bit rude)… ![]() You will need to change the paths to your own logos / bitmaps, otherwise it should just run. ![]() ![]() I have kept the code as readable as possible. There’re are lots of lines of code, but they are relatively simple… As Ben noted, there is very little Python documentation on this, so hopefully it is useful to expand it a bit. I left in the dropdown he made, I’ve also done some other things… Checkboxes, Text input
0 Comments
Leave a Reply. |