Beispiel #1
0
 def MakeSymbolBook(self):
     paneinfo = aui.AuiPaneInfo().Name("book").CenterPane().PaneBorder(
         False)
     ctrl = aui.AuiNotebook(self,
                            agwStyle=aui.AUI_NB_DEFAULT_STYLE
                            | aui.AUI_NB_TAB_EXTERNAL_MOVE | wx.NO_BORDER)
     self.mgr.AddPane(ctrl, paneinfo)
Beispiel #2
0
    def __init__(self, parent=None, *args, **kw):
        wx.Panel.__init__(self, parent, id=-1)
        self.tableName = None
        self.parent = parent
        self.dataSourceTreeNode = None
        if kw and 'tableName' in kw.keys():
            self.tableName = kw['tableName']
            self.dataSourceTreeNode = kw['dataSourceTreeNode']
        vBox = wx.BoxSizer(wx.VERTICAL)

        ####################################################################
        # Attributes
        self._nb = aui.AuiNotebook(self)
        self.addTab()
        ####################################################################
        self.__DoLayout()
Beispiel #3
0
    def __init__(self, parent, log):
        self.log = log
        wx.Panel.__init__(self, parent, -1)

        self.nb = aui.AuiNotebook(self)
        page = wx.TextCtrl(self.nb, -1, text, style=wx.TE_MULTILINE)
        self.nb.AddPage(page, "Welcome")

        for num in range(1, 5):
            page = wx.TextCtrl(self.nb,
                               -1,
                               "This is page %d" % num,
                               style=wx.TE_MULTILINE)
            self.nb.AddPage(page, "Tab Number %d" % num)

        sizer = wx.BoxSizer()
        sizer.Add(self.nb, 1, wx.EXPAND)
        self.SetSizer(sizer)
        wx.CallAfter(self.nb.SendSizeEvent)
    def __init__(self, parent=None, *args, **kw):
        wx.Panel.__init__(self, parent, id=-1)
        self.parent = parent
        self.fileOperations = FileOperations()

        # Attributes
        self._nb = aui.AuiNotebook(self)
        #         if "worksheet" == os.path.split(os.getcwd())[-1:][0]:
        #             imageLocation = os.path.join("..", "..", "images")
        #         #             playImage=wx.Bitmap(os.path.join("..","..", "images", "play.png"))
        #         elif "view" == os.path.split(os.getcwd())[-1:][0]:
        #         imageLocation = os.path.join(path)
        imgList = wx.ImageList(16, 16)
        imgList.Add(self.fileOperations.getImageBitmap("sql_script.png"))

        self._nb.AssignImageList(imgList)

        self.addTab()
        #         self._nb.AddPage(worksheetPanel, "2", imageId=0)
        # Layout

        self.__DoLayout()
Beispiel #5
0
 def __init__(self, parent=None, *args, filePath=None, **kw):
     wx.Panel.__init__(self, parent, id=-1)
     self.parent = parent
     self.fileOperations = FileOperations()
     vBox = wx.BoxSizer(wx.VERTICAL)
     ####################################################################
     self._nb = aui.AuiNotebook(self)
     self.filePath = filePath
     text = FileOperations().readFile(filePath=filePath)
     self.htmlPanel = HtmlPanel(self, text=text)
     self.markdownSourcePanel = MarkdownSourcePanel(self, text=text)
     self.htmlSrc = HtmlSrcPanel(self, text=text)
     self._nb.AddPage(self.markdownSourcePanel, 'Src')
     self._nb.AddPage(self.htmlPanel, 'HTML')
     self._nb.AddPage(self.htmlSrc, 'HTML Src')
     self._nb.Split(0, wx.LEFT)
     self._nb.Split(1, wx.RIGHT)
     self._nb.Split(2, wx.DOWN)
     ####################################################################
     sizer = wx.BoxSizer(wx.VERTICAL)
     sizer.Add(self._nb, 1, wx.EXPAND)
     sizer.Add(vBox, 1, wx.EXPAND, 0)
     self.SetSizer(sizer)
Beispiel #6
0
    def CreateNotebook(self):

        # create the notebook off-window to avoid flicker
        client_size = self.GetClientSize()
        ctrl = aui.AuiNotebook(self,
                               -1,
                               wx.Point(client_size.x, client_size.y),
                               wx.Size(430, 200),
                               agwStyle=self._notebook_style)

        arts = [
            aui.AuiDefaultTabArt, aui.AuiSimpleTabArt, aui.VC71TabArt,
            aui.FF2TabArt, aui.VC8TabArt, aui.ChromeTabArt
        ]

        art = arts[self._notebook_theme]()
        ctrl.SetArtProvider(art)

        page_bmp = wx.ArtProvider.GetBitmap(wx.ART_NORMAL_FILE, wx.ART_OTHER,
                                            wx.Size(16, 16))
        ctrl.AddPage(OnRecipesSearch(ctrl), "按菜谱搜索", False, page_bmp)

        ctrl.AddPage(OnDiseaseSearch(ctrl), "按病名搜索", False, page_bmp)

        ctrl.AddPage(
            wx.TextCtrl(ctrl, -1, "Some more text", wx.DefaultPosition,
                        wx.DefaultSize, wx.TE_MULTILINE | wx.NO_BORDER),
            "按身体异常搜索")

        # Demonstrate how to disable a tab

        ctrl.SetPageTextColour(1, wx.RED)
        ctrl.SetPageTextColour(2, wx.BLUE)
        ctrl.SetRenamable(2, True)

        return ctrl