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 |
28 |
29 |
29 class ProjectDialog(wx.Dialog): |
30 class ProjectDialog(wx.Dialog): |
30 |
31 |
31 def __init__(self, parent, enable_required=True): |
32 def __init__(self, parent, enable_required=True): |
32 wx.Dialog.__init__(self, parent, title=_('Project properties'), |
33 wx.Dialog.__init__(self, parent, title=_('Project properties'), |
33 size=wx.Size(500, 350), style=wx.DEFAULT_DIALOG_STYLE) |
34 style=wx.DEFAULT_DIALOG_STYLE) |
34 |
35 |
35 main_sizer = wx.FlexGridSizer(cols=1, hgap=0, rows=2, vgap=10) |
36 main_sizer = wx.FlexGridSizer(cols=1, hgap=0, rows=2, vgap=10) |
36 main_sizer.AddGrowableCol(0) |
37 main_sizer.AddGrowableCol(0) |
37 main_sizer.AddGrowableRow(0) |
38 main_sizer.AddGrowableRow(0) |
38 |
39 |
45 self.ButtonSizer.GetAffirmativeButton()) |
46 self.ButtonSizer.GetAffirmativeButton()) |
46 main_sizer.AddSizer(self.ButtonSizer, border=20, |
47 main_sizer.AddSizer(self.ButtonSizer, border=20, |
47 flag=wx.ALIGN_RIGHT|wx.BOTTOM|wx.LEFT|wx.RIGHT) |
48 flag=wx.ALIGN_RIGHT|wx.BOTTOM|wx.LEFT|wx.RIGHT) |
48 |
49 |
49 self.SetSizer(main_sizer) |
50 self.SetSizer(main_sizer) |
|
51 self.ProjectProperties.Fit() |
|
52 self.Fit() |
50 |
53 |
51 def OnOK(self, event): |
54 def OnOK(self, event): |
52 values = self.ProjectProperties.GetValues() |
55 values = self.ProjectProperties.GetValues() |
53 error = [] |
56 error = [] |
54 for param, name in [("projectName", _("Project Name")), |
57 for param, name in [("projectName", _("Project Name")), |