Esempio n. 1
0
class MyFrame2(wx.Frame):
    def __init__(self, parent):
        wx.Frame.__init__(
            self,
            parent,
            id=wx.ID_ANY,
            title=wx.EmptyString,
            pos=wx.DefaultPosition,
            size=wx.Size(500, 300),
            style=wx.DEFAULT_FRAME_STYLE | wx.TAB_TRAVERSAL,
        )

        self.SetSizeHintsSz(wx.DefaultSize, wx.DefaultSize)

        bSizer2 = wx.BoxSizer(wx.VERTICAL)

        self.m_notebook1 = wx.Notebook(self, wx.ID_ANY, wx.DefaultPosition,
                                       wx.DefaultSize, 0)
        from someStyledTextCtrl2 import PythonSTC  # ANDY

        # self.m_panel1 = wx.Panel( self.m_notebook1, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.TAB_TRAVERSAL ) # ANDY
        self.m_panel1 = PythonSTC(self.m_notebook1, wx.ID_ANY,
                                  wx.DefaultPosition, wx.DefaultSize,
                                  wx.TAB_TRAVERSAL)  # ANDY
        bSizer4 = wx.BoxSizer(wx.VERTICAL)

        # WARNING: wxPython code generation isn't supported for this widget yet.
        # self.m_scintilla1 = wx.Window( self.m_panel1 )  # ANDY
        self.m_scintilla1 = self.m_panel1  # ANDY
        bSizer4.Add(self.m_scintilla1, 1, wx.EXPAND | wx.ALL, 5)

        self.m_panel1.SetSizer(bSizer4)
        self.m_panel1.Layout()
        bSizer4.Fit(self.m_panel1)
        self.m_notebook1.AddPage(self.m_panel1, "Ed", True)
        self.m_panel2 = wx.Panel(self.m_notebook1, wx.ID_ANY,
                                 wx.DefaultPosition, wx.DefaultSize,
                                 wx.TAB_TRAVERSAL)
        self.m_notebook1.AddPage(self.m_panel2, "a page", False)
        self.m_panel3 = wx.Panel(self.m_notebook1, wx.ID_ANY,
                                 wx.DefaultPosition, wx.DefaultSize,
                                 wx.TAB_TRAVERSAL)
        self.m_notebook1.AddPage(self.m_panel3, "a page", False)

        bSizer2.Add(self.m_notebook1, 1, wx.EXPAND | wx.ALL, 5)

        self.SetSizer(bSizer2)
        self.Layout()

        self.Centre(wx.BOTH)

    def __del__(self):
        pass
Esempio n. 2
0
    def __init__(self, parent):
        wx.Frame.__init__(
            self,
            parent,
            id=wx.ID_ANY,
            title=wx.EmptyString,
            pos=wx.DefaultPosition,
            size=wx.Size(500, 300),
            style=wx.DEFAULT_FRAME_STYLE | wx.TAB_TRAVERSAL,
        )

        self.SetSizeHintsSz(wx.DefaultSize, wx.DefaultSize)

        bSizer2 = wx.BoxSizer(wx.VERTICAL)

        self.m_notebook1 = wx.Notebook(self, wx.ID_ANY, wx.DefaultPosition,
                                       wx.DefaultSize, 0)
        self.m_panel1 = wx.Panel(self.m_notebook1, wx.ID_ANY,
                                 wx.DefaultPosition, wx.DefaultSize,
                                 wx.TAB_TRAVERSAL)
        bSizer4 = wx.BoxSizer(wx.VERTICAL)

        # WARNING: wxPython code generation isn't supported for this widget yet.
        self.m_scintilla1 = wx.Window(self.m_panel1)
        bSizer4.Add(self.m_scintilla1, 1, wx.EXPAND | wx.ALL, 5)

        self.m_panel1.SetSizer(bSizer4)
        self.m_panel1.Layout()
        bSizer4.Fit(self.m_panel1)
        self.m_notebook1.AddPage(self.m_panel1, "Ed", False)
        self.m_panel2 = wx.Panel(self.m_notebook1, wx.ID_ANY,
                                 wx.DefaultPosition, wx.DefaultSize,
                                 wx.TAB_TRAVERSAL)
        bSizer5 = wx.BoxSizer(wx.VERTICAL)

        self.m_customControl1 = PythonSTC(self.m_panel2, wx.ID_ANY,
                                          wx.DefaultPosition, wx.DefaultSize,
                                          wx.TAB_TRAVERSAL)
        # settings from andy
        bSizer5.Add(self.m_customControl1, 1, wx.ALL | wx.EXPAND, 5)

        self.m_panel2.SetSizer(bSizer5)
        self.m_panel2.Layout()
        bSizer5.Fit(self.m_panel2)
        self.m_notebook1.AddPage(self.m_panel2, "andycustom", True)
        self.m_panel3 = wx.Panel(self.m_notebook1, wx.ID_ANY,
                                 wx.DefaultPosition, wx.DefaultSize,
                                 wx.TAB_TRAVERSAL)
        self.m_notebook1.AddPage(self.m_panel3, "a page", False)

        bSizer2.Add(self.m_notebook1, 1, wx.EXPAND | wx.ALL, 5)

        self.SetSizer(bSizer2)
        self.Layout()

        self.Centre(wx.BOTH)