69 |
69 |
70 # Bind paint event on Preview panel |
70 # Bind paint event on Preview panel |
71 self.Preview.Bind(wx.EVT_PAINT, self.OnPaint) |
71 self.Preview.Bind(wx.EVT_PAINT, self.OnPaint) |
72 |
72 |
73 # Add default dialog buttons sizer |
73 # Add default dialog buttons sizer |
74 self.ButtonSizer = self.CreateButtonSizer(wx.OK|wx.CANCEL|wx.CENTRE) |
74 self.ButtonSizer = self.CreateButtonSizer(wx.OK | wx.CANCEL | wx.CENTRE) |
75 self.Bind(wx.EVT_BUTTON, self.OnOK, |
75 self.Bind(wx.EVT_BUTTON, self.OnOK, |
76 self.ButtonSizer.GetAffirmativeButton()) |
76 self.ButtonSizer.GetAffirmativeButton()) |
77 |
77 |
78 self.Element = None # Graphic element to display in preview |
78 self.Element = None # Graphic element to display in preview |
79 self.MinElementSize = None # Graphic element minimal size |
79 self.MinElementSize = None # Graphic element minimal size |
115 self.MainSizer.AddGrowableRow(main_growable_row) |
115 self.MainSizer.AddGrowableRow(main_growable_row) |
116 |
116 |
117 # Create a sizer for dividing parameters in two columns |
117 # Create a sizer for dividing parameters in two columns |
118 self.ColumnSizer = wx.BoxSizer(wx.HORIZONTAL) |
118 self.ColumnSizer = wx.BoxSizer(wx.HORIZONTAL) |
119 self.MainSizer.AddSizer(self.ColumnSizer, border=20, |
119 self.MainSizer.AddSizer(self.ColumnSizer, border=20, |
120 flag=wx.GROW|wx.TOP|wx.LEFT|wx.RIGHT) |
120 flag=wx.GROW | wx.TOP | wx.LEFT | wx.RIGHT) |
121 |
121 |
122 # Create a sizer for left column |
122 # Create a sizer for left column |
123 self.LeftGridSizer = wx.FlexGridSizer(cols=1, hgap=0, |
123 self.LeftGridSizer = wx.FlexGridSizer(cols=1, hgap=0, |
124 rows=left_rows, vgap=5) |
124 rows=left_rows, vgap=5) |
125 self.LeftGridSizer.AddGrowableCol(0) |
125 self.LeftGridSizer.AddGrowableCol(0) |
126 if left_growable_row is not None: |
126 if left_growable_row is not None: |
127 self.LeftGridSizer.AddGrowableRow(left_growable_row) |
127 self.LeftGridSizer.AddGrowableRow(left_growable_row) |
128 self.ColumnSizer.AddSizer(self.LeftGridSizer, 1, border=5, |
128 self.ColumnSizer.AddSizer(self.LeftGridSizer, 1, border=5, |
129 flag=wx.GROW|wx.RIGHT|wx.EXPAND) |
129 flag=wx.GROW | wx.RIGHT | wx.EXPAND) |
130 |
130 |
131 # Create a sizer for right column |
131 # Create a sizer for right column |
132 self.RightGridSizer = wx.FlexGridSizer(cols=1, hgap=0, |
132 self.RightGridSizer = wx.FlexGridSizer(cols=1, hgap=0, |
133 rows=right_rows, vgap=0) |
133 rows=right_rows, vgap=0) |
134 self.RightGridSizer.AddGrowableCol(0) |
134 self.RightGridSizer.AddGrowableCol(0) |
135 if right_growable_row is not None: |
135 if right_growable_row is not None: |
136 self.RightGridSizer.AddGrowableRow(right_growable_row) |
136 self.RightGridSizer.AddGrowableRow(right_growable_row) |
137 self.ColumnSizer.AddSizer(self.RightGridSizer, 1, border=5, |
137 self.ColumnSizer.AddSizer(self.RightGridSizer, 1, border=5, |
138 flag=wx.GROW|wx.LEFT) |
138 flag=wx.GROW | wx.LEFT) |
139 |
139 |
140 self.SetSizer(self.MainSizer) |
140 self.SetSizer(self.MainSizer) |
141 |
141 |
142 def SetMinElementSize(self, size): |
142 def SetMinElementSize(self, size): |
143 """ |
143 """ |