Robot Framework Integrated Development Environment (RIDE)
sizers.py
Go to the documentation of this file.
1 # Copyright 2008-2015 Nokia Networks
2 # Copyright 2016- Robot Framework Foundation
3 #
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
7 #
8 # http://www.apache.org/licenses/LICENSE-2.0
9 #
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
15 
16 import wx
17 
18 
19 class _BoxSizer(wx.BoxSizer):
20 
21  def __init__(self):
22  wx.BoxSizer.__init__(self, orient=self.orientation)
23  # print(f"DEBUG: _BoxSizer __init__ after super init, orientation is {self.orientation}")
24 
25  def add(self, component, proportion=0, flag=0):
26  # self.Add(component, proportion=proportion, flag=flag)
27  self.Add(component, wx.SizerFlags(proportion).Align(flag))
28 
29  def add_with_padding(self, component, padding=5):
30  # self.Add(component, flag=wx.ALL, border=padding)
31  self.Add(component, wx.SizerFlags(0).Border(wx.ALL, padding))
32 
33  def add_expanding(self, component, propotion=1, padding=0):
34  # self.Add(component, proportion=propotion, flag=wx.EXPAND | wx.ALL,
35  # border=)
36  self.Add(component, wx.SizerFlags(propotion).Expand().Border(wx.ALL, padding))
37 
38 
40 
41  def __init__(self):
42  self.orientationorientation = wx.VERTICAL
43  _BoxSizer.__init__(self)
44 
45 
47 
48  def __init__(self):
49  self.orientationorientation = wx.HORIZONTAL
50  _BoxSizer.__init__(self)
51 
52  def add_to_end(self, component):
53  # self.Add(component, flag=wx.ALIGN_RIGHT)
54  self.Add(component, wx.SizerFlags().Align(wx.ALIGN_RIGHT))
def add_to_end(self, component)
Definition: sizers.py:52
def add(self, component, proportion=0, flag=0)
Definition: sizers.py:25
def add_expanding(self, component, propotion=1, padding=0)
Definition: sizers.py:33
def add_with_padding(self, component, padding=5)
Definition: sizers.py:29