equal
deleted
inserted
replaced
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 |
32 ACTION_LANGUAGES_DICT = dict([(_(language), language) for language in GetActionLanguages()]) |
33 ACTION_LANGUAGES_DICT = dict([(_(language), language) for language in GetActionLanguages()]) |
33 |
34 |
34 class PouActionDialog(wx.Dialog): |
35 class PouActionDialog(wx.Dialog): |
35 |
36 |
36 def __init__(self, parent): |
37 def __init__(self, parent): |
37 wx.Dialog.__init__(self, parent, size=wx.Size(320, 200), |
38 wx.Dialog.__init__(self, parent, title=_('Create a new action')) |
38 title=_('Create a new action')) |
|
39 |
39 |
40 main_sizer = wx.FlexGridSizer(cols=1, hgap=0, rows=2, vgap=10) |
40 main_sizer = wx.FlexGridSizer(cols=1, hgap=0, rows=2, vgap=10) |
41 main_sizer.AddGrowableCol(0) |
41 main_sizer.AddGrowableCol(0) |
42 main_sizer.AddGrowableRow(0) |
42 main_sizer.AddGrowableRow(0) |
43 |
43 |
48 |
48 |
49 actionname_label = wx.StaticText(self, label=_('Action Name:')) |
49 actionname_label = wx.StaticText(self, label=_('Action Name:')) |
50 infos_sizer.AddWindow(actionname_label, border=4, |
50 infos_sizer.AddWindow(actionname_label, border=4, |
51 flag=wx.ALIGN_CENTER_VERTICAL|wx.TOP) |
51 flag=wx.ALIGN_CENTER_VERTICAL|wx.TOP) |
52 |
52 |
53 self.ActionName = wx.TextCtrl(self) |
53 self.ActionName = wx.TextCtrl(self, size=wx.Size(180,-1)) |
54 infos_sizer.AddWindow(self.ActionName, flag=wx.GROW) |
54 infos_sizer.AddWindow(self.ActionName, flag=wx.GROW) |
55 |
55 |
56 language_label = wx.StaticText(self, label=_('Language:')) |
56 language_label = wx.StaticText(self, label=_('Language:')) |
57 infos_sizer.AddWindow(language_label, border=4, |
57 infos_sizer.AddWindow(language_label, border=4, |
58 flag=wx.ALIGN_CENTER_VERTICAL|wx.TOP) |
58 flag=wx.ALIGN_CENTER_VERTICAL|wx.TOP) |
69 self.SetSizer(main_sizer) |
69 self.SetSizer(main_sizer) |
70 |
70 |
71 for option in GetActionLanguages(): |
71 for option in GetActionLanguages(): |
72 self.Language.Append(_(option)) |
72 self.Language.Append(_(option)) |
73 |
73 |
|
74 self.Fit() |
74 self.PouNames = [] |
75 self.PouNames = [] |
75 self.PouElementNames = [] |
76 self.PouElementNames = [] |
76 |
77 |
77 def OnOK(self, event): |
78 def OnOK(self, event): |
78 error = [] |
79 error = [] |