WindowConstructor

class WindowConstructor.CreateButtonPanel(parent, ButtonNamelst=[['Ok', 'Cancel']], Style=0, Border=3, size=-1, Flags=0, WindowSize=None)

This class creates a panel with buttons. You can bind the buttons to a function. This is done in the following way, First GetButtonList() is called this gives the Buttonlst with all the buttons. Then you selected the right button from the list and bind it with your function.

Remarks

  • If a label is empty (“”) than a panel is created instead of a button.

  • When This panel is added to a sizer and you want more space between the buttons you can use wx.Expand and/or set proportion to 1 or more in the sizer flags or proportion. If you do this. You can use the sizer flags to determine how the extra space is filled.

  • If flag wx.EXPAND is used the buttons fill up all the empty space other flags have no use in that case and the parameter size doesn’t work.

  • size has four different settings (wx.ID_ANY,0,1 and a random positive number)

    • wx.ID_ANY gives standard min button size that scales with text.
    • 0 gives a button size as small as the smallest button.
    • 1 gives the standard button size that doesn’t scale.
    • a random positive number sets the pixcel width of the buttons to that number. (The edges of the button take 8 pixcels)

Warnings

  • ButtonNamelst should always be a rectangle (M*N)
  • Buttonlst is one dimensional build with first row_1 then row_2 etc
  • size should always be equal or larger than -1
Parameters:
  • parent (wx.Panel, wx.Frame or wx.Dialog) – The panel where this panel is placed on top.
  • ButtonNamelst (list with lists that contain strings) – A 2D list of labels for the buttons (the default is a “Ok” and “Cancel” button).
  • Border (int) – The minimun vertical Border and horizontal Border between the buttons and the edge of the panel (default is 3).
  • Flags (wxpython sizer flags) – The flags for wx.FlexGridSizer with the flags you can control where the buttons are placed (Aligned). If more flags than one flag are needed then they are seperated by “|”. (The default is wx.ALIGN_LEFT)
  • size (int or wx.ID_ANY (stands for the int -1)) – How the buttons are sized (the default is wx.ID_ANY)
  • WindowSize (None or tuple) – This determines the size of the panel. When you want to use a scrolbar in a certain direction put in an int in that direction. For example for Vertical direction use (wx.ID_ANY,int). When not using a scrollbar use None.
Return type:

wx.Panel with buttons

GetButtonList()

Gets the wx.Button items of this panel.

Return type:list with wx.Buttons
class WindowConstructor.CreateCheckBoxPanel(parent, CheckBoxNamelst=['True colour'], Label='', Border=1, state3_Checkbox=False, Flag=0, Flags=0, WindowSize=None)

This class creates a panel with checkboxes. You can bind the checkboxes to a function. This is done in the following way, First GetCheckBoxlist() is called this gives the CheckBoxlst with all the checkboxes. Then you selected the right checkbox from the list and bind it with your function.

Remarks

  • With the flag wx.ALIGN_LEFT the checkbox appears on the left of the text
  • If the input in CheckBoxLst is “” a textfield wil be generated in stead of text.
  • When This panel is added to a sizer and you want more space between the buttons you can use wx.Expand and/or set proportion to 1 or more. If you use one or both you can use the wx.Align flags.

Warnings

  • CheckBoxNamelst takes always a list of strings
  • There is a variable Flag and Flags, Flags is used for the layout of the panel and Flag for the form of the checkbox.
Parameters:
  • parent (wx.Panel, wx.Frame or wx.Dialog) – The panel where this panel is placed on top.
  • CheckBoxNamelst (list with strings) – A list of strings for the text that is displayed next to the checkbox (the default is [“True colour”])
  • Label (string) – Displays a text at the top of the panel (default is “”)
  • Border (int) – The minimun vertical Border and horizontal Border between the text,checkboxes and the edge of the panel (default is 1)
  • Flags (wxpython sizer flags) – The flags for wx.FlexGridSizer with the flags you can control where the checkboxes are placed (Aligned). If more flags than one flag are needed then they are seperated by “|”. (The default is wx.ALIGN_LEFT)
  • Flag (wxpython CheckBox flag) – The flag for wx.CheckBox with the flag you can control where the text is placed is placed. (the default is wx.ALIGN_LEFT, the text appears on the right of the checkbox)
  • state3_Checkbox (boolean) – A boolean the enables the third state checkbox (the default is False, so a two state checkbox)
  • WindowSize (None or tuple) – This determines the size of the panel. When you want to use a scrolbar in a certain direction put in an int in that direction. For example for Vertical direction use (wx.ID_ANY,int). When not using a scrollbar use None.
Returns:

wx.Panel with checkboxes

Return type:

wx.Panel

GetCheckBoxValues()

Gets the checkboxes states for this panel.

Returns:A list of booleans or a list of int (0 (not checked),1 (checked) or 2 (third state)) if the three state checkboxes is used.
Return type:list
GetCheckBoxlist()

Gets the checkboxes for this panel.

Returns:A list of wx.checkboxes
Return type:list
GetTextFieldInput()

Gets the input of all the textfields for this panel.

Returns:A list of strings
Return type:list
SetCheckBoxValues(InputLst)

Sets the checkboxes states for this panel.

Parameters:InputLst (list) – A list of booleans or if the three state checkboxes is used a list of int (0 (not checked),1 (checked) or 2 (third state)).
class WindowConstructor.CreateDirPickerCtrl(parent, Paths=[''], DirCtrlNameLst=['Work Folder'], Label='', size=-1, Border=1, Flags=0, WindowSize=None)

This class creates a panel with directory Control fields (wx.DirPickerCtrl).

Remarks

  • When This panel is added to a sizer and you want more space between the buttons you can use wx.Expand and/or set proportion to 1 or more. If you use one or both you can use the wx.Align flags.

  • size has three different settings

    • 0 gives the minimum Size for the DirPickerCtrl that still all the text fits in with a litle bit more space.
    • wx.ID_ANY gives the default column size for DirPickerCtrl.
    • a random positive number sets the pixcel width of DirPickerCtrl to that number (the search button is 100 pixcels).

Warnings

  • DirCtrlNameLst should always be the same size as Paths.
  • Size should always be positieve, wx.ID_ANY or zero
Parameters:
  • parent (wx.Panel, wx.Frame or wx.Dialog) – The panel where this panel is placed on top.
  • Paths (list of string) – A list of the default paths if the string is an empty string the field is left empty (default = “”)
  • DirCtrlNameLst (list with strings) – A list of strings. This is the text That stand above the DirPickerCtrl box (default = “Work Folder”)
  • Label (string) – Displays a text at the top of the panel (default is “”)
  • Border (int) – The minimun vertical Border and horizontal Border between the text,controlfield and the edge of the panel (default is 1)
  • Flags (wxpython sizer flags) – The flags for wx.FlexGridSizer with the flags you can control where the controlfields are placed (Aligned). If more flags than one flag are needed then they are seperated by “|”. (The default is wx.ALIGN_LEFT)
  • size (int or wx.ID_ANY (stands for the int -1)) – The width of the DirPickerCtrl box (the default is size is wx.ID_ANY)
  • WindowSize (None or tuple) – This determines the size of the panel. When you want to use a scrolbar in a certain direction put in an int in that direction. For example for Vertical direction use (wx.ID_ANY,int). When not using a scrollbar use None.
Returns:

wx.Panel with wx.DirPickerCtrls

Return type:

wx.Panel

GetDirectories()

Gets the input of all the directory Control fields for this panel.

Returns:A list of strings
Return type:list
SetDirectories(Dir)

Sets the input of all the directory Control fields for this panel.

Parameters:Dir (list) – A list of strings
class WindowConstructor.CreateDropdownMenu(parent, DropdownNamelst=['Choice 1', 'Choice 2', 'Choice 3'], Default=0, Label='', Style=56, Border=1, size=-1, Flags=0, WindowSize=None)

This class creates a panel with a drobdown menu.

Remarks

  • When This panel is added to a sizer and you want more space you can use wx.Expand and/or set proportion to 1 or more. If you use one or both you can use the wx.Align flags.

  • size has three different settings

    • 0 gives the minimum Size for the ComboBox that still all the text fits in the drobdown menu.
    • wx.ID_ANY gives the default size for wx.ComboBox.
    • a random positive number sets the pixcel width of wx.ComboBox to that number (the edges plus the scroll button are 28 pixcels).

Warnings

  • Default must always be equal or larger than 0 and smaller then the lenght of the DropdownNamelst
Parameters:
  • parent (wx.Panel, wx.Frame or wx.Dialog) – The panel where this panel is placed on top.
  • DropdownNamelst (list with strings) – A list of strings for in the drobdown menu (default is [“Choice1”,”Choice2”,”Choice3”])
  • Default (int or string) – Which string is selected as default. This can be a string from the drobdownbox or the position.
  • Label (string) – Displays a text at the top of the panel (default is “”)
  • Style (wxpython DrobDownMenu flags) – The flags for wx.ComboBox with the flags you can control how the DrobDownMenu looks like. If more flags than one flag are needed then they are seperated by “|”. (The default is wx.CB_DROPDOWN|wx.CB_READONLY)
  • Border (int) – The minimun vertical Border and horizontal Border between the dropdown menu and the edge of the panel (default is 1)
  • Flags (wxpython sizer flags) – The flags for wx.FlexGridSizer with the flags you can control where the drobdown menu’s are placed (Aligned). If more flags than one flag are needed then they are seperated by “|”. (The default is wx.ALIGN_LEFT)
  • size (int or wx.ID_ANY (stands for the int -1)) – The width and height of the drobdown menu box (the default is size is wx.ID_ANY)
  • WindowSize (None or tuple) – This determines the size of the panel. When you want to use a scrolbar in a certain direction put in an int in that direction. For example for Vertical direction use (wx.ID_ANY,int). When not using a scrollbar use None.
Returns:

wx.Panel with a wx.ComboBox

Return type:

wx.Panel

GetSelection()

Gets the selected string from the drobdown menu.

Return type:string
SetSelection(string)

Sets the selected string from the drobdown menu.

Parameters:string (string) – one of the strings from the drobdown menu is set as selected string
class WindowConstructor.CreateFloatSpinnerPanel(parent, SpinnerNamelst=[['Red', '650', 'nm'], ['Green', '530', 'nm'], ['Blue', '460', 'nm']], MinVal=[396, 396, 396], MaxVal=[1007, 1007, 1007], Increment=[1, 1, 1], Label='', Border=1, size=(-1, -1, -1), Flags=2048, WindowSize=None)

This class creates a panel with two colums of textfields and between those a column with spinners. You can use GetSpinners to get a list with spinners. You can bind one of the spinner to a certain function with bind. (the event is a wx.EVT_SPINCTRL)

Remarks

  • When This panel is added to a sizer and you want more space you can use wx.Expand and/or set proportion to 1 or more. If you use one or both you can use the wx.Align flags.

  • size has two different settings (wx.ID_ANY and a random positive number)

    • wx.ID_ANY gives the minimum column size for that colum.
    • a random positive number sets the pixcel width of that column to that number. (In the second column the spinner takes 40 pixcels)

Warning

  • SpinnerNamelst should always be a rectangle with three collums.
  • Size should always be positieve or wx.ID_ANY. Size determines the size per colum.
  • The lenght of the lists MinVal and Maxval should be equal to the amount of rows in SpinnerNamelst
  • Spinners can only take int
Parameters:
  • parent (wx.Panel, wx.Frame or wx.Dialog) – The panel where this panel is placed on top.
  • SpinnerNamelst (list with lists) – A 2D list of strings. First column is the text for the spinner. second column is the spinner default value and the last column is the text behind the spinner (the default is [[“Red”,”650”,”nm”],[“Green”,”530”,”nm”],[“Blue”,”460”,”nm”]])
  • MinVal (list of int) – The minimum value that each spinner can have (the default is [396,396,396])
  • MaxVal (list of int) – The maximum value that each spinner can have (the default is [1007,1007,1007])
  • Label (string) – Displays a text at the top of the panel
  • Border (int) – The minimun vertical Border and horizontal Border between the texts, spinners and the edge of the panel (default is 1)
  • Flags (wxpython sizer flags) – The flags for wx.FlexGridSizer with the flags you can control where the Listbox are placed (Aligned). If more flags than one flag are needed then they are seperated by “|”. (The default is wx.ALIGN_LEFT)
  • size (int or wx.ID_ANY (stands for the int -1)) – The width of the colums (the default is size is wx.ID_ANY)
  • WindowSize (None or tuple) – This determines the size of the panel. When you want to use a scrolbar in a certain direction put in an int in that direction. For example for Vertical direction use (wx.ID_ANY,int). When not using a scrollbar use None.
Rparam:

wx.Panel with Spinners

Return type:

wx.Panel

GetSpinners()

Gets a list with all the spinners. Those can be used to bind with spinner events.

Returns:A list with wx.SpinCtrl
Return type:list
GetValues()

Gets a list with all the spinner values.

Returns:A list with int
Return type:list
SetValues(Values)

Sets the spinner values to a certain number.

Parameters:Values (list of int) – A list with new values for the spinners.
class WindowConstructor.CreateGridColourPanel(parent, Gridlayout=(5, 1), Label='Loading', Border=1, size=(20, 20), Flags=0, WindowSize=None)

This class creates a red or green fields to indicate if something is loaded.

Parameters:
  • parent (wx.Panel, wx.Frame or wx.Dialog) – The panel where this panel is placed on top.
  • Gridlayout (tuple) – a tuple with the number of fields (width,height)
  • Label (string) – Displays a text at the top of the panel (default is “Loading”)
  • Border (int) – The minimun vertical Border and horizontal Border between the grid and the edge of the panel (default is 1)
  • Flags (wxpython sizer flags) – The flags for wx.FlexGridSizer with the flags you can control where the fields are placed (Aligned). If more flags than one flag are needed then they are seperated by “|”. (The default is wx.ALIGN_LEFT)
  • size (tuple) – The width and height of the fields (the default is size is (20,20))
  • WindowSize (None or tuple) – This determines the size of the panel. When you want to use a scrolbar in a certain direction put in an int in that direction. For example for Vertical direction use (wx.ID_ANY,int). When not using a scrollbar use None.
Returns:

wx.Panel with Fields

Return type:

wx.Panel

class WindowConstructor.CreateGridFieldPanel(parent, GridInputLst=[['Filename', 'Filename']], GridLayoutLst=['ST', 'TE'], Label='', Header=[], Border=1, size=[0, 0], Flags=0, TE_Style=0, CB_Style=56, SP_Style=17920, SP_MinVal=0, SP_MaxVal=100, Increment=0.1, GA_Style=4, GA_VerSize=-1, WindowSize=None)

This class makes a gridfield with different wxpython items per colum. There is also an option to include a header. The following wxpython items are supported “TE” = wx.TextCtrl,”CB” = wx.ComboBox,”SP” = wx.SpinCtrl,”FS” = wx.SpinCtrlDouble,”BU” = wx.Button,”GA” = wx.Gauge and “ST” = wx.StaticText.

Remarks

  • When This panel is added to a sizer and you want more space you can use wx.Expand and/or set proportion to 1 or more. If you use one or both you can use the wx.Align flags.

  • When the Header is an empty list. It is removed and the GridInputLst starts on the first row.

  • size has three different settings

    • 0 gives the minimum Size for the TextFields that still all the text fits in the colums. When the column is a “TE”,”CB”,”SP”,”GA” or “FS” wxpython item the width is 30 pixcels more.
    • wx.ID_ANY gives the default size for StaticTextFields and TextCtrlFields.
    • a random positive number sets the pixcel width of StaticTextFields and TextCtrlFields to that number (the edges plus the search button are 20 pixcels for the TextCtrlFields).
  • GridInputlst has diffent inputs depending on which wx.item is choosen in the GridLayoutLst. The inputs with there GridLayoutLst values are

    • A list: “CB”
    • A string: “TE”,”SP”,”FS”,”BU”,”ST”
    • An int: “GA”

Warnings

  • GridInputLst should always be a rectangle (M*N)
  • The values inside the size should always be equal or larger than -1
Parameters:
  • parent (wx.Panel, wx.Frame or wx.Dialog) – The panel where this panel is placed on top.
  • GridInputLst (list with lists) – A 2D list of strings or lists for wxpython items which item is determined by the GridLayoutLst.
  • GridLayoutLst (list) – A list of strings that determine which wxpython item is used in which colum.
  • Label (string) – Displays a text at the top of the panel.
  • Header (list) – A list with strings that form the first row and are used as headers above the colums.
  • Border (int) – The minimun vertical Border and horizontal Border between the TextFields and the edge of the panel (default is 1)
  • size (int or wx.ID_ANY (stands for the int -1)) – The width of the Fields.
  • Flags (wxpython sizer flags) – The flags for wx.FlexGridSizer with the flags you can control where the textfields are placed (Aligned). If more flags than one flag are needed then they are seperated by “|”.
  • TE_Style (list of wxpython flags) – A list of flags for wx.TextCtrl with the flags you can control how the TextCtrl looks like per row. If more flags than one flag are needed then they are seperated by “|”.
  • CB_Style (list of wxpython flags) – A list of flags for wx.ComboBox with the flags you can control how the ComboBox looks like per row. If more flags than one flag are needed then they are seperated by “|”.
  • SP_Style (list of wxpython flags) – A list of flags for wx.SpinCtrl and wx.SpinCtrlDouble with the flags you can control how the SpinCtrl looks like per row. If more flags than one flag are needed then they are seperated by “|”.
  • SP_MinVal (int) – The minimal Value for the wx.SpinCtrl and wx.SpinCtrlDouble
  • SP_MaxVal (int) – The maximum Value for the wx.SpinCtrl and wx.SpinCtrlDouble
  • Increment (int) – The increment for wx.SpinCtrlDouble
  • GA_Style (list of wxpython flags) – A list of flags for wx.Gauge with the flags you can control how the Gauge looks like per row. If more flags than one flag are needed then they are seperated by “|”.
  • GA_VerSize (int) – The vertical size of the gauge. When a vertical gauge is used use this parameter to determine the length of the gauge.
  • WindowSize (None or tuple) – This determines the size of the panel. When you want to use a scrolbar in a certain direction put in an int in that direction. For example for Vertical direction use (wx.ID_ANY,int). When not using a scrollbar use None.
Rparam:

wx.Panel with various wxpython items.

Return type:

wx.Panel

GetItems(col=0)

Gets a list with items depending on the col.

Returns:A list
Return type:list
GetValue(row=0, col=0)

Gets a value from a pos in the grid

Returns:A list
Return type:list
GetValues(col=0)

Gets a list with values depending on the col.

Returns:A list
Return type:list
SetValue(Input, row=0, col=0)

Sets the value for a pos in the grid

Parameters:Input (string or int) – The new value for the specific wxpython item
SetValues(Input, col=0)

Sets the values for a col

Parameters:Input (list) – A list with Strings.
class WindowConstructor.CreateHyperLinkPanel(parent, HyperNameLst=[['http://www.tudelft.nl', 'http://www.tudelft.nl', 'Tudelft Homepage']], Border=3, Flags=0, WindowSize=None)

This class creates a panel with hyperlinks.

Remarks

  • When This panel is added to a sizer and you want more space between the buttons you can use wx.Expand and/or set proportion to 1 or more. If you use one or both you can use the wx.Align flags.

Warnings

  • HyperNameLst should always be a N by 3 list
Parameters:
  • parent (wx.Panel, wx.Frame or wx.Dialog) – The panel where this panel is placed on top.
  • HyperNameLst (list with strings) – A list with a list of strings (lenght 3). The First of the three is the text, the second the URL and the last the pop-up.(default is [[“http://www.tudelft.nl”,”http://www.tudelft.nl”,”Tudelft Homepage”]])
  • Border (int) – The minimun vertical Border and horizontal Border between the hyperlinks and the edge of the panel (default is 3)
  • Flags (wxpython sizer flags) – The flags for wx.FlexGridSizer with the flags you can control where the hyperlinks are placed (Aligned). If more flags than one flag are needed then they are seperated by “|”. (The default is wx.ALIGN_LEFT)
  • WindowSize (None or tuple) – This determines the size of the panel. When you want to use a scrolbar in a certain direction put in an int in that direction. For example for Vertical direction use (wx.ID_ANY,int). When not using a scrollbar use None.
Retruns:

wx.Panel with hyl.HyperLinkCtrls

Return type:

wx.Panel

class WindowConstructor.CreateIconWithText(parent, BitmapLst=['Info'], TextLst=[''], Size=(-1, -1), Border=1, Flags=0, WindowSize=None)

This class creates a panel with text colums.

Remarks

  • When This panel is added to a sizer and you want more space you can use wx.Expand and/or set proportion to 1 or more. If you use one or both you can use the wx.Align flags.

  • If the input in TextLst is a empty string (“”) than there is no pop-up message.

  • There are five different input options for BitmapLst

    • Info gives a standard windows info icon
    • Help gives a standard windows help icon
    • Warning gives a standard windows warning icon
    • Error gives a standard windows error icon
    • A .png from the Assets map. The input should be without the .png

Warnings

  • the lenght of BitmapLst must be equal to the lenght of the TextLst.
Parameters:
  • parent (wx.Panel, wx.Frame or wx.Dialog) – The panel where this panel is placed on top.
  • BitmapLst (list with strings) – A list with which Icons should be used.
  • TextLst (list with strings) – A list with all the strings for the pop-up messages if you hover over the icon.
  • Border (int) – The minimun vertical Border and horizontal Border between the Icons and the edge of the panel (default is 1)
  • Flags (wxpython sizer flags) – The flags for wx.FlexGridSizer with the flags you can control where the icons are placed (Aligned). If more flags than one flag are needed then they are seperated by “|”. (The default is wx.ALIGN_LEFT)
  • WindowSize (None or tuple) – This determines the size of the panel. When you want to use a scrolbar in a certain direction put in an int in that direction. For example for Vertical direction use (wx.ID_ANY,int). When not using a scrollbar use None.
Returns:

a wx.Panel with Icons

Return type:

wx.Panel

class WindowConstructor.CreateListPanel(parent, ColumnNamelst=['Col1', 'Col2', 'Col3'], ValueList=[['Test', 'Test2', 'Test3']], Label='', Style=32, Border=1, size=[0, 0, 0], Vsize=-1, Flags=0, WindowSize=None)

This class creates a panel with text colums.

Remarks

  • When This panel is added to a sizer and you want more space you can use wx.Expand and/or set proportion to 1 or more. If you use one or both you can use the wx.Align flags.

  • size has three different settings

    • 0 gives the minimum Size for the colums that still all the text fits in the colums.
    • wx.ID_ANY gives the default size for the colums.
    • a random positive number sets the pixcel width for the colums to that number (the edges plus the scroll button are 15 pixcels).

Warnings

  • the lenght of ColumnNamelst must be equal to the lenght of the ValueList and to the lenght of the size list.
Parameters:
  • parent (wx.Panel, wx.Frame or wx.Dialog) – The panel where this panel is placed on top.
  • ColumnNamelst (list with strings) – A list of strings for in the Column headers (the default is [“Col1”,”Col2”,”Col3”])
  • ValueList (list) – A 2D list with strings. This list gives all the value for in the colums. (the default is [[“Test”,”Test2”,”Test3”]])
  • Label (string) – Displays a text at the top of the panel (default is “”)
  • Style (wxpython ListCtrl flags) – The flags for wx.ListCtrl with the flags you can control how the ListCtrl looks like. If more flags than one flag are needed then they are seperated by “|”. (The default is wx.LC_REPORT)
  • Border (int) – The minimun vertical Border and horizontal Border between the dropdown menu and the edge of the panel (default is 1)
  • Flags (wxpython sizer flags) – The flags for wx.FlexGridSizer with the flags you can control where the colums are placed (Aligned). If more flags than one flag are needed then they are seperated by “|”. (The default is wx.ALIGN_LEFT)
  • size (list int or wx.ID_ANY (stands for the int -1)) – list with the width of the colums (the default is size is [0,0,0])
  • WindowSize (None or tuple) – This determines the size of the panel. When you want to use a scrolbar in a certain direction put in an int in that direction. For example for Vertical direction use (wx.ID_ANY,int). When not using a scrollbar use None.
Returns:

a wx.Panel with text colums

Return type:

wx.Panel

GetData()

gets the data from the colums

Returns:A 2D list with strings
Return type:list
GetSelectedData()

Get the currently selected data.

Returns:A 2D list with strings
Return type:list
SetData(ValueLst)

Sets the data in the colums

Parameters:ValueLst (list) – A 2D list with strings
class WindowConstructor.CreateRadioButtonPanel(parent, RadioButtonNamelst=['Test Specimen', 'White Specimen', 'Black Specimen'], Label='', DropDownMDefault=0, DropDownMStyle=48, MinSpinner=[0], MaxSpinner=[100], MinNumCtrl=0, MaxNumCtrl=(None, None), allowNegative=False, Border=1, Flags=2048, WindowSize=None)

This class creates a panel with Radiobuttons that are aligned verticaly.

Remarks

  • When This panel is added to a sizer and you want more space you can use wx.Expand and/or set proportion to 1 or more. If you use one or both you can use the wx.Align flags.

  • DropDownMDefault has two options either a number in the range from zero to the lenght of the optionlist is chosen or a random other number. In the second case None will be the default string in the drobdown menu.

  • There are four special inputs for the RadioButtonNamelst

    • An empty string (“”) gives a textfield next to the radiobutton.
    • The string “(,)” gives two NumCtrlfields that functions as a tuple input.
    • A list with two inputs (strings). This gives a spinnerctrl next to the radiobutton. The first input is a string with the text that is between the radiobutton and the spinner. The second input is a string that is a number this will be the default spinner value.
    • A list with two inputs (string and list). This gives a drobdown menu. The first input is a string with the text that is between the radiobutton and the drobdownmenu. The second input is a list with strings those are the options in the drobdown menu.

Warnings

  • RadioButtonNamelst takes strings
  • The lenght of the lists (MinSpinner and MaxSpinner) and the number of spinner must be equal in lenght.
  • MinNumCtrl is a int but MaxNumctrl is a tuple.
Parameters:
  • parent (wx.Panel, wx.Frame or wx.Dialog) – The panel where this panel is placed on top.
  • RadioButtonNamelst (list) – A list of strings(check special inputs) for the radiobuttons (default is [“Test Specimen”,”White Specimen”,”Black Specimen”])
  • Label (string) – Displays a text at the top of the panel (default is “”)
  • DropDownMDefault (wxpython DrobDownMenu flags) – Determines which string of the drobdownmenu’s is the default (the default is 0)
  • DropDownMDefault – The flags for wx.ComboBox with the flags you can control how the DrobDownMenu looks like. If more flags than one flag are needed then they are seperated by “|”. (The default is wx.CB_DROPDOWN|wx.CB_READONLY)
  • MinSpinner (list of int) – The minimum value that a spinner can have. (the default is [0])
  • MaxSpinner (list of int) – The maximum value that a spinner can have. (the default is [100])
  • MinNumCtrl (int) – The lowest number that the numctrl fields can have. This number is for both fields the same. (the default is 0)
  • MaxNumCtrl (tuple or list (both with int or None)) – The highest number that the numctrl fields can have. (the default is (None,None))
  • allowNegative (boolean) – This determines if numctrl excepts negative numbers. (the default is False)
  • Border (int) – The minimun vertical Border and horizontal Border between the radiobuttons and the edge of the panel (default is 1)
  • Flags (wxpython sizer flags) – The flags for wx.FlexGridSizer with the flags you can control where the Radiobuttons are placed (Aligned). If more flags than one flag are needed then they are seperated by “|”. (The default is wx.ALIGN_LEFT|wx.ALIGN_CENTER_VERTICAL)
  • WindowSize (None or tuple) – This determines the size of the panel. When you want to use a scrolbar in a certain direction put in an int in that direction. For example for Vertical direction use (wx.ID_ANY,int). When not using a scrollbar use None.
Returns:

a wx.Panel with radiobuttons (various extra option are available)

Return type:

wx.Panel

GetRadioButtonLst()

Gets A list with all the radiobuttons. Those can be used to bind with radiobutton events.

Returns:A list with wx.radiobuttons
Return type:list
GetSpinnerLst()

Gets A list with all the Values from the spinnerctrls.

Returns:A list with int (the lenght of this list is equal to the number of spinners)
Return type:list
GetStringLst()

Gets A list with all the selected Strings from the drobdownmenu’s.

Returns:A list with strings (the lenght of this list is equal to the number of drobdownmenu’s)
Return type:list
GetTextCtrlLst()

Gets A list with all the Strings from textctrl fields.

Returns:A list with strings (the lenght of this list is equal to the number of textctrl fields)
Return type:list
GetTupleLst()

Gets A list with all the tuples from the pair of numctrl fields.

Returns:A list with tuples. The type is not tuple but list with int. (the lenght of this list is equal to the number of tuple inputs)
Return type:list
GetValue()

Gets the value of the radiobutton that is selected.

Returns:the selected radiobutton
Return type:int
SetSpinnerValues(SpinnerLst)

Sets the value for all the spinners. The lenght of this list must be equal in lenght as the number of spinnerctrls used.

Parameters:SpinnerLst (list) – A list with int
SetStringSelections(StringSelectionLst)

Sets the selected string for all the drobdownmenu’s. The lenght of this list must be equal in lenght as the number of drobdownmenu’s used.

Parameters:StringSelectionLst (list) – A list with strings
SetTextCtrl(StringLst)

Sets the textfields. The lenght of this list must be equal in lenght as the number of textfields used.

Parameters:StringLst (list) – A list with strings
SetTuples(TupleLst)

Sets the value for both numctrlfields. The lenght of this list must be equal in lenght as the number of tuples used.

Parameters:TupleLst (list) – A list with tuples (or list that contains two int)
SetValue(Button)

Sets the radiobutton that will be selected.

Parameters:SpinnerLst (int) – an int that determines which radiobutton is selected
class WindowConstructor.CreateSliderPanel(parent, SliderNamelst=['Red', 'Green', 'Blue'], MinVal=[396, 396, 396], MaxVal=[1007, 1007, 1007], TickFreq=50, Label='', Border=1, size=[-1, -1], Flags=2048, WindowSize=None)

This class creates a panel with sliders.

Remarks

  • When This panel is added to a sizer and you want more space you can use wx.Expand and/or set proportion to 1 or more. If you use one or both you can use the wx.Align flags.

  • size has two different settings

    • wx.ID_ANY gives the default size for wx.Slider and gives the smallest size for the text.
    • a random positive number sets the pixcel width for wx.Slider or the text.

Warnings

  • The lenght of the lists (SliderNamelst, MinVal and MaxVal) must be the same.
Parameters:
  • parent (wx.Panel, wx.Frame or wx.Dialog) – The panel where this panel is placed on top.
  • SliderNamelst (list with strings) – A list of strings that are used for the text in front of the slider (default is [“Red”,”Green”,”Blue”]).
  • MinVal (list with int) – The Left border (minimum value) of the slider. This
  • MaxVal (list with int) – The Right border (minimum value) of the slider
  • TickFreq (int) – The interval between the Ticks
  • Label (string) – Displays a text at the top of the panel
  • Border (int) – The minimun vertical Border and horizontal Border between the Sliders, the text and the edge of the panel (default is 1)
  • Flags (wxpython sizer flags) – The flags for wx.FlexGridSizer with the flags you can control where the sliders are placed (Aligned). If more flags than one flag are needed then they are seperated by “|”. (The default is wx.ALIGN_LEFT|wx.ALIGN_CENTER_VERTICAL)
  • size (list with int or wx.ID_ANY (stands for the int -1)) – The width of the sliders and text(the default is size is [wx.ID_ANY,wx.ID_ANY])
  • WindowSize (None or tuple) – This determines the size of the panel. When you want to use a scrolbar in a certain direction put in an int in that direction. For example for Vertical direction use (wx.ID_ANY,int). When not using a scrollbar use None.
Rparam:

wx.Panel with wx.Sliders

Return type:

wx.Panel

GetSliderValues()

Gets a list with all the sliders values.

Returns:A list with int
Return type:list
GetSliders()

Gets a list with all the sliders. Those can be used to bind with slider events.

Returns:A list with wx.sliders
Return type:list
SetSliderValues(InputLst)

Sets the sliders to a certain number.

Parameters:InputLst (list of int) – A list with new values for the sliders.
class WindowConstructor.CreateSortListPanel(parent, SortNamelst=['Choise1', 'Choise3', 'Choise2', 'Choise5', 'Choise4'], Label='', Style=1073741952, Border=2, size=-1, Flags=0, WindowSize=None)

This class creates a panel with a listbox that also includes buttons with them you can sort the list.

Remarks:

  • When This panel is added to a sizer and you want more space you can use wx.Expand and/or set proportion to 1 or more. If you use one or both you can use the wx.Align flags.

  • size has three different settings:
    • 0 gives the minimum size for the ListBox.
    • wx.ID_ANY gives the default size for wx.ListBox.
    • a random positive number sets the pixcel width of wx.ListBox to that number (the edges of the listbox are 8 pixcels).
Parameters:
  • parent (wx.Panel, wx.Frame or wx.Dialog) – The panel where this panel is placed on top.
  • SortNamelst (list with strings) – A list of strings that you want to sort (default is [“Choise1”,”Choise3”,”Choise2”,”Choise5”,”Choise4”])
  • Label (string) – Displays a text at the top of the panel
  • Style (wxpython ListBox flags) – The flags for wx.ListBox with the flags you can control how the ListBox looks like. If more flags than one flag are needed then they are seperated by “|”. (The default is wx.LB_EXTENDED|wx.LB_HSCROLL|wx.LB_NEEDED_SB)
  • Border (int) – The minimun vertical Border and horizontal Border between the Listbox, buttons and the edge of the panel (default is 2)
  • Flags (wxpython sizer flags) – The flags for wx.FlexGridSizer with the flags you can control where the Listbox are placed (Aligned). If more flags than one flag are needed then they are seperated by “|”. (The default is wx.ALIGN_LEFT)
  • size (int or wx.ID_ANY (stands for the int -1)) – The width of the listbox (the default is size is wx.ID_ANY)
  • WindowSize (None or tuple) – This determines the size of the panel. When you want to use a scrolbar in a certain direction put in an int in that direction. For example for Vertical direction use (wx.ID_ANY,int). When not using a scrollbar use None.
Rparam:

wx.Panel with a wx.ListBox and wx.Buttons

Return type:

wx.Panel

GetAllStrings()

Gets the list with all the Strings in the order that they are displayed.

Returns:A list with strings
Return type:list
GetSelections()

Gets the list with all the Strings in the order that they are displayed.

Returns:A list with strings
Return type:list
OnChangeOrder(event, Factor)

Goes trough all the strings that are selected and moves them one up or down. So a new list is created with a new order. If No items are selected in the listbox nothing happens.

Parameters:
  • event (wx python event) – event tells what kind of event took place to activate this function
  • Factor (int (0 or 1)) – determines if the selected items go up or down.
OnSort(event)

Sort the list in alphabetical order or replace the sorted list with the original list.

Parameters:event (wx python event) – event tells what kind of event took place to activate this function
class WindowConstructor.CreateSpinnerPanel(parent, SpinnerNamelst=[['Red', '650', 'nm'], ['Green', '530', 'nm'], ['Blue', '460', 'nm']], MinVal=[396, 396, 396], MaxVal=[1007, 1007, 1007], Label='', Border=1, size=(-1, -1, -1), Flags=2048, WindowSize=None)

This class creates a panel with two colums of textfields and between those a column with spinners. You can use GetSpinners to get a list with spinners. You can bind one of the spinner to a certain function with bind. (the event is a wx.EVT_SPINCTRL)

Remarks

  • When This panel is added to a sizer and you want more space you can use wx.Expand and/or set proportion to 1 or more. If you use one or both you can use the wx.Align flags.

  • size has two different settings (wx.ID_ANY and a random positive number)

    • wx.ID_ANY gives the minimum column size for that colum.
    • a random positive number sets the pixcel width of that column to that number. (In the second column the spinner takes 40 pixcels)

Warning

  • SpinnerNamelst should always be a rectangle with three collums.
  • Size should always be positieve or wx.ID_ANY. Size determines the size per colum.
  • The lenght of the lists MinVal and Maxval should be equal to the amount of rows in SpinnerNamelst
  • Spinners can only take int
Parameters:
  • parent (wx.Panel, wx.Frame or wx.Dialog) – The panel where this panel is placed on top.
  • SpinnerNamelst (list with lists) – A 2D list of strings. First column is the text for the spinner. second column is the spinner default value and the last column is the text behind the spinner (the default is [[“Red”,”650”,”nm”],[“Green”,”530”,”nm”],[“Blue”,”460”,”nm”]])
  • MinVal (list of int) – The minimum value that each spinner can have (the default is [396,396,396])
  • MaxVal (list of int) – The maximum value that each spinner can have (the default is [1007,1007,1007])
  • Label (string) – Displays a text at the top of the panel
  • Border (int) – The minimun vertical Border and horizontal Border between the texts, spinners and the edge of the panel (default is 1)
  • Flags (wxpython sizer flags) – The flags for wx.FlexGridSizer with the flags you can control where the Listbox are placed (Aligned). If more flags than one flag are needed then they are seperated by “|”. (The default is wx.ALIGN_LEFT)
  • size (int or wx.ID_ANY (stands for the int -1)) – The width of the colums (the default is size is wx.ID_ANY)
  • WindowSize (None or tuple) – This determines the size of the panel. When you want to use a scrolbar in a certain direction put in an int in that direction. For example for Vertical direction use (wx.ID_ANY,int). When not using a scrollbar use None.
Rparam:

wx.Panel with Spinners

Return type:

wx.Panel

GetSpinners()

Gets a list with all the spinners. Those can be used to bind with spinner events.

Returns:A list with wx.SpinCtrl
Return type:list
GetValues()

Gets a list with all the spinner values.

Returns:A list with int
Return type:list
SetValues(Values)

Sets the spinner values to a certain number.

Parameters:Values (list of int) – A list with new values for the spinners.
class WindowConstructor.CreateTextFieldPanel(parent, FieldNameLst=[['Filename', 'Filename']], Label='', Border=1, size=[0, 0], CommentBoxsize=-1, Flags=0, style=[0], WindowSize=None)

This class creates a panel with StaticTextfields and TextCtrlFields.

Remarks

  • When This panel is added to a sizer and you want more space you can use wx.Expand and/or set proportion to 1 or more. If you use one or both you can use the wx.Align flags.

  • size has three different settings

    • 0 gives the minimum Size for the TextFields that still all the text fits in the colums.
    • wx.ID_ANY gives the default size for StaticTextFields and TextCtrlFields.
    • a random positive number sets the pixcel width of StaticTextFields and TextCtrlFields to that number (the edges plus the search button are 20 pixcels for the TextCtrlFields).

Warnings

  • FieldNameLst should always be a rectangle with two collums.
Parameters:
  • parent (wx.Panel, wx.Frame or wx.Dialog) – The panel where this panel is placed on top.
  • FieldNameLst (list with lists) – A 2D list of strings for the StaticTextFields and the default Text in the TextCtrlFiedls (default is [[“Filename”,”Filename”]])
  • Label (string) – Displays a text at the top of the panel
  • Style (list of wxpython TextCtrl flags) – A list of flags for wx.TextCtrl with the flags you can control how the TextCtrl looks like per row. If more flags than one flag are needed then they are seperated by “|”. (The default is [wx.TE_LEFT])
  • Border (int) – The minimun vertical Border and horizontal Border between the TextFields and the edge of the panel (default is 1)
  • Flags (wxpython sizer flags) – The flags for wx.FlexGridSizer with the flags you can control where the textfields are placed (Aligned). If more flags than one flag are needed then they are seperated by “|”. (The default is wx.ALIGN_LEFT)
  • size (int or wx.ID_ANY (stands for the int -1)) – The width of the StaticTextFields and TextCtrlFields (the default is size is [0,0])
  • WindowSize (None or tuple) – This determines the size of the panel. When you want to use a scrolbar in a certain direction put in an int in that direction. For example for Vertical direction use (wx.ID_ANY,int). When not using a scrollbar use None.
Rparam:

wx.Panel with StaticText and TextCtrl

Return type:

wx.Panel

GetText()

Gets a list with all the Strings from the StaticTextFields.

Returns:A list with strings
Return type:list
GetValues()

Gets a list with all the Strings from the TextCtrlFields.

Returns:A list with strings
Return type:list
SetText(NewTextLst)

Sets the text for the StaticTextFields.

Parameters:Input (list) – A list with Strings.
SetValues(Input)

Sets the text for the TextCtrlFields.

Parameters:Input (list) – A list with Strings.
class WindowConstructor.CreateTextPanel(parent, TextNamelst=[['Ok', 'Cancel']], Border=3, size=-1, Flags=0, WindowSize=None)

The class creates textfields on a panel

Remarks

  • When This panel is added to a sizer and you want more space you can use wx.Expand and/or set proportion to 1 or more. If you use one or both you can use the wx.Align flags.

  • If flag wx.expand is called the StaticText fill up all the empty space.

  • If you want a empty textfield fill in a empty string (“”)

  • size has three different settings

    • wx.ID_ANY gives standard min textfield size that scales with the width of the text.
    • 0 gives a textfield size as small as the biggest textwidth.
    • a random positive number sets the pixcel width of the textfield to that number.

Warning

  • TextNamelst should always be a rectangle
  • Size should always be equal or larger than -1
Parameters:
  • parent (wx.Panel, wx.Frame or wx.Dialog) – The panel where this panel is placed on top.
  • TextNamelst (list with lists) – A 2D list of strings for the StaticTextfields (the default is [[“Ok”,”Cancel”]])
  • Border (int) – The minimun vertical Border and horizontal Border between the TextFields and the edge of the panel (default is 1)
  • Flags (wxpython sizer flags) – The flags for wx.FlexGridSizer with the flags you can control where the Textfields are placed (Aligned). If more flags than one flag are needed then they are seperated by “|”. (The default is wx.ALIGN_LEFT)
  • size (int or wx.ID_ANY (stands for the int -1)) – The width of the StaticTextFields (the default is size is wx.ID_ANY)
  • WindowSize (None or tuple) – This determines the size of the panel. When you want to use a scrolbar in a certain direction put in an int in that direction. For example for Vertical direction use (wx.ID_ANY,int). When not using a scrollbar use None.
Rparam:

wx.Panel with StaticText and TextCtrl

Return type:

wx.Panel

GetText()

Gets a list with all the Strings from the StaticTextFields.

Returns:A 2D list with strings (same as TextNamelst)
Return type:list with lists
SetText(NewTextLst)

Sets the text for the TextCtrlFields.

Parameters:Input (list with lists) – A 2D list with Strings.
class WindowConstructor.PanelCustomLayout(parent, PanelNameLst, CommandLst, PanelSize, fit=True, Border=3, Flags=8192)

This class makes from sevarel panels without layout one panel with a layout. Almost Every layout is possible.

Remarks

  • It is possible to make CommandLst and PanelSize your self, but mistakes are easily made. The advice is to use LayoutAlg and if your not completely satisfied change the out come of LayoutAlg.
  • In the Modul PCLAlgorithm the definition LayoutCommand gives in more detail an explanation how to make use of this class.
  • If you want some blank space somewhere use a empty wx.Panel
  • By changing the outcome of LayoutAlg you can use resizable panels and not resizable panels in the same frame.

Warning

  • If you want to use resizable panels make sure you give the frame or dialog a size. Then make a panel with the same size (self.GetSize() or self.GetClientSize()) and use this panel als parent for all the other panels. When using this class the parent should also be this panel.
  • If The parent of this class has no size the resizable panels can not be made.
Parameters:
  • parent (wx.Panel, wx.Frame or wx.Dialog) – The panel where this panel is placed on top.
  • PannelNamelst (dictionary) – A dictionary with with Keys (strings) that are the same as the input for LayoutCommand in the module PCLAlgorithm. The Values (wx.Panels) are the Panels that you belong to the key.
  • CommandLst (list) – A list that is easiest created by LayoutCommand. This list contains Commands about how the panels needed to be placed.
  • PanelSize (list with int) – list of two int they repressent the totaal weight factor in horizontal and vertical direction. This list is also created by LayoutCommand.
  • fit (boolean) – If fit is True the window will be made as small as possible (this is advised for dynamic resizable dialogs), if fit is false the size of the parent will not change (this is advised if basepanel and self have a predefined size).
  • Border (int) – The minimun vertical Border and horizontal Border between the panels and the edge of the panel (default is 3)
  • Flags (wxpython sizer flags) – The flags for wx.FlexGridSizer with the flags you can control where the panels are placed (Aligned). If more flags than one flag are needed then they are seperated by “|”. (The default is wx.EXPAND)
Rparam:

wx.Panel with wx.Panels

Return type:

wx.Panel

CleanPanels()

This functions cleans the panel so that a new panel layout can be made

Returns:Nothing
class WindowConstructor.PanelStLayout(parent, PanelNameLst, Layout='grid_St', Border=3, Flags=0)

This class makes from sevarel panels without layout one panel with a layout.

Remarks

  • The layout is always limited by the fact that is stays a grid

  • If you want a blank space in the grid. Then the input should be a empty wx.Panel

  • This variables from this class should not be used for binds.

  • Layout has four choices

    • “grid_St” gives a standard grid all the panels are the same size.
    • “grid_H” gives a grid where the panels have different sizes in horizantol direction.
    • “grid_V” gives a grid where the panels have different sizes in vertical direction.
    • “grid_A” gives a grid where the panels have different sizes in all directions.
Parameters:
  • parent (wx.Panel, wx.Frame or wx.Dialog) – The panel where this panel is placed on top.
  • PannelNamelst (list with lists) – A 2D list of wx.Panels for the sizers
  • layout (string) – How the panels are sized (default is grid_St)
  • Border (int) – The minimun vertical Border and horizontal Border between the panels and the edge of the panel (default is 3)
  • Flags (wxpython sizer flags) – The flags for wx.FlexGridSizer with the flags you can control where the panels are placed (Aligned). If more flags than one flag are needed then they are seperated by “|”. (The default is wx.ALIGN_LEFT)
Rparam:

wx.Panel with wx.Panels

Return type:

wx.Panel