+ self.mainPanel = wx.Panel(
+ size=(320, 160), parent=self,
+ id=ID_ANCHORSDEMOFRAMEMAINPANEL, name='panel1',
+ style=wx.TAB_TRAVERSAL | wx.CLIP_CHILDREN,
+ pos=(0, 0)
+ )
+
+ self.mainPanel.SetAutoLayout(True)
+
+ self.okButton = wx.Button(
+ label='OK', id=ID_ANCHORSDEMOFRAMEOKBUTTON,
+ parent=self.mainPanel, name='okButton',
+ size=(72, 24), style=0, pos=(240, 128)
+ )
+
+ self.okButton.SetConstraints(
+ anchors.LayoutAnchors(self.okButton, False, False, True, True)
+ )
+
+ self.Bind(
+ wx.EVT_BUTTON, self.OnOkButtonButton, id=ID_ANCHORSDEMOFRAMEOKBUTTON
+ )
+
+ self.backgroundPanel = wx.Panel(
+ size=(304, 80), parent=self.mainPanel,
+ id=ID_ANCHORSDEMOFRAMEBACKGROUNDPANEL,
+ name='backgroundPanel',
+ style=wx.SIMPLE_BORDER | wx.CLIP_CHILDREN,
+ pos = (8, 40)
+ )
+
+ self.backgroundPanel.SetBackgroundColour(wx.Colour(255, 255, 255))
+ self.backgroundPanel.SetConstraints(
+ anchors.LayoutAnchors(self.backgroundPanel, True, True, True, True)
+ )
+
+ self.anchoredPanel = wx.Panel(
+ size=(88, 48), id=ID_ANCHORSDEMOFRAMEANCHOREDPANEL,
+ parent=self.backgroundPanel, name='anchoredPanel',
+ style=wx.SIMPLE_BORDER, pos=(104, 16)
+ )
+
+ self.anchoredPanel.SetBackgroundColour(wx.Colour(0, 0, 222))
+ self.anchoredPanel.SetConstraints(
+ anchors.LayoutAnchors(self.anchoredPanel, False, False, False, False)
+ )
+
+ self.leftCheckBox = wx.CheckBox(
+ label='Left', id=ID_ANCHORSDEMOFRAMELEFTCHECKBOX,
+ parent=self.mainPanel, name='leftCheckBox',
+ size=(40, 16), style=0, pos=(8, 8)
+ )
+
+ self.leftCheckBox.SetConstraints(
+ anchors.LayoutAnchors(self.leftCheckBox, False, True, False, False)
+ )
+
+ self.Bind(
+ wx.EVT_CHECKBOX, self.OnCheckboxCheckbox, source=self.leftCheckBox,
+ id=ID_ANCHORSDEMOFRAMELEFTCHECKBOX
+ )
+
+ self.topCheckBox = wx.CheckBox(
+ label='Top', id=ID_ANCHORSDEMOFRAMETOPCHECKBOX,
+ parent=self.mainPanel, name='topCheckBox',
+ size=(40, 16), style=0, pos=(88, 8)
+ )
+
+ self.topCheckBox.SetConstraints(
+ anchors.LayoutAnchors(self.topCheckBox, False, True, False, False)
+ )
+
+ self.Bind(
+ wx.EVT_CHECKBOX, self.OnCheckboxCheckbox, source=self.topCheckBox,
+ id=ID_ANCHORSDEMOFRAMETOPCHECKBOX
+ )
+
+ self.rightCheckBox = wx.CheckBox(
+ label='Right', id=ID_ANCHORSDEMOFRAMERIGHTCHECKBOX,
+ parent=self.mainPanel, name='rightCheckBox',
+ size=(48, 16), style=0, pos=(168, 8)
+ )
+
+ self.rightCheckBox.SetConstraints(
+ anchors.LayoutAnchors(self.rightCheckBox, False, True, False, False)
+ )
+
+ self.Bind(
+ wx.EVT_CHECKBOX, self.OnCheckboxCheckbox, source=self.rightCheckBox,
+ id=ID_ANCHORSDEMOFRAMERIGHTCHECKBOX
+ )
+
+ self.bottomCheckBox = wx.CheckBox(
+ label='Bottom', id=ID_ANCHORSDEMOFRAMEBOTTOMCHECKBOX,
+ parent=self.mainPanel, name='bottomCheckBox',
+ size=(56, 16), style=0, pos=(248, 8)
+ )
+
+ self.bottomCheckBox.SetConstraints(
+ anchors.LayoutAnchors(self.bottomCheckBox, False, True, False, False)
+ )
+
+ self.Bind(
+ wx.EVT_CHECKBOX, self.OnCheckboxCheckbox, source=self.bottomCheckBox,
+ id=ID_ANCHORSDEMOFRAMEBOTTOMCHECKBOX
+ )
+
+ self.helpStaticText = wx.StaticText(
+ label='Select anchor options above, then resize window to see the effect',
+ id=ID_ANCHORSDEMOFRAMEHELPSTATICTEXT,
+ parent=self.mainPanel, name='helpStaticText',
+ size=(224, 24), style=wx.ST_NO_AUTORESIZE,
+ pos=(8, 128)
+ )
+
+ self.helpStaticText.SetConstraints(
+ anchors.LayoutAnchors(self.helpStaticText, True, False, True, True)
+ )