def CreateControls(self): """Create our sub-controls""" self.CreateMenuBar() self.SetupToolBar() self.CreateStatusBar() self.leftSplitter = wx.SplitterWindow(self) self.rightSplitter = wx.SplitterWindow(self.leftSplitter) self.listControl = ProfileView(self.leftSplitter, ) self.squareMap = squaremap.SquareMap( self.rightSplitter, padding=6, labels=True, adapter=self.adapter, ) self.tabs = wx.Notebook(self.rightSplitter, ) self.calleeListControl = ProfileView(self.tabs, ) self.allCalleeListControl = ProfileView(self.tabs, ) self.allCallerListControl = ProfileView(self.tabs, ) self.callerListControl = ProfileView(self.tabs, ) self.ProfileListControls = [ self.listControl, self.calleeListControl, self.allCalleeListControl, self.callerListControl, self.allCallerListControl, ] self.tabs.AddPage(self.calleeListControl, _('Callees'), True) self.tabs.AddPage(self.allCalleeListControl, _('All Callees'), False) self.tabs.AddPage(self.callerListControl, _('Callers'), False) self.tabs.AddPage(self.allCallerListControl, _('All Callers'), False) self.rightSplitter.SetSashSize(10) self.Maximize(True) # calculate size as proportional value for initial display... width, height = wx.GetDisplaySize() rightsplit = 2 * (height // 3) leftsplit = width // 3 self.rightSplitter.SplitHorizontally(self.squareMap, self.tabs, rightsplit) self.leftSplitter.SplitVertically(self.listControl, self.rightSplitter, leftsplit) squaremap.EVT_SQUARE_HIGHLIGHTED(self.squareMap, self.OnSquareHighlightedMap) squaremap.EVT_SQUARE_SELECTED(self.listControl, self.OnSquareSelectedList) squaremap.EVT_SQUARE_SELECTED(self.squareMap, self.OnSquareSelectedMap) squaremap.EVT_SQUARE_ACTIVATED(self.squareMap, self.OnNodeActivated) for control in self.ProfileListControls: squaremap.EVT_SQUARE_ACTIVATED(control, self.OnNodeActivated) squaremap.EVT_SQUARE_HIGHLIGHTED(control, self.OnSquareHighlightedList)
def OnInit(self): """Initialise the application""" #wx.Image.AddHandler(self.handler) self.frame = frame = wx.Frame( None, ) frame.CreateStatusBar() model = model = self.get_model( sys.argv[1]) self.sq = squaremap.SquareMap( frame, model=model, adapter = MeliaeAdapter(), padding=2, margin=1, square_style=True ) squaremap.EVT_SQUARE_HIGHLIGHTED( self.sq, self.OnSquareSelected ) frame.Show(True) self.SetTopWindow(frame) return True
def CreateControls(self, config_parser): """Create our sub-controls""" self.CreateMenuBar() self.SetupToolBar() self.CreateStatusBar() self.leftSplitter = wx.SplitterWindow(self) self.rightSplitter = wx.SplitterWindow(self.leftSplitter) self.listControl = listviews.DataView( self.leftSplitter, columns=PROFILE_VIEW_COLUMNS, name='mainlist', ) self.squareMap = squaremap.SquareMap( self.rightSplitter, padding=6, labels=True, adapter=self.adapter, square_style=True, ) self.tabs = wx.Notebook( self.rightSplitter, ) self.CreateSourceWindow(self.tabs) self.calleeListControl = listviews.DataView( self.tabs, columns=PROFILE_VIEW_COLUMNS, name='callee', ) self.allCalleeListControl = listviews.DataView( self.tabs, columns=PROFILE_VIEW_COLUMNS, name='allcallee', ) self.allCallerListControl = listviews.DataView( self.tabs, columns=PROFILE_VIEW_COLUMNS, name='allcaller', ) self.callerListControl = listviews.DataView( self.tabs, columns=PROFILE_VIEW_COLUMNS, name='caller', ) self.ProfileListControls = [ self.listControl, self.calleeListControl, self.allCalleeListControl, self.callerListControl, self.allCallerListControl, ] self.tabs.AddPage(self.calleeListControl, _('Callees'), True) self.tabs.AddPage(self.allCalleeListControl, _('All Callees'), False) self.tabs.AddPage(self.callerListControl, _('Callers'), False) self.tabs.AddPage(self.allCallerListControl, _('All Callers'), False) if editor: self.tabs.AddPage(self.sourceCodeControl, _('Source Code'), False) self.rightSplitter.SetSashSize(10) # calculate size as proportional value for initial display... self.LoadState(config_parser) width, height = self.GetSizeTuple() rightsplit = 2 * (height // 3) leftsplit = width // 3 self.rightSplitter.SplitHorizontally(self.squareMap, self.tabs, rightsplit) self.leftSplitter.SplitVertically(self.listControl, self.rightSplitter, leftsplit) self.squareMap.Bind(squaremap.EVT_SQUARE_HIGHLIGHTED, self.OnSquareHighlightedMap) self.listControl.Bind(squaremap.EVT_SQUARE_SELECTED, self.OnSquareSelectedList) self.squareMap.Bind(squaremap.EVT_SQUARE_SELECTED, self.OnSquareSelectedMap) self.squareMap.Bind(squaremap.EVT_SQUARE_ACTIVATED, self.OnNodeActivated) for control in self.ProfileListControls: control.Bind(squaremap.EVT_SQUARE_ACTIVATED, self.OnNodeActivated) control.Bind(squaremap.EVT_SQUARE_HIGHLIGHTED, self.OnSquareHighlightedList) self.moreSquareViewItem.Check(self.squareMap.square_style)