def __init__(self, parent): # Two stage creation (see http://wiki.wxpython.org/index.cgi/TwoStageCreation) pre = wx.PreFrame() self.PreCreate(pre) get_resources().LoadOnFrame(pre, parent, "DIAG_Section") self.PostCreate(pre) # Define variables for the controls, bind event handlers self.REC_NAME = xrc.XRCCTRL(self, "REC_NAME") self.REC_WIDTH = xrc.XRCCTRL(self, "REC_WIDTH") self.REC_HEIGHT = xrc.XRCCTRL(self, "REC_HEIGHT") self.REC_HEIGHTSEG = xrc.XRCCTRL(self, "REC_HEIGHTSEG") self.REC_REINF = xrc.XRCCTRL(self, "REC_REINF") self.REC_APP = xrc.XRCCTRL(self, "REC_APP") self.CIRC_NAME = xrc.XRCCTRL(self, "CIRC_NAME") self.CIRC_RAD = xrc.XRCCTRL(self, "CIRC_RAD") self.CIRC_SEG = xrc.XRCCTRL(self, "CIRC_SEG") self.CIRC_REINF = xrc.XRCCTRL(self, "CIRC_REINF") self.CIRCAPP = xrc.XRCCTRL(self, "CIRCAPP") self.T_Name = xrc.XRCCTRL(self, "T_Name") self.T_H = xrc.XRCCTRL(self, "T_H") self.T_BF = xrc.XRCCTRL(self, "T_BF") self.T_TF = xrc.XRCCTRL(self, "T_TF") self.T_TF1 = xrc.XRCCTRL(self, "T_TF1") self.T_WF = xrc.XRCCTRL(self, "T_WF") self.T_TW = xrc.XRCCTRL(self, "T_TW") self.T_HW = xrc.XRCCTRL(self, "T_HW") self.T_REINF = xrc.XRCCTRL(self, "T_REINF") self.T_APP = xrc.XRCCTRL(self, "T_APP")
def __init__(self, parent=None): pre = wx.PreFrame() XRC().LoadOnFrame(pre, parent, self.RESOURCE_ID) self.PostCreate(pre) #self.SetMenuBar(XRC().LoadMenuBar(self.MENUBAR_ID)) self.binder.bindall(self, self.RESOURCE_ID) self.SetIcon(main_icon.getIcon())
def __init__(self, parent, xrc_path, xrc_name, size=wx.DefaultSize): self.pre_widget = wx.PreFrame() XrcBase.__init__(self, parent, xrc_path, xrc_name) self.xrc_resource.LoadOnFrame(self.pre_widget, self.parent, self.xrc_name) self.PostCreate(self.pre_widget) self.SetSize(size)
def __init__(self, parent): self.parent = parent self.path = None self._resources = xrc.EmptyXmlResource() self._resources.Load(_getpath('xrc', 'fbfdframe.xrc')) pre = wx.PreFrame() self._resources.LoadOnFrame(pre, parent, "fbfrontdesk_frame") self.PostCreate(pre) self.SetIcon(wx.Icon(_getpath('xrc', 'foxbms100px.png'))) self.tbicon = DemoTaskBarIcon(self) print self.tbicon.IsOk() self.Bind(wx.EVT_MENU, self.onProjectSelect, id=xrc.XRCID("folder_tb")) self.Bind(wx.EVT_MENU, self.onOpenDocumentation, id=xrc.XRCID("help_tb")) self.panel = FBFrontDeskPanel(self) self.SetMinSize((800, 700)) self.Fit() self.detect(self.path) self.selectProject(self.path)
def __init__(self): pre = wx.PreFrame() pre.SetExtraStyle(wx.FRAME_EX_CONTEXTHELP) pre.Create(None, -1, "Help Context", size=(300, 100), style=wx.DEFAULT_FRAME_STYLE ^ (wx.MINIMIZE_BOX | wx.MAXIMIZE_BOX)) self.PostCreate(pre)
def __init__(self): if int(sys.version[0]) < 3: p = wx.PreFrame() self.PostCreate(p) else: super().__init__() self.file = None self.prev_node = None
def __init__(self, parent, block_store, id=wx.ID_ANY, style=wx.EXPAND): #load from XRC, need to use two-stage create res = gui.XrcUtilities.XmlResource('./gui/xrc/TpclEditorFrame.xrc') pre = wx.PreFrame() res.LoadOnFrame(pre, parent, "editor") self.PostCreate(pre) self.block_store = block_store self.OnCreate()
def __init__(self, parent): # Two stage creation (see http://wiki.wxpython.org/index.cgi/TwoStageCreation) pre = wx.PreFrame() self.PreCreate(pre) get_resources().LoadOnFrame(pre, parent, "button_frame") self.PostCreate(pre) # Define variables for the controls, bind event handlers self.button_panel = xrc.XRCCTRL(self, "button_panel")
def __init__(self, parent): # Two stage creation (see http://wiki.wxpython.org/index.cgi/TwoStageCreation) pre = wx.PreFrame() self.PreCreate(pre) get_resources().LoadOnFrame(pre, parent, "Demo") self.PostCreate(pre) # Define variables for the controls, bind event handlers self.Bind(wx.EVT_BUTTON, self.OnButton_prefsButton, id=xrc.XRCID('prefsButton'))
def __init__(self, *args): if len(args) == 0: pre = wx.PreFrame() # the Create step is done by XRC. self.PostCreate(pre) self.Bind(wx.EVT_WINDOW_CREATE, self.OnCreate) else: wx.Frame.__init__(self, args[0], args[1], args[2], args[3]) self._PostInit() self.wxapp = None
def __init__(self, parent): # Two stage creation (see http://wiki.wxpython.org/index.cgi/TwoStageCreation) pre = wx.PreFrame() self.PreCreate(pre) get_resources().LoadOnFrame(pre, parent, "stream_frame") self.PostCreate(pre) # Define variables for the controls, bind event handlers self.scrwin = xrc.XRCCTRL(self, "scrwin") self.fpb = xrc.XRCCTRL(self, "fpb") self.stream_bar = xrc.XRCCTRL(self, "stream_bar")
def __init__(self, parent): # Two stage creation (see http://wiki.wxpython.org/index.cgi/TwoStageCreation) pre = wx.PreFrame() self.PreCreate(pre) get_resources().LoadOnFrame(pre, parent, "HtmlIde") self.PostCreate(pre) # Define variables for the controls, bind event handlers self.html_src = xrc.XRCCTRL(self, "html_src") self.gui_go = xrc.XRCCTRL(self, "gui_go") self.html_window = xrc.XRCCTRL(self, "html_window")
def __init__(self, parent): # Two stage creation (see http://wiki.wxpython.org/index.cgi/TwoStageCreation) pre = wx.PreFrame() self.PreCreate(pre) get_resources().LoadOnFrame(pre, parent, "GuessVerseFrame") self.PostCreate(pre) # Define variables for the controls, bind event handlers self.reference_frame = xrc.XRCCTRL(self, "reference_frame") self.books = xrc.XRCCTRL(self, "books") self.show_answer_button = xrc.XRCCTRL(self, "show_answer_button") self.guess_button = xrc.XRCCTRL(self, "guess_button")
def __init__(self, parent): # Two stage creation (see http://wiki.wxpython.org/index.cgi/TwoStageCreation) pre = wx.PreFrame() self.PreCreate(pre) get_resources().LoadOnFrame(pre, parent, "emptyorch_frame") self.PostCreate(pre) # Define variables for the controls, bind event handlers self.Bind(wx.EVT_MENU, self.OnMenu_open_menu, id=xrc.XRCID('open_menu')) self.Bind(wx.EVT_MENU, self.OnMenu_Print, id=xrc.XRCID('Print')) self.Bind(wx.EVT_MENU, self.OnMenu_PrintPreview, id=xrc.XRCID('PrintPreview')) self.Bind(wx.EVT_MENU, self.OnMenu_PageSetup, id=xrc.XRCID('PageSetup')) self.Bind(wx.EVT_MENU, self.OnMenu_SetDirs, id=xrc.XRCID('SetDirs')) self.Bind(wx.EVT_BUTTON, self.OnButton_choose_btn, id=xrc.XRCID('choose_btn')) self.Bind(wx.EVT_BUTTON, self.OnButton_playsel_btn, id=xrc.XRCID('playsel_btn')) self.Bind(wx.EVT_BUTTON, self.OnButton_addplay_btn, id=xrc.XRCID('addplay_btn')) self.Bind(wx.EVT_SCROLL, self.OnScroll_slider, id=xrc.XRCID('slider')) self.Bind(wx.EVT_SCROLL, self.OnScroll_slider, id=xrc.XRCID('slider')) self.Bind(wx.EVT_BUTTON, self.OnButton_prev_btn, id=xrc.XRCID('prev_btn')) self.Bind(wx.EVT_BUTTON, self.OnButton_play_btn, id=xrc.XRCID('play_btn')) self.Bind(wx.EVT_BUTTON, self.OnButton_pause_btn, id=xrc.XRCID('pause_btn')) self.Bind(wx.EVT_BUTTON, self.OnButton_stop_btn, id=xrc.XRCID('stop_btn')) self.Bind(wx.EVT_BUTTON, self.OnButton_next_btn, id=xrc.XRCID('next_btn')) self.Bind(wx.EVT_SCROLL, self.OnScroll_volume_sl, id=xrc.XRCID('volume_sl')) self.Bind(wx.EVT_SCROLL, self.OnScroll_volume_sl, id=xrc.XRCID('volume_sl')) self.Bind(wx.EVT_CLOSE, self.OnClose)
def __init__(self, parent): # Two stage creation (see http://wiki.wxpython.org/index.cgi/TwoStageCreation) pre = wx.PreFrame() self.PreCreate(pre) get_resources().LoadOnFrame(pre, parent, "text_frame") self.PostCreate(pre) # Define variables for the controls, bind event handlers self.text_panel = xrc.XRCCTRL(self, "text_panel") self.txt_suggest = xrc.XRCCTRL(self, "txt_suggest") self.unit_float_label = xrc.XRCCTRL(self, "unit_float_label") self.unit_float = xrc.XRCCTRL(self, "unit_float") self.txt_odcbox = xrc.XRCCTRL(self, "txt_odcbox")
def __init__(self, parent): # Two stage creation (see http://wiki.wxpython.org/index.cgi/TwoStageCreation) pre = wx.PreFrame() self.PreCreate(pre) get_resources().LoadOnFrame(pre, parent, "ManageTopicsFrame") self.PostCreate(pre) # Define variables for the controls, bind event handlers self.toolbar = xrc.XRCCTRL(self, "toolbar") self.splitter = xrc.XRCCTRL(self, "splitter") self.passage_list_pane = xrc.XRCCTRL(self, "passage_list_pane") self.passage_list_splitter = xrc.XRCCTRL(self, "passage_list_splitter") self.item_details_panel = xrc.XRCCTRL(self, "item_details_panel")
def __init__(self, parent, *args, **kwargs): pre = wx.PreFrame() pre.SetExtraStyle(wx.FRAME_EX_CONTEXTHELP) pre.Create(parent, *args, **kwargs) self.PostCreate(pre) # Attributes self.panel = wx.Panel(self) # Setup self.CreateStatusBar() self.__DoLayout() # Event Handlers self.Bind(wx.EVT_HELP, self.OnHelp)
def __init__(self, parent): # Two stage creation (see http://wiki.wxpython.org/index.cgi/TwoStageCreation) pre = wx.PreFrame() self.PreCreate(pre) get_resources().LoadOnFrame(pre, parent, "grid_frame") self.PostCreate(pre) # Define variables for the controls, bind event handlers self.grid_panel = xrc.XRCCTRL(self, "grid_panel") self.red = xrc.XRCCTRL(self, "red") self.blue = xrc.XRCCTRL(self, "blue") self.purple = xrc.XRCCTRL(self, "purple") self.brown = xrc.XRCCTRL(self, "brown") self.yellow = xrc.XRCCTRL(self, "yellow") self.green = xrc.XRCCTRL(self, "green")
def __init__(self): ''' Init function ''' # Load XRC layout of main frame resource = xrc.XmlResource(i.APP_MAIN_LAYOUT_FILE) pre = wx.PreFrame() pre = resource.LoadFrame(None, 'mainframe') self.PostCreate(pre) # Set icon to window so it would not look so ugly. # Notice that on Windows the resolution of the icon on the title bar # cannot be too large, so this line would probably not work. self.SetIcon(wx.Icon(i.APP_BIG_ICON_FILE, wx.BITMAP_TYPE_PNG)) # Setting min size to a quarter of screen size would be suitable, # many desktop environment has docking feature, which allows a window # to be resized to half or quarter the size of screen. If the min # size set was too large, the docking feature will not take effect. self.SetMinSize((wx.DisplaySize()[0] / 2, wx.DisplaySize()[1] / 2)) # Set default values of additional attributes self.FILELIST, self.QUEUE, self.CONVERTER = None, set(), None self.PROGRESS = None # Insert rows into list ctrl self.initFileList() # Bind menu event handlers self.Bind(wx.EVT_MENU, wx.GetApp().OnShowPref, id=xrc.XRCID('menufilepref')) self.Bind(wx.EVT_MENU, self.OnFileQuit, id=xrc.XRCID('menufilequit')) self.Bind(wx.EVT_MENU, self.OnHelpAbout, id=xrc.XRCID('menuhelpabout')) # Bind tool event handlers self.Bind(wx.EVT_TOOL, self.OnFileSelect, id=xrc.XRCID('toolopen')) self.Bind(wx.EVT_TOOL, self.OnConversionStart, id=xrc.XRCID('toolconvert')) self.Bind(wx.EVT_TOOL, self.OnHelpAbout, id=xrc.XRCID('toolinfo')) self.Bind(wx.EVT_TOOL, self.OnFileQuit, id=xrc.XRCID('toolquit')) # Bind global event handlers # To avoid quiting during a conversion self.Bind(wx.EVT_CLOSE, self.OnFileQuit) self.SetStatusText(_('Ready'))
def prepare_xrc_frame(self, cls, alternate_bind_of=[], parent=None, **post_init_kwargs): if not parent: parent = self.top_level inst = cls() if hasattr(wx, "PreFrame"): pre = wx.PreFrame() self.resource.LoadOnFrame(pre, parent, cls.xrc_name) inst.PostCreate(pre) else: # Phoenix self.resource.LoadFrame(inst, parent, cls.xrc_name) self.auto_bind(inst, inst, alternate_bind_of=alternate_bind_of) if hasattr(inst, "post_init"): inst.post_init(**post_init_kwargs) return inst
def __init__(self, parent): # Two stage creation (see http://wiki.wxpython.org/index.cgi/TwoStageCreation) pre = wx.PreFrame() self.PreCreate(pre) get_resources().LoadOnFrame(pre, parent, "mframe") self.PostCreate(pre) # Define variables for the controls, bind event handlers self.btnabout = xrc.XRCCTRL(self, "btnabout") self.Bind(wx.EVT_BUTTON, self.OnButton_btnsearch, id=xrc.XRCID('btnsearch')) self.Bind(wx.EVT_BUTTON, self.OnButton_btnsave, id=xrc.XRCID('btnsave')) self.Bind(wx.EVT_BUTTON, self.OnButton_btnabout, self.btnabout) self.Bind(wx.EVT_KEY_DOWN, self.OnKey_down_btnabout, self.btnabout)
def __init__(self): pre = wx.PreFrame() self.PostCreate(pre) self.Bind(wx.EVT_WINDOW_CREATE, self.OnCreate) self.last_updated = None # We need the XML resources. self.resources = get_resources() # Keep a mapping of window names to ids for convenience. self.window_ids = {} for window_name in [ 'TaskBarMenuItemToggle', 'TaskBarMenuItemExit', 'ClearButton', 'EventList', 'UpdateButton', ]: self.window_ids[window_name] = self.resources.GetXRCID(window_name)
def makeFrame(self): global canvas #@@@@ # Got this trick for a two stage creation from # http://wiki.wxpython.org/index.cgi/TwoStageCreation pre = wx.PreFrame() self.res = XmlResource(homepath+"/plotwin.xrc") self.res.LoadOnFrame(pre,self.parent,"plotwin") self.PostCreate(pre) self.SetBackgroundColour(wx.NamedColor("WHITE")) self.Show() self.figure = Figure() self.axes = [self.figure.add_subplot(111)] self.canvas = FigureCanvas(self, -1, self.figure) canvas = self.canvas #@@@@ self.sizer = wx.BoxSizer(wx.VERTICAL) self.SetSizer(self.sizer) self.sizer.Add(self.canvas, 1, wx.LEFT | wx.TOP | wx.GROW) self.Fit() self.addToolbar()
def __init__(self, parent): # Two stage creation (see http://wiki.wxpython.org/index.cgi/TwoStageCreation) pre = wx.PreFrame() self.PreCreate(pre) get_resources().LoadOnFrame(pre, parent, "FRAME") self.PostCreate(pre) # Define variables for the controls self.panel = xrc.XRCCTRL(self, "panel") self.disableFeedback = xrc.XRCCTRL(self, "disableFeedback") self.requiredPage = xrc.XRCCTRL(self, "requiredPage") self.text = xrc.XRCCTRL(self, "text") self.optionalPage = xrc.XRCCTRL(self, "optionalPage") self.email = xrc.XRCCTRL(self, "email") self.comments = xrc.XRCCTRL(self, "comments") self.delButton = xrc.XRCCTRL(self, "delButton") self.sysInfo = xrc.XRCCTRL(self, "sysInfo") self.sendButton = xrc.XRCCTRL(self, "sendButton") self.restartButton = xrc.XRCCTRL(self, "restartButton") self.closeButton = xrc.XRCCTRL(self, "closeButton")
def __init__(self): ''' Init function ''' # Load XRC layout of preference frame resource = xrc.XmlResource(i.APP_PREF_LAYOUT_FILE) pre = wx.PreFrame() pre = resource.LoadFrame(None, 'preference') self.PostCreate(pre) # Read option values from config file C = wx.GetApp().CONFIG bitrate = C.ReadInt( i.APP_CONFIG_BITRATE_KEY, i.AAC_DEFAULT_BITRATE ) / 1000 debug = C.ReadBool( i.APP_CONFIG_DEBUG_KEY, i.APP_DEBUG ) delorigin = C.ReadBool( i.APP_CONFIG_DELORIGIN_KEY, i.APP_DEFAULT_DELORIGIN ) # Bind event handlers self.Bind( wx.EVT_BUTTON, self.OnPrefCancel, id = xrc.XRCID('btncancel') ) self.Bind( wx.EVT_BUTTON, self.OnPrefSave, id = xrc.XRCID('btnokay') ) # Set values for controls xrc.XRCCTRL(self, 'bitratespin').SetValue(bitrate) xrc.XRCCTRL(self, 'debugcheck').SetValue(debug) xrc.XRCCTRL(self, 'delorigincheck').SetValue(delorigin)
def create(cls, *args, **kw): """ Call this static class method to create a new instance of your subframe. This will use the 3dsmax window as a parent for the current frame. Limitation: If > 1 copy of 3dsmax is open, uses the first one it finds. Could probably be fixed, however. """ if (not process_is_running('motionbuilder.exe')): raise WindowsError('*** ERROR: MotionBuilder is not running') else: app = wx.GetApp() if (app == None): app = wx.App(redirect=False) val = MB_Sub_Frame._get_top_mb_window() topHandle = val[0] if (topHandle == None): raise WindowsError( '*** ERROR: Motion Builder window handle not found.') else: windowPos = val[1] toolFrame = wx.PreFrame() toolFrame.AssociateHandle(topHandle) toolFrame.PostCreate(toolFrame) app.SetTopWindow(toolFrame) try: frame = cls(toolFrame, app, *args, **kw) frame.Show(True) except: print cls.__name__ print traceback.format_exc() frame = None toolFrame.DissociateHandle() return frame
def __init__(self, parent): # Two stage creation (see http://wiki.wxpython.org/index.cgi/TwoStageCreation) pre = wx.PreFrame() self.PreCreate(pre) get_resources().LoadOnFrame(pre, parent, "MainFrame") self.PostCreate(pre) # Define variables for the controls, bind event handlers self.Bind(wx.EVT_MENU, self.OnMenu_AddMenuItem, id=xrc.XRCID('AddMenuItem')) self.Bind(wx.EVT_MENU, self.OnMenu_SubtractMenuItem, id=xrc.XRCID('SubtractMenuItem')) self.Bind(wx.EVT_MENU, self.OnMenu_MultiplyMenuItem, id=xrc.XRCID('MultiplyMenuItem')) self.Bind(wx.EVT_MENU, self.OnMenu_DivideMenuItem, id=xrc.XRCID('DivideMenuItem'))
def __init__(self, parent): # Two stage creation (see http://wiki.wxpython.org/index.cgi/TwoStageCreation) pre = wx.PreFrame() self.PreCreate(pre) get_resources().LoadOnFrame(pre, parent, "MainFrame") self.PostCreate(pre) # Define variables for the controls, bind event handlers self.fileChoice = xrc.XRCCTRL(self, "fileChoice") self.fileTreeCtrl = xrc.XRCCTRL(self, "fileTreeCtrl") self.signalListBox = xrc.XRCCTRL(self, "signalListBox") self.filterSearchCtrl = xrc.XRCCTRL(self, "filterSearchCtrl") self.viewNotebook = xrc.XRCCTRL(self, "viewNotebook") self.sweepListCtrl = xrc.XRCCTRL(self, "sweepListCtrl") self.Bind(wx.EVT_MENU, self.OnMenu_fileOpenMenuItem, id=xrc.XRCID('fileOpenMenuItem')) self.Bind(wx.EVT_MENU, self.OnMenu_fileReloadMenuItem, id=xrc.XRCID('fileReloadMenuItem')) self.Bind(wx.EVT_MENU, self.OnMenu_fileCloseMenuItem, id=xrc.XRCID('fileCloseMenuItem')) self.Bind(wx.EVT_MENU, self.OnMenu_exitMenuItem, id=xrc.XRCID('exitMenuItem')) self.Bind(wx.EVT_MENU, self.OnMenu_viewNewMenuItem, id=xrc.XRCID('viewNewMenuItem')) self.Bind(wx.EVT_MENU, self.OnMenu_viewCloseMenuItem, id=xrc.XRCID('viewCloseMenuItem')) self.Bind(wx.EVT_MENU, self.OnMenu_viewRenameMenuItem, id=xrc.XRCID('viewRenameMenuItem')) self.Bind(wx.EVT_MENU, self.OnMenu_aboutMenuItem, id=xrc.XRCID('aboutMenuItem')) self.Bind(wx.EVT_TOOL, self.OnTool_fileOpenTool, id=xrc.XRCID('fileOpenTool')) self.Bind(wx.EVT_TOOL, self.OnTool_fileReloadTool, id=xrc.XRCID('fileReloadTool')) self.Bind(wx.EVT_TOOL, self.OnTool_fileCloseTool, id=xrc.XRCID('fileCloseTool')) self.Bind(wx.EVT_TOOL, self.OnTool_viewNewTool, id=xrc.XRCID('viewNewTool')) self.Bind(wx.EVT_TOOL, self.OnTool_viewCloseTool, id=xrc.XRCID('viewCloseTool')) self.Bind(wx.EVT_CHOICE, self.OnChoice_fileChoice, self.fileChoice) self.Bind(wx.EVT_TREE_SEL_CHANGED, self.OnTree_sel_changed_fileTreeCtrl, self.fileTreeCtrl) self.Bind(wx.EVT_LISTBOX_DCLICK, self.OnListbox_dclick_signalListBox, self.signalListBox) self.Bind(wx.EVT_SEARCHCTRL_CANCEL_BTN, self.OnSearchctrl_cancel_btn_filterSearchCtrl, self.filterSearchCtrl) self.Bind(wx.EVT_TEXT, self.OnText_filterSearchCtrl, self.filterSearchCtrl)
def __init__(self, parent, path=None): self.parent = parent self.rcfile = rcfile.FoxBMSConfig() self.path = None self.dest = None self.archive = None self.existing = path self.flashdata = inari.FlashData() self.oldProjectSel = -1 self._tasks = 1 self.status = { 'initialized': False, 'configured primary': False, 'configured secondary': False, 'built': False, 'flashed': False } self._resources = xrc.EmptyXmlResource() self._resources.Load(_getpath('xrc', 'foxfdd.xrc')) pre = wx.PreFrame() self._resources.LoadOnFrame(pre, parent, "frontdesk_mframe") self.PostCreate(pre) if sys.platform.startswith('win'): self.SetIcon( wx.Icon(_getpath('xrc', 'fbicon.ico'), wx.BITMAP_TYPE_ICO)) else: self.SetIcon( wx.Icon(_getpath('xrc', 'foxbms-icon-512.png'), wx.BITMAP_TYPE_PNG)) self.Bind(wx.EVT_CLOSE, self.onClose) #self.tbicon = DemoTaskBarIcon(self) xrc.XRCCTRL(self, 'remove_b').Enable(False) xrc.XRCCTRL(self, 'update_git_b').Enable(False) xrc.XRCCTRL(self, 'workspace_dp').SetPath(self.rcfile.get('workspace')) xrc.XRCCTRL(self, 'add_archive_b').Bind(wx.EVT_BUTTON, self.onAddArchive) xrc.XRCCTRL(self, 'add_dir_b').Bind(wx.EVT_BUTTON, self.onAddDir) xrc.XRCCTRL(self, 'add_git_b').Bind(wx.EVT_BUTTON, self.onAddGit) xrc.XRCCTRL(self, 'remove_b').Bind(wx.EVT_BUTTON, self.onRemove) xrc.XRCCTRL(self, 'update_git_b').Bind(wx.EVT_BUTTON, self.onUpdate) xrc.XRCCTRL(self, 'projects_lb').Bind(wx.EVT_LIST_ITEM_SELECTED, self.onPLSel) xrc.XRCCTRL(self, 'projects_lb').Bind(wx.EVT_LIST_ITEM_DESELECTED, self.onPLSel) self.menu = self._resources.LoadMenuBar("main_menu") self.SetMenuBar(self.menu) self.menu.FindItemById(xrc.XRCID('reference_mi')).Enable(False) self.menu.FindItemById(xrc.XRCID('documentation_mi')).Enable(False) self.Bind(wx.EVT_MENU, self.onOpenDocumentation, id=xrc.XRCID("documentation_mi")) self.Bind(wx.EVT_MENU, self.onOpenReference, id=xrc.XRCID("reference_mi")) self.Bind(wx.EVT_MENU, self.onAbout, id=wx.ID_ABOUT) self.Bind(wx.EVT_MENU, self.onExit, id=wx.ID_EXIT) self.nb = xrc.XRCCTRL(self, 'main_nb') self.nb.Bind(wx.EVT_NOTEBOOK_PAGE_CHANGING, self.onPageChanging) # hack to infer old nb page on page changing if sys.platform.startswith('win'): self._last_pos = None self.nb.Bind(wx.EVT_LEFT_DOWN, self.onNBClicked) self.genProjectList(True) xrc.XRCCTRL(self, 'clear_b').Bind(wx.EVT_BUTTON, self.onClear) xrc.XRCCTRL(self, 'progress').SetSize((-1, 3)) xrc.XRCCTRL(self, 'progress').SetMaxSize((-1, 3)) self.pages = {} #self.pagekeys = ['projects', 'config', 'build', 'flash'] self.pagekeys = [ 'projects', 'config primary', 'config secondary', 'build', 'flash' ] for k in ['projects', 'build']: self.pages[k] = xrc.XRCCTRL(self, k + '_page') self.pages['config primary'] = configure.FBConfigurePanel(self.nb) self.pages['config secondary'] = configure.FBConfigurePanel(self.nb) self.nb.InsertPage(1, self.pages['config primary'], 'Configuration Primary') self.nb.InsertPage(2, self.pages['config secondary'], 'Configuration Secondary') self.pages['flash'] = inari.FBInariPanel(self.nb, flashdata=self.flashdata) self.nb.AddPage(self.pages['flash'], 'Flash foxBMS') ''' for k in ['config', 'build', 'flash']: self.pages[k].Enable(False) ''' #self.onProjectRadio(None) #self.panel = FBFrontDeskPanel(self) self.SetSize((1024, 800)) #self.Fit() xrc.XRCCTRL(self, 'initialize_b').Bind(wx.EVT_BUTTON, self.onInstall) xrc.XRCCTRL(self, 'build_b').Bind(wx.EVT_BUTTON, self.onBuild) self.installLogger()
def __init__(self, parent): # Two stage creation (see http://wiki.wxpython.org/index.cgi/TwoStageCreation) pre = wx.PreFrame() self.PreCreate(pre) get_resources().LoadOnFrame(pre, parent, "MainFrame") self.PostCreate(pre)