--- a/controls/ProjectPropertiesPanel.py Fri Jun 09 18:12:12 2017 +0300
+++ b/controls/ProjectPropertiesPanel.py Mon Jun 19 18:49:43 2017 +0300
@@ -5,6 +5,7 @@
# programming IEC 61131-3 automates supporting plcopen standard and CanFestival.
#
# Copyright (C) 2012: Edouard TISSERANT and Laurent BESSARD
+# Copyright (C) 2017: Andrey Skvortsov <andrej.skvortzov@gmail.com>
#
# See COPYING file for copyrights details.
#
@@ -61,7 +62,7 @@
flag=wx.GROW|border|wx.RIGHT)
def __init__(self, parent, controller=None, window=None, enable_required=True):
- wx.Notebook.__init__(self, parent, size=wx.Size(500, 300))
+ wx.Notebook.__init__(self, parent)
self.Controller = controller
self.ParentWindow = window
@@ -199,7 +200,7 @@
flag=wx.BOTTOM|wx.LEFT)
self.ContentDescription = wx.TextCtrl(self.MiscellaneousPanel,
- style=wx.TE_MULTILINE|wx.TE_PROCESS_ENTER)
+ size=wx.Size(240,150), style=wx.TE_MULTILINE|wx.TE_PROCESS_ENTER)
self.Bind(wx.EVT_TEXT_ENTER, self.OnContentDescriptionChanged,
self.ContentDescription)
self.ContentDescription.Bind(wx.EVT_KILL_FOCUS,
--- a/dialogs/ActionBlockDialog.py Fri Jun 09 18:12:12 2017 +0300
+++ b/dialogs/ActionBlockDialog.py Mon Jun 19 18:49:43 2017 +0300
@@ -4,6 +4,7 @@
# programming IEC 61131-3 automates supporting plcopen standard and CanFestival.
#
# Copyright (C) 2007: Edouard TISSERANT and Laurent BESSARD
+# Copyright (C) 2017: Andrey Skvortsov <andrej.skvortzov@gmail.com>
#
# See COPYING file for copyrights details.
#
@@ -117,8 +118,7 @@
class ActionBlockDialog(wx.Dialog):
def __init__(self, parent):
- wx.Dialog.__init__(self, parent,
- size=wx.Size(500, 300), title=_('Edit action block properties'))
+ wx.Dialog.__init__(self, parent, title=_('Edit action block properties'))
main_sizer = wx.FlexGridSizer(cols=1, hgap=0, rows=3, vgap=10)
main_sizer.AddGrowableCol(0)
@@ -144,7 +144,7 @@
setattr(self, name, button)
top_sizer.AddWindow(button)
- self.ActionsGrid = CustomGrid(self, size=wx.Size(0, 0), style=wx.VSCROLL)
+ self.ActionsGrid = CustomGrid(self, size=wx.Size(-1, 250), style=wx.VSCROLL)
self.ActionsGrid.DisableDragGridSize()
self.ActionsGrid.EnableScrolling(False, True)
self.ActionsGrid.Bind(wx.grid.EVT_GRID_CELL_CHANGE,
@@ -163,7 +163,7 @@
typelist = GetTypeList()
self.TypeList = ",".join(map(_,typelist))
self.TranslateType = dict([(_(value), value) for value in typelist])
- self.ColSizes = [60, 90, 80, 110, 80]
+ self.ColSizes = [60, 90, 130, 200, 50]
self.ColAlignements = [wx.ALIGN_LEFT, wx.ALIGN_LEFT, wx.ALIGN_LEFT, wx.ALIGN_LEFT, wx.ALIGN_LEFT]
self.ActionsGrid.SetTable(self.Table)
@@ -184,6 +184,7 @@
self.Table.ResetView(self.ActionsGrid)
self.ActionsGrid.SetFocus()
self.ActionsGrid.RefreshButtons()
+ self.Fit()
def OnOK(self, event):
self.ActionsGrid.CloseEditControl()
--- a/dialogs/BlockPreviewDialog.py Fri Jun 09 18:12:12 2017 +0300
+++ b/dialogs/BlockPreviewDialog.py Mon Jun 19 18:49:43 2017 +0300
@@ -5,6 +5,7 @@
# programming IEC 61131-3 automates supporting plcopen standard and CanFestival.
#
# Copyright (C) 2013: Edouard TISSERANT and Laurent BESSARD
+# Copyright (C) 2017: Andrey Skvortsov <andrej.skvortzov@gmail.com>
#
# See COPYING file for copyrights details.
#
@@ -38,16 +39,15 @@
class BlockPreviewDialog(wx.Dialog):
- def __init__(self, parent, controller, tagname, size, title):
+ def __init__(self, parent, controller, tagname, title):
"""
Constructor
@param parent: Parent wx.Window of dialog for modal
@param controller: Reference to project controller
@param tagname: Tagname of project POU edited
- @param size: wx.Size object containing size of dialog
@param title: Title of dialog frame
"""
- wx.Dialog.__init__(self, parent, size=size, title=title)
+ wx.Dialog.__init__(self, parent, title=title)
# Save reference to
self.Controller = controller
@@ -80,6 +80,7 @@
# Variable containing the graphic element name when dialog is opened
self.DefaultElementName = None
+ self.Fit()
# List of variables defined in POU {var_name: (var_class, var_type),...}
self.VariableList = {}
@@ -114,8 +115,8 @@
self.MainSizer.AddGrowableRow(main_growable_row)
# Create a sizer for dividing parameters in two columns
- column_sizer = wx.BoxSizer(wx.HORIZONTAL)
- self.MainSizer.AddSizer(column_sizer, border=20,
+ self.ColumnSizer = wx.BoxSizer(wx.HORIZONTAL)
+ self.MainSizer.AddSizer(self.ColumnSizer, border=20,
flag=wx.GROW|wx.TOP|wx.LEFT|wx.RIGHT)
# Create a sizer for left column
@@ -124,8 +125,8 @@
self.LeftGridSizer.AddGrowableCol(0)
if left_growable_row is not None:
self.LeftGridSizer.AddGrowableRow(left_growable_row)
- column_sizer.AddSizer(self.LeftGridSizer, 1, border=5,
- flag=wx.GROW|wx.RIGHT)
+ self.ColumnSizer.AddSizer(self.LeftGridSizer, 1, border=5,
+ flag=wx.GROW|wx.RIGHT|wx.EXPAND)
# Create a sizer for right column
self.RightGridSizer = wx.FlexGridSizer(cols=1, hgap=0,
@@ -133,7 +134,7 @@
self.RightGridSizer.AddGrowableCol(0)
if right_growable_row is not None:
self.RightGridSizer.AddGrowableRow(right_growable_row)
- column_sizer.AddSizer(self.RightGridSizer, 1, border=5,
+ self.ColumnSizer.AddSizer(self.RightGridSizer, 1, border=5,
flag=wx.GROW|wx.LEFT)
self.SetSizer(self.MainSizer)
--- a/dialogs/BrowseLocationsDialog.py Fri Jun 09 18:12:12 2017 +0300
+++ b/dialogs/BrowseLocationsDialog.py Mon Jun 19 18:49:43 2017 +0300
@@ -5,6 +5,7 @@
# programming IEC 61131-3 automates supporting plcopen standard and CanFestival.
#
# Copyright (C) 2007: Edouard TISSERANT and Laurent BESSARD
+# Copyright (C) 2017: Andrey Skvortsov <andrej.skvortzov@gmail.com>
#
# See COPYING file for copyrights details.
#
@@ -61,8 +62,7 @@
class BrowseLocationsDialog(wx.Dialog):
def __init__(self, parent, var_type, controller):
- wx.Dialog.__init__(self, parent,
- size=wx.Size(600, 400), title=_('Browse Locations'),
+ wx.Dialog.__init__(self, parent, title=_('Browse Locations'),
style=wx.DEFAULT_DIALOG_STYLE|wx.RESIZE_BORDER)
main_sizer = wx.FlexGridSizer(cols=1, hgap=0, rows=3, vgap=10)
@@ -75,6 +75,7 @@
self.LocationsTree = wx.TreeCtrl(self,
style=wx.TR_HAS_BUTTONS|wx.TR_SINGLE|wx.SUNKEN_BORDER|wx.TR_HIDE_ROOT|wx.TR_LINES_AT_ROOT)
+ self.LocationsTree.SetInitialSize(wx.Size(-1, 300))
self.Bind(wx.EVT_TREE_ITEM_ACTIVATED, self.OnLocationsTreeItemActivated,
self.LocationsTree)
main_sizer.AddWindow(self.LocationsTree, border=20,
@@ -91,7 +92,7 @@
button_gridsizer.AddWindow(direction_label,
flag=wx.ALIGN_CENTER_VERTICAL)
- self.DirFilterChoice = wx.ComboBox(self, size=wx.Size(0, -1), style=wx.CB_READONLY)
+ self.DirFilterChoice = wx.ComboBox(self, style=wx.CB_READONLY)
self.Bind(wx.EVT_COMBOBOX, self.OnFilterChoice, self.DirFilterChoice)
button_gridsizer.AddWindow(self.DirFilterChoice,
flag=wx.GROW|wx.ALIGN_CENTER_VERTICAL)
@@ -100,7 +101,7 @@
button_gridsizer.AddWindow(filter_label,
flag=wx.ALIGN_CENTER_VERTICAL)
- self.TypeFilterChoice = wx.ComboBox(self, size=wx.Size(0, -1), style=wx.CB_READONLY)
+ self.TypeFilterChoice = wx.ComboBox(self, style=wx.CB_READONLY)
self.Bind(wx.EVT_COMBOBOX, self.OnFilterChoice, self.TypeFilterChoice)
button_gridsizer.AddWindow(self.TypeFilterChoice,
flag=wx.GROW|wx.ALIGN_CENTER_VERTICAL)
@@ -144,6 +145,7 @@
self.RefreshFilters()
self.RefreshLocationsTree()
+ self.Fit()
def RefreshFilters(self):
self.DirFilter = DIRFILTERCHOICE_OPTIONS[self.DirFilterChoice.GetStringSelection()]
--- a/dialogs/BrowseValuesLibraryDialog.py Fri Jun 09 18:12:12 2017 +0300
+++ b/dialogs/BrowseValuesLibraryDialog.py Mon Jun 19 18:49:43 2017 +0300
@@ -5,6 +5,7 @@
# programming IEC 61131-3 automates supporting plcopen standard and CanFestival.
#
# Copyright (C) 2007: Edouard TISSERANT and Laurent BESSARD
+# Copyright (C) 2017: Andrey Skvortsov <andrej.skvortzov@gmail.com>
#
# See COPYING file for copyrights details.
#
@@ -33,18 +34,16 @@
def __init__(self, parent, name, library, default=None):
wx.Dialog.__init__(self,
name='BrowseValueDialog', parent=parent,
- size=wx.Size(600, 400), style=wx.DEFAULT_DIALOG_STYLE|wx.RESIZE_BORDER,
+ style=wx.DEFAULT_DIALOG_STYLE|wx.RESIZE_BORDER,
title=_('Browse %s values library') % name)
- self.SetClientSize(wx.Size(600, 400))
-
self.staticText1 = wx.StaticText(
label=_('Choose a value for %s:') % name, name='staticText1', parent=self,
pos=wx.Point(0, 0), size=wx.DefaultSize, style=0)
self.ValuesLibrary = wx.TreeCtrl(
name='ValuesLibrary', parent=self, pos=wx.Point(0, 0),
- size=wx.Size(0, 0), style=wx.TR_HAS_BUTTONS|wx.TR_SINGLE|wx.SUNKEN_BORDER|wx.TR_HIDE_ROOT|wx.TR_LINES_AT_ROOT)
+ size=wx.Size(400, 200), style=wx.TR_HAS_BUTTONS|wx.TR_SINGLE|wx.SUNKEN_BORDER|wx.TR_HIDE_ROOT|wx.TR_LINES_AT_ROOT)
self.ButtonSizer = self.CreateButtonSizer(wx.OK|wx.CANCEL|wx.CENTRE)
@@ -60,6 +59,7 @@
self.flexGridSizer1.AddGrowableRow(1)
self.SetSizer(self.flexGridSizer1)
+ self.Fit()
root = self.ValuesLibrary.AddRoot("")
self.GenerateValuesLibraryBranch(root, library, default)
--- a/dialogs/ConnectionDialog.py Fri Jun 09 18:12:12 2017 +0300
+++ b/dialogs/ConnectionDialog.py Mon Jun 19 18:49:43 2017 +0300
@@ -5,6 +5,7 @@
# programming IEC 61131-3 automates supporting plcopen standard and CanFestival.
#
# Copyright (C) 2007: Edouard TISSERANT and Laurent BESSARD
+# Copyright (C) 2017: Andrey Skvortsov <andrej.skvortzov@gmail.com>
#
# See COPYING file for copyrights details.
#
@@ -49,10 +50,10 @@
to all connector having the same name in POU (default: False)
"""
BlockPreviewDialog.__init__(self, parent, controller, tagname,
- size=wx.Size(350, 250), title=_('Connection Properties'))
+ title=_('Connection Properties'))
# Init common sizers
- self._init_sizers(2, 0, 5, None, 2, 1)
+ self._init_sizers(2, 0, 7, 1, 0, None)
# Create label for connection type
type_label = wx.StaticText(self, label=_('Type:'))
@@ -77,16 +78,19 @@
# Create text control for defining connection name
self.ConnectionName = wx.TextCtrl(self)
+ self.ConnectionName.SetMinSize(wx.Size(200,-1))
self.Bind(wx.EVT_TEXT, self.OnNameChanged, self.ConnectionName)
self.LeftGridSizer.AddWindow(self.ConnectionName, flag=wx.GROW)
# Add preview panel and associated label to sizers
- self.RightGridSizer.AddWindow(self.PreviewLabel, flag=wx.GROW)
- self.RightGridSizer.AddWindow(self.Preview, flag=wx.GROW)
+ self.Preview.SetMinSize(wx.Size(-1,100))
+ self.LeftGridSizer.AddWindow(self.PreviewLabel, flag=wx.GROW)
+ self.LeftGridSizer.AddWindow(self.Preview, flag=wx.GROW)
# Add buttons sizer to sizers
self.MainSizer.AddSizer(self.ButtonSizer, border=20,
flag=wx.ALIGN_RIGHT|wx.BOTTOM|wx.LEFT|wx.RIGHT)
+ self.ColumnSizer.RemoveSizer(self.RightGridSizer)
# Add button for applying connection name modification to all connection
# of POU
@@ -95,13 +99,12 @@
self.ApplyToAllButton.SetToolTipString(
_("Apply name modification to all continuations with the same name"))
self.Bind(wx.EVT_BUTTON, self.OnApplyToAll, self.ApplyToAllButton)
- self.ButtonSizer.AddWindow(self.ApplyToAllButton,
- border=(3 if wx.Platform == '__WXMSW__' else 10),
- flag=wx.LEFT)
+ self.ButtonSizer.AddWindow(self.ApplyToAllButton, flag=wx.LEFT)
else:
self.ConnectionName.ChangeValue(
controller.GenerateNewName(
tagname, None, "Connection%d", 0))
+ self.Fit()
# Connector radio button is default control having keyboard focus
self.TypeRadioButtons[CONNECTOR].SetFocus()
--- a/dialogs/DiscoveryDialog.py Fri Jun 09 18:12:12 2017 +0300
+++ b/dialogs/DiscoveryDialog.py Mon Jun 19 18:49:43 2017 +0300
@@ -5,6 +5,7 @@
# programming IEC 61131-3 automates supporting plcopen standard and CanFestival.
#
# Copyright (C) 2007: Edouard TISSERANT and Laurent BESSARD
+# Copyright (C) 2017: Andrey Skvortsov <andrej.skvortzov@gmail.com>
#
# See COPYING file for copyrights details.
#
@@ -77,8 +78,7 @@
def _init_ctrls(self, prnt):
wx.Dialog.__init__(self, id=ID_DISCOVERYDIALOG,
- name='DiscoveryDialog', parent=prnt,
- size=wx.Size(600, 600), style=wx.DEFAULT_DIALOG_STYLE,
+ name='DiscoveryDialog', parent=prnt, style=wx.DEFAULT_DIALOG_STYLE,
title=_('Service Discovery'))
self.staticText1 = wx.StaticText(id=ID_DISCOVERYDIALOGSTATICTEXT1,
@@ -97,6 +97,7 @@
self.ServicesList.SetColumnWidth(1, 150)
self.ServicesList.SetColumnWidth(2, 150)
self.ServicesList.SetColumnWidth(3, 150)
+ self.ServicesList.SetInitialSize(wx.Size(-1, 300))
self.Bind(wx.EVT_LIST_ITEM_SELECTED, self.OnItemSelected, id=ID_DISCOVERYDIALOGSERVICESLIST)
self.Bind(wx.EVT_LIST_ITEM_ACTIVATED, self.OnItemActivated, id=ID_DISCOVERYDIALOGSERVICESLIST)
@@ -120,6 +121,7 @@
self.ButtonSizer = self.CreateButtonSizer(wx.OK|wx.CANCEL|wx.CENTER)
self._init_sizers()
+ self.Fit()
def __init__(self, parent):
self._init_ctrls(parent)
--- a/dialogs/DurationEditorDialog.py Fri Jun 09 18:12:12 2017 +0300
+++ b/dialogs/DurationEditorDialog.py Mon Jun 19 18:49:43 2017 +0300
@@ -5,6 +5,7 @@
# programming IEC 61131-3 automates supporting plcopen standard and CanFestival.
#
# Copyright (C) 2007: Edouard TISSERANT and Laurent BESSARD
+# Copyright (C) 2017: Andrey Skvortsov <andrej.skvortzov@gmail.com>
#
# See COPYING file for copyrights details.
#
@@ -55,8 +56,7 @@
class DurationEditorDialog(wx.Dialog):
def __init__(self, parent):
- wx.Dialog.__init__(self, parent,
- size=wx.Size(700, 200), title=_('Edit Duration'))
+ wx.Dialog.__init__(self, parent, title=_('Edit Duration'))
main_sizer = wx.FlexGridSizer(cols=1, hgap=0, rows=2, vgap=10)
main_sizer.AddGrowableCol(0)
@@ -91,7 +91,7 @@
flag=wx.ALIGN_RIGHT|wx.BOTTOM|wx.LEFT|wx.RIGHT)
self.SetSizer(main_sizer)
-
+ self.Fit()
self.Days.SetFocus()
def SetDuration(self, value):
--- a/dialogs/FBDBlockDialog.py Fri Jun 09 18:12:12 2017 +0300
+++ b/dialogs/FBDBlockDialog.py Mon Jun 19 18:49:43 2017 +0300
@@ -5,6 +5,7 @@
# programming IEC 61131-3 automates supporting plcopen standard and CanFestival.
#
# Copyright (C) 2007: Edouard TISSERANT and Laurent BESSARD
+# Copyright (C) 2017: Andrey Skvortsov <andrej.skvortzov@gmail.com>
#
# See COPYING file for copyrights details.
#
@@ -56,7 +57,7 @@
@param tagname: Tagname of project POU edited
"""
BlockPreviewDialog.__init__(self, parent, controller, tagname,
- size=wx.Size(600, 450), title=_('Block Properties'))
+ title=_('Block Properties'))
# Init common sizers
self._init_sizers(2, 0, 1, 0, 3, 2)
@@ -68,6 +69,8 @@
# Create Library panel and add it to static box
self.LibraryPanel = LibraryPanel(self)
+ self.LibraryPanel.SetInitialSize(wx.Size(-1, 400))
+
# Set function to call when selection in Library panel changed
setattr(self.LibraryPanel, "_OnTreeItemSelected",
self.OnLibraryTreeItemSelected)
@@ -150,6 +153,7 @@
# Refresh Library panel values
self.LibraryPanel.SetBlockList(controller.GetBlockTypes(tagname))
+ self.Fit()
self.LibraryPanel.SetFocus()
def SetValues(self, values):
--- a/dialogs/FBDVariableDialog.py Fri Jun 09 18:12:12 2017 +0300
+++ b/dialogs/FBDVariableDialog.py Mon Jun 19 18:49:43 2017 +0300
@@ -5,6 +5,7 @@
# programming IEC 61131-3 automates supporting plcopen standard and CanFestival.
#
# Copyright (C) 2007: Edouard TISSERANT and Laurent BESSARD
+# Copyright (C) 2017: Andrey Skvortsov <andrej.skvortzov@gmail.com>
#
# See COPYING file for copyrights details.
#
@@ -60,7 +61,7 @@
@param exclude_input: Exclude input from variable class selection
"""
BlockPreviewDialog.__init__(self, parent, controller, tagname,
- size=wx.Size(400, 380), title=_('Variable Properties'))
+ title=_('Variable Properties'))
# Init common sizers
self._init_sizers(4, 2, 4, None, 3, 2)
@@ -97,10 +98,10 @@
# Create a list box to selected variable expression in the list of
# variables defined in POU
- self.VariableName = wx.ListBox(self, size=wx.Size(0, 120),
+ self.VariableName = wx.ListBox(self, size=wx.Size(-1,120),
style=wx.LB_SINGLE|wx.LB_SORT)
self.Bind(wx.EVT_LISTBOX, self.OnNameChanged, self.VariableName)
- self.RightGridSizer.AddWindow(self.VariableName, flag=wx.GROW)
+ self.RightGridSizer.AddWindow(self.VariableName, border=4, flag=wx.GROW|wx.TOP)
# Add preview panel and associated label to sizers
self.MainSizer.AddWindow(self.PreviewLabel, border=20,
@@ -124,6 +125,9 @@
# Refresh values in name list box
self.RefreshNameList()
+ self.Preview.SetInitialSize(wx.Size(-1, 60))
+ self.Fit()
+
# Class combo box is default control having keyboard focus
self.Class.SetFocus()
@@ -187,6 +191,7 @@
# Refresh preview panel
self.RefreshPreview()
+ self.Fit()
def GetValues(self):
"""
--- a/dialogs/FindInPouDialog.py Fri Jun 09 18:12:12 2017 +0300
+++ b/dialogs/FindInPouDialog.py Mon Jun 19 18:49:43 2017 +0300
@@ -5,6 +5,7 @@
# programming IEC 61131-3 automates supporting plcopen standard and CanFestival.
#
# Copyright (C) 2007: Edouard TISSERANT and Laurent BESSARD
+# Copyright (C) 2017: Andrey Skvortsov <andrej.skvortzov@gmail.com>
#
# See COPYING file for copyrights details.
#
@@ -34,10 +35,7 @@
def __init__(self, parent):
wx.Dialog.__init__(self, parent, title=_("Find"),
- size=wx.Size(500, 280), style=wx.CAPTION|
- wx.CLOSE_BOX|
- wx.CLIP_CHILDREN|
- wx.RESIZE_BORDER)
+ style=wx.CAPTION|wx.CLOSE_BOX|wx.CLIP_CHILDREN|wx.RESIZE_BORDER)
self._init_icon(parent)
panel = wx.Panel(self, style=wx.TAB_TRAVERSAL)
@@ -112,11 +110,18 @@
self.Bind(wx.EVT_BUTTON, self.OnCloseButton, self.CloseButton)
buttons_sizer.AddWindow(self.CloseButton)
- self.StatusLabel = wx.StaticText(panel, label= "")
+ # set the longest message here, to use it length to calculate
+ # optimal size of dialog window
+ self.RegExpSyntaxErrMsg = _("Syntax error in regular expression of pattern to search!")
+ self.StatusLabel = wx.StaticText(panel, label= self.RegExpSyntaxErrMsg)
controls_sizer.AddWindow(self.StatusLabel, flag=wx.ALIGN_CENTER_VERTICAL)
panel.SetSizer(main_sizer)
main_sizer.Fit(self)
+
+ # clear message after dialog size calculation
+ self.SetStatusText("")
+
self.ParentWindow = parent
@@ -169,7 +174,7 @@
CompilePattern(self.criteria)
except:
self.criteria.clear()
- message = _("Syntax error in regular expression of pattern to search!")
+ message = self.RegExpSyntaxErrMsg
self.SetStatusText(message)
if len(self.criteria) > 0:
wx.CallAfter(self.ParentWindow.FindInPou,
--- a/dialogs/LDElementDialog.py Fri Jun 09 18:12:12 2017 +0300
+++ b/dialogs/LDElementDialog.py Mon Jun 19 18:49:43 2017 +0300
@@ -5,6 +5,7 @@
# programming IEC 61131-3 automates supporting plcopen standard and CanFestival.
#
# Copyright (C) 2007: Edouard TISSERANT and Laurent BESSARD
+# Copyright (C) 2017: Andrey Skvortsov <andrej.skvortzov@gmail.com>
#
# See COPYING file for copyrights details.
#
@@ -50,7 +51,6 @@
@param type: Type of LD element ('contact or 'coil')
"""
BlockPreviewDialog.__init__(self, parent, controller, tagname,
- size=wx.Size(350, 320 if type == "contact" else 380),
title=(_("Edit Contact Values")
if type == "contact"
else _("Edit Coil Values")))
@@ -118,6 +118,7 @@
value_type == "BOOL":
self.ElementVariable.Append(name)
+ self.Fit()
# Normal radio button is default control having keyboard focus
self.ModifierRadioButtons[element_modifiers[0]].SetFocus()
--- a/dialogs/LDPowerRailDialog.py Fri Jun 09 18:12:12 2017 +0300
+++ b/dialogs/LDPowerRailDialog.py Mon Jun 19 18:49:43 2017 +0300
@@ -5,6 +5,7 @@
# programming IEC 61131-3 automates supporting plcopen standard and CanFestival.
#
# Copyright (C) 2007: Edouard TISSERANT and Laurent BESSARD
+# Copyright (C) 2017: Andrey Skvortsov <andrej.skvortzov@gmail.com>
#
# See COPYING file for copyrights details.
#
@@ -47,7 +48,7 @@
@param tagname: Tagname of project POU edited
"""
BlockPreviewDialog.__init__(self, parent, controller, tagname,
- size=wx.Size(350, 260), title=_('Power Rail Properties'))
+ title=_('Power Rail Properties'))
# Init common sizers
self._init_sizers(2, 0, 5, None, 2, 1)
@@ -87,6 +88,7 @@
# Add buttons sizer to sizers
self.MainSizer.AddSizer(self.ButtonSizer, border=20,
flag=wx.ALIGN_RIGHT|wx.BOTTOM|wx.LEFT|wx.RIGHT)
+ self.Fit()
# Left Power Rail radio button is default control having keyboard focus
self.TypeRadioButtons[LEFTRAIL].SetFocus()
--- a/dialogs/PouActionDialog.py Fri Jun 09 18:12:12 2017 +0300
+++ b/dialogs/PouActionDialog.py Mon Jun 19 18:49:43 2017 +0300
@@ -5,6 +5,7 @@
# programming IEC 61131-3 automates supporting plcopen standard and CanFestival.
#
# Copyright (C) 2012: Edouard TISSERANT and Laurent BESSARD
+# Copyright (C) 2017: Andrey Skvortsov <andrej.skvortzov@gmail.com>
#
# See COPYING file for copyrights details.
#
@@ -34,8 +35,7 @@
class PouActionDialog(wx.Dialog):
def __init__(self, parent):
- wx.Dialog.__init__(self, parent, size=wx.Size(320, 200),
- title=_('Create a new action'))
+ wx.Dialog.__init__(self, parent, title=_('Create a new action'))
main_sizer = wx.FlexGridSizer(cols=1, hgap=0, rows=2, vgap=10)
main_sizer.AddGrowableCol(0)
@@ -50,7 +50,7 @@
infos_sizer.AddWindow(actionname_label, border=4,
flag=wx.ALIGN_CENTER_VERTICAL|wx.TOP)
- self.ActionName = wx.TextCtrl(self)
+ self.ActionName = wx.TextCtrl(self, size=wx.Size(180,-1))
infos_sizer.AddWindow(self.ActionName, flag=wx.GROW)
language_label = wx.StaticText(self, label=_('Language:'))
@@ -71,6 +71,7 @@
for option in GetActionLanguages():
self.Language.Append(_(option))
+ self.Fit()
self.PouNames = []
self.PouElementNames = []
--- a/dialogs/PouDialog.py Fri Jun 09 18:12:12 2017 +0300
+++ b/dialogs/PouDialog.py Mon Jun 19 18:49:43 2017 +0300
@@ -5,6 +5,7 @@
# programming IEC 61131-3 automates supporting plcopen standard and CanFestival.
#
# Copyright (C) 2012: Edouard TISSERANT and Laurent BESSARD
+# Copyright (C) 2017: Andrey Skvortsov <andrej.skvortzov@gmail.com>
#
# See COPYING file for copyrights details.
#
@@ -43,8 +44,7 @@
def __init__(self, parent, pou_type = None):
wx.Dialog.__init__(self, id=-1, parent=parent,
name='PouDialog', title=_('Create a new POU'),
- size=wx.Size(300, 200), style=wx.DEFAULT_DIALOG_STYLE)
- self.SetClientSize(wx.Size(300, 200))
+ style=wx.DEFAULT_DIALOG_STYLE)
main_sizer = wx.FlexGridSizer(cols=1, hgap=0, rows=2, vgap=10)
main_sizer.AddGrowableCol(0)
@@ -89,7 +89,7 @@
if pou_type is not None:
self.PouType.SetStringSelection(_(pou_type))
self.RefreshLanguage()
-
+ self.Fit()
self.PouNames = []
self.PouElementNames = []
--- a/dialogs/PouTransitionDialog.py Fri Jun 09 18:12:12 2017 +0300
+++ b/dialogs/PouTransitionDialog.py Mon Jun 19 18:49:43 2017 +0300
@@ -5,6 +5,7 @@
# programming IEC 61131-3 automates supporting plcopen standard and CanFestival.
#
# Copyright (C) 2012: Edouard TISSERANT and Laurent BESSARD
+# Copyright (C) 2017: Andrey Skvortsov <andrej.skvortzov@gmail.com>
#
# See COPYING file for copyrights details.
#
@@ -38,14 +39,13 @@
class PouTransitionDialog(wx.Dialog):
def __init__(self, parent):
- wx.Dialog.__init__(self, parent, size=wx.Size(350, 200),
- title=_('Create a new transition'))
+ wx.Dialog.__init__(self, parent, title=_('Create a new transition'))
main_sizer = wx.FlexGridSizer(cols=1, hgap=0, rows=2, vgap=10)
main_sizer.AddGrowableCol(0)
main_sizer.AddGrowableRow(0)
- infos_sizer = wx.FlexGridSizer(cols=2, hgap=5, rows=3, vgap=15)
+ infos_sizer = wx.FlexGridSizer(cols=2, hgap=5, rows=3, vgap=10)
infos_sizer.AddGrowableCol(1)
main_sizer.AddSizer(infos_sizer, border=20,
flag=wx.GROW|wx.TOP|wx.LEFT|wx.RIGHT)
@@ -54,7 +54,7 @@
infos_sizer.AddWindow(transitionname_label, border=4,
flag=wx.ALIGN_CENTER_VERTICAL|wx.TOP)
- self.TransitionName = wx.TextCtrl(self)
+ self.TransitionName = wx.TextCtrl(self, size=wx.Size(180,-1))
infos_sizer.AddWindow(self.TransitionName, flag=wx.GROW)
language_label = wx.StaticText(self, label=_('Language:'))
@@ -63,17 +63,17 @@
self.Language = wx.ComboBox(self, style=wx.CB_READONLY)
infos_sizer.AddWindow(self.Language, flag=wx.GROW)
-
+
button_sizer = self.CreateButtonSizer(wx.OK|wx.CANCEL|wx.CENTRE)
self.Bind(wx.EVT_BUTTON, self.OnOK, button_sizer.GetAffirmativeButton())
- main_sizer.AddSizer(button_sizer, border=20,
- flag=wx.ALIGN_RIGHT|wx.BOTTOM|wx.LEFT|wx.RIGHT)
+ main_sizer.AddSizer(button_sizer, border=20, flag=wx.ALIGN_RIGHT|wx.BOTTOM)
self.SetSizer(main_sizer)
for language in GetTransitionLanguages():
self.Language.Append(_(language))
+ self.Fit()
self.PouNames = []
self.PouElementNames = []
--- a/dialogs/ProjectDialog.py Fri Jun 09 18:12:12 2017 +0300
+++ b/dialogs/ProjectDialog.py Mon Jun 19 18:49:43 2017 +0300
@@ -5,6 +5,7 @@
# programming IEC 61131-3 automates supporting plcopen standard and CanFestival.
#
# Copyright (C) 2012: Edouard TISSERANT and Laurent BESSARD
+# Copyright (C) 2017: Andrey Skvortsov <andrej.skvortzov@gmail.com>
#
# See COPYING file for copyrights details.
#
@@ -30,7 +31,7 @@
def __init__(self, parent, enable_required=True):
wx.Dialog.__init__(self, parent, title=_('Project properties'),
- size=wx.Size(500, 350), style=wx.DEFAULT_DIALOG_STYLE)
+ style=wx.DEFAULT_DIALOG_STYLE)
main_sizer = wx.FlexGridSizer(cols=1, hgap=0, rows=2, vgap=10)
main_sizer.AddGrowableCol(0)
@@ -47,6 +48,8 @@
flag=wx.ALIGN_RIGHT|wx.BOTTOM|wx.LEFT|wx.RIGHT)
self.SetSizer(main_sizer)
+ self.ProjectProperties.Fit()
+ self.Fit()
def OnOK(self, event):
values = self.ProjectProperties.GetValues()
--- a/dialogs/SFCDivergenceDialog.py Fri Jun 09 18:12:12 2017 +0300
+++ b/dialogs/SFCDivergenceDialog.py Mon Jun 19 18:49:43 2017 +0300
@@ -5,6 +5,7 @@
# programming IEC 61131-3 automates supporting plcopen standard and CanFestival.
#
# Copyright (C) 2007: Edouard TISSERANT and Laurent BESSARD
+# Copyright (C) 2017: Andrey Skvortsov <andrej.skvortzov@gmail.com>
#
# See COPYING file for copyrights details.
#
@@ -48,8 +49,7 @@
@param tagname: Tagname of project POU edited
@param poss_div_types: Types of divergence that will be available in the dialog window
"""
- BlockPreviewDialog.__init__(self, parent, controller, tagname,
- size=wx.Size(500, 300),
+ BlockPreviewDialog.__init__(self, parent, controller, tagname,
title=_('Create a new divergence or convergence'))
# Init common sizers
@@ -102,6 +102,8 @@
self.MainSizer.AddSizer(self.ButtonSizer, border=20,
flag=wx.ALIGN_RIGHT|wx.BOTTOM|wx.LEFT|wx.RIGHT)
+ self.Fit()
+
# Selection divergence radio button is default control having keyboard
# focus
self.TypeRadioButtons[focusbtn].SetFocus()
--- a/dialogs/SFCStepDialog.py Fri Jun 09 18:12:12 2017 +0300
+++ b/dialogs/SFCStepDialog.py Mon Jun 19 18:49:43 2017 +0300
@@ -5,6 +5,7 @@
# programming IEC 61131-3 automates supporting plcopen standard and CanFestival.
#
# Copyright (C) 2007: Edouard TISSERANT and Laurent BESSARD
+# Copyright (C) 2017: Andrey Skvortsov <andrej.skvortzov@gmail.com>
#
# See COPYING file for copyrights details.
#
@@ -47,7 +48,7 @@
@param initial: True if step is initial (default: False)
"""
BlockPreviewDialog.__init__(self,parent, controller, tagname,
- size=wx.Size(400, 280), title=_('Edit Step'))
+ title=_('Edit Step'))
# Init common sizers
self._init_sizers(2, 0, 6, None, 2, 1)
@@ -91,6 +92,8 @@
# Set default name for step
self.StepName.ChangeValue(controller.GenerateNewName(
tagname, None, "Step%d", 0))
+
+ self.Fit()
# Step name text control is default control having keyboard focus
self.StepName.SetFocus()
--- a/dialogs/SFCTransitionDialog.py Fri Jun 09 18:12:12 2017 +0300
+++ b/dialogs/SFCTransitionDialog.py Mon Jun 19 18:49:43 2017 +0300
@@ -5,6 +5,7 @@
# programming IEC 61131-3 automates supporting plcopen standard and CanFestival.
#
# Copyright (C) 2007: Edouard TISSERANT and Laurent BESSARD
+# Copyright (C) 2017: Andrey Skvortsov <andrej.skvortzov@gmail.com>
#
# See COPYING file for copyrights details.
#
@@ -48,7 +49,7 @@
connection (default: True)
"""
BlockPreviewDialog.__init__(self, parent, controller, tagname,
- size=wx.Size(350, 350), title=_('Edit transition'))
+ title=_('Edit transition'))
# Init common sizers
self._init_sizers(2, 0, 8, None, 2, 1)
@@ -101,6 +102,8 @@
# Add buttons sizer to sizers
self.MainSizer.AddSizer(self.ButtonSizer, border=20,
flag=wx.ALIGN_RIGHT|wx.BOTTOM|wx.LEFT|wx.RIGHT)
+
+ self.Fit()
# Reference radio button is default control having keyboard focus
self.TypeRadioButtons["reference"][0].SetFocus()
--- a/dialogs/SearchInProjectDialog.py Fri Jun 09 18:12:12 2017 +0300
+++ b/dialogs/SearchInProjectDialog.py Mon Jun 19 18:49:43 2017 +0300
@@ -5,6 +5,7 @@
# programming IEC 61131-3 automates supporting plcopen standard and CanFestival.
#
# Copyright (C) 2007: Edouard TISSERANT and Laurent BESSARD
+# Copyright (C) 2017: Andrey Skvortsov <andrej.skvortzov@gmail.com>
#
# See COPYING file for copyrights details.
#
@@ -41,8 +42,7 @@
class SearchInProjectDialog(wx.Dialog):
def __init__(self, parent):
- wx.Dialog.__init__(self, parent, title=_('Search in Project'),
- size=wx.Size(600, 350))
+ wx.Dialog.__init__(self, parent, title=_('Search in Project'))
main_sizer = wx.FlexGridSizer(cols=1, hgap=0, rows=3, vgap=10)
main_sizer.AddGrowableCol(0)
@@ -59,7 +59,7 @@
self.CaseSensitive = wx.CheckBox(self, label=_('Case sensitive'))
pattern_sizer.AddWindow(self.CaseSensitive, flag=wx.GROW)
- self.Pattern = wx.TextCtrl(self)
+ self.Pattern = wx.TextCtrl(self, size=wx.Size(250,-1))
self.Bind(wx.EVT_TEXT, self.FindPatternChanged, self.Pattern)
pattern_sizer.AddWindow(self.Pattern, flag=wx.GROW)
self.Bind(wx.EVT_CHAR_HOOK, self.OnEscapeKey)
@@ -75,15 +75,13 @@
scope_sizer.AddSizer(scope_selection_sizer, 1, border=5,
flag=wx.GROW|wx.TOP|wx.LEFT|wx.BOTTOM)
- self.WholeProject = wx.RadioButton(self, label=_('Whole Project'),
- size=wx.Size(0, 24), style=wx.RB_GROUP)
+ self.WholeProject = wx.RadioButton(self, label=_('Whole Project'), style=wx.RB_GROUP)
self.WholeProject.SetValue(True)
self.Bind(wx.EVT_RADIOBUTTON, self.OnScopeChanged, self.WholeProject)
scope_selection_sizer.AddWindow(self.WholeProject, border=5,
flag=wx.GROW|wx.BOTTOM)
- self.OnlyElements = wx.RadioButton(self,
- label=_('Only Elements'), size=wx.Size(0, 24))
+ self.OnlyElements = wx.RadioButton(self, label=_('Only Elements'))
self.Bind(wx.EVT_RADIOBUTTON, self.OnScopeChanged, self.OnlyElements)
self.OnlyElements.SetValue(False)
scope_selection_sizer.AddWindow(self.OnlyElements, flag=wx.GROW)
@@ -110,6 +108,8 @@
for name, label in GetElementsChoices():
self.ElementsList.Append(_(label))
+
+ self.Fit()
self.infosPrev = {}
self.criteria = {}
self.Pattern.SetFocus()
--- a/editors/ConfTreeNodeEditor.py Fri Jun 09 18:12:12 2017 +0300
+++ b/editors/ConfTreeNodeEditor.py Mon Jun 19 18:49:43 2017 +0300
@@ -5,6 +5,7 @@
# programming IEC 61131-3 automates supporting plcopen standard and CanFestival.
#
# Copyright (C) 2007: Edouard TISSERANT and Laurent BESSARD
+# Copyright (C) 2017: Andrey Skvortsov <andrej.skvortzov@gmail.com>
#
# See COPYING file for copyrights details.
#
@@ -380,8 +381,7 @@
value_infos = None
browse_boxsizer.AddWindow(textctrl)
- button = wx.Button(self.ParamsEditor,
- label="...", size=wx.Size(25, 25))
+ button = wx.Button(self.ParamsEditor, label="...")
browse_boxsizer.AddWindow(button)
button.Bind(wx.EVT_BUTTON,
self.GetBrowseCallBackFunction(element_infos["name"], textctrl, element_infos["type"],