Advertisement
Hakugin

Main Gui - main.py

Aug 20th, 2013
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 3.07 KB | None | 0 0
  1. import panelOne, panelTwo, panelThree
  2. import sys, os
  3. import wx
  4. import wx.lib.agw.aui as aui
  5. import ectworker as EW
  6. import commonDlgs as dlg
  7.  
  8. ########################################################################
  9. class AUIManager(aui.AuiManager):
  10.     """
  11.    AUI Manager class
  12.    """
  13.     def __init__(self, managed_window):
  14.         """Constructor"""
  15.         aui.AuiManager.__init__(self)
  16.         self.SetManagedWindow(managed_window)
  17.  
  18. ########################################################################
  19. class AUINotebook(aui.AuiNotebook):
  20.     def __init__(self, parent):
  21.         """Constructor"""
  22.         self.d_style = aui.AUI_NB_DEFAULT_STYLE | wx.NO_BORDER
  23.         self.d_style &= ~(aui.AUI_NB_CLOSE_ON_ACTIVE_TAB)
  24.         aui.AuiNotebook.__init__(self, parent=parent, agwStyle=self.d_style)
  25.         self.SetArtProvider(aui.VC71TabArt())
  26.  
  27.         pages = [panelOne, panelTwo, panelThree]
  28.  
  29.         for page in pages:
  30.             label = page.TabLabel
  31.             tab = page.TabPanel(self)
  32.             self.AddPage(tab, label, False)
  33.  
  34.  
  35. ########################################################################
  36. class MainFrame(wx.Frame):
  37.     """
  38.    wx.Frame class
  39.    """
  40.     #----------------------------------------------------------------------
  41.     def __init__(self):
  42.         """Constructor"""
  43.         title = "XML Checking Tool - Beta"
  44.         wx.Frame.__init__(self, None, wx.ID_ANY, title=title, size=(450,640))
  45.  
  46.         self.SetIcon(wx.Icon('images/temp_logo_no_back.ico', wx.BITMAP_TYPE_ICO))
  47.  
  48.         self.aui_mgr = AUIManager(self)
  49.        
  50.         self.notebook = AUINotebook(self)
  51.  
  52.         self.aui_mgr.AddPane(self.notebook,
  53.                              aui.AuiPaneInfo().Name("notebook_content").
  54.                              CenterPane().PaneBorder(False))
  55.         self.aui_mgr.Update()
  56.        
  57.         mBar = wx.MenuBar()
  58.         sBar = self.CreateStatusBar()
  59.  
  60.         fileMenu = wx.Menu()
  61.         fileMenu.Append(wx.ID_CLOSE,"Close\tCtrl+X","Exit the program")
  62.         self.Bind(wx.EVT_MENU,self.onExit,id=wx.ID_CLOSE)
  63.         mBar.Append(fileMenu, '&File')
  64.  
  65.         helpMenu = wx.Menu()
  66.         helpMenu.Append(100, '&Help', 'Basic help information - Not quite functional yet.')
  67.         self.Bind(wx.EVT_MENU, self.onHelp, id=100)
  68.         helpMenu.Append(101, '&About', 'About this program')
  69.  
  70.         self.Bind(wx.EVT_MENU, self.onAboutBox, id=101)
  71.         mBar.Append(helpMenu, '&Help')
  72.         self.SetMenuBar(mBar)
  73.  
  74.     #----------------------------------------------------------------------
  75.     def onExit(self, event):
  76.         self.Close()
  77.  
  78.     def onHelp(self, event):
  79.         dlg.showInfoDlg('This feature has not been added yet. It is being worked on, but I do not have an ETA for it.','Information')
  80.  
  81.     def onAboutBox(self, event):
  82.         """ This section works in the actual program """
  83.         pass
  84.  
  85. def RunApp():
  86.     app = wx.App()
  87.     frame = MainFrame()
  88.     frame.Show()
  89.     app.MainLoop()
  90.  
  91. #----------------------------------------------------------------------
  92. if __name__ == "__main__":
  93.     RunApp()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement