3 |
3 |
4 # This file is part of Beremiz, a Integrated Development Environment for |
4 # This file is part of Beremiz, a Integrated Development Environment for |
5 # programming IEC 61131-3 automates supporting plcopen standard and CanFestival. |
5 # programming IEC 61131-3 automates supporting plcopen standard and CanFestival. |
6 # |
6 # |
7 # Copyright (C) 2012: Edouard TISSERANT and Laurent BESSARD |
7 # Copyright (C) 2012: Edouard TISSERANT and Laurent BESSARD |
|
8 # Copyright (C) 2017: Andrey Skvortsov <andrej.skvortzov@gmail.com> |
8 # |
9 # |
9 # See COPYING file for copyrights details. |
10 # See COPYING file for copyrights details. |
10 # |
11 # |
11 # This program is free software; you can redistribute it and/or |
12 # This program is free software; you can redistribute it and/or |
12 # modify it under the terms of the GNU General Public License |
13 # modify it under the terms of the GNU General Public License |
41 POU_LANGUAGES_DICT = dict([(_(language), language) for language in POU_LANGUAGES]) |
42 POU_LANGUAGES_DICT = dict([(_(language), language) for language in POU_LANGUAGES]) |
42 |
43 |
43 def __init__(self, parent, pou_type = None): |
44 def __init__(self, parent, pou_type = None): |
44 wx.Dialog.__init__(self, id=-1, parent=parent, |
45 wx.Dialog.__init__(self, id=-1, parent=parent, |
45 name='PouDialog', title=_('Create a new POU'), |
46 name='PouDialog', title=_('Create a new POU'), |
46 size=wx.Size(300, 200), style=wx.DEFAULT_DIALOG_STYLE) |
47 style=wx.DEFAULT_DIALOG_STYLE) |
47 self.SetClientSize(wx.Size(300, 200)) |
|
48 |
48 |
49 main_sizer = wx.FlexGridSizer(cols=1, hgap=0, rows=2, vgap=10) |
49 main_sizer = wx.FlexGridSizer(cols=1, hgap=0, rows=2, vgap=10) |
50 main_sizer.AddGrowableCol(0) |
50 main_sizer.AddGrowableCol(0) |
51 main_sizer.AddGrowableRow(0) |
51 main_sizer.AddGrowableRow(0) |
52 |
52 |
87 for option in GetPouTypes(): |
87 for option in GetPouTypes(): |
88 self.PouType.Append(_(option)) |
88 self.PouType.Append(_(option)) |
89 if pou_type is not None: |
89 if pou_type is not None: |
90 self.PouType.SetStringSelection(_(pou_type)) |
90 self.PouType.SetStringSelection(_(pou_type)) |
91 self.RefreshLanguage() |
91 self.RefreshLanguage() |
92 |
92 self.Fit() |
93 self.PouNames = [] |
93 self.PouNames = [] |
94 self.PouElementNames = [] |
94 self.PouElementNames = [] |
95 |
95 |
96 def OnOK(self, event): |
96 def OnOK(self, event): |
97 error = [] |
97 error = [] |