本文整理汇总了Python中wx.aui方法的典型用法代码示例。如果您正苦于以下问题:Python wx.aui方法的具体用法?Python wx.aui怎么用?Python wx.aui使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类wx
的用法示例。
在下文中一共展示了wx.aui方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import aui [as 别名]
def __init__(self, parent, frame, interpreter):
self._frame = frame
wx.Panel.__init__(self, parent, -1)
bookStyle = aui.AUI_NB_DEFAULT_STYLE
bookStyle &= ~(aui.AUI_NB_CLOSE_ON_ACTIVE_TAB)
self.rawpanel = HttpRawPanel(self, self)
self.renderpanel = self.create_web_view()
self.nb = aui.AuiNotebook(self, style=bookStyle)
self.nb.AddPage(self.rawpanel, "HTML Raw")
self.nb.AddPage(self.renderpanel, "HTML Render")
sizer = wx.BoxSizer()
sizer.Add(self.nb, 1, wx.EXPAND)
self.SetSizer(sizer)
wx.CallAfter(self.nb.SendSizeEvent)
pub.subscribe(self.on_selected_row, "selected_row")
示例2: CreateLogCtrl
# 需要导入模块: import wx [as 别名]
# 或者: from wx import aui [as 别名]
def CreateLogCtrl(self):
logCtrl = LogCtrl(self)
logCtrl.Freeze()
if not Config.logDate:
logCtrl.SetDateLogging(False)
if not Config.logTime:
logCtrl.SetTimeLogging(False)
logCtrl.SetIndent(Config.indentLog)
self.auiManager.AddPane(
logCtrl,
wx.aui.AuiPaneInfo().
Name("logger").
Left().
MinSize((280, 300)).
MaximizeButton(True).
CloseButton(False).
Caption(" " + Text.Logger.caption)
)
self.auiManager.Update()
logCtrl.Thaw()
return logCtrl
示例3: CreateTreeCtrl
# 需要导入模块: import wx [as 别名]
# 或者: from wx import aui [as 别名]
def CreateTreeCtrl(self):
treeCtrl = TreeCtrl(self, document=self.document)
self.auiManager.AddPane(
treeCtrl,
wx.aui.AuiPaneInfo().
Name("tree").
Center().
MinSize((100, 100)).
Floatable(True).
Dockable(True).
MaximizeButton(True).
Caption(" " + Text.Tree.caption).
CloseButton(False)
)
self.auiManager.Update()
treeCtrl.SetFocus()
return treeCtrl
示例4: SaveTabLayout
# 需要导入模块: import wx [as 别名]
# 或者: from wx import aui [as 别名]
def SaveTabLayout(self, notebook):
tabs = []
for child in notebook.GetChildren():
if isinstance(child, wx.aui.AuiTabCtrl):
if child.GetPageCount() > 0:
pos = child.GetPosition()
tab = {"pos": (pos.x, pos.y), "pages": []}
tab_size = child.GetSize()
for page_idx in xrange(child.GetPageCount()):
page = child.GetWindowFromIdx(page_idx)
if "size" not in tab:
tab["size"] = (tab_size[0], tab_size[1] + page.GetSize()[1])
tab_infos = self.GetTabInfos(page)
if tab_infos is not None:
tab["pages"].append((tab_infos, page_idx == child.GetActivePage()))
tabs.append(tab)
tabs.sort(lambda x, y: cmp(x["pos"], y["pos"]))
size = notebook.GetSize()
return ComputeTabsLayout(tabs, wx.Rect(1, 1, size[0] - NOTEBOOK_BORDER, size[1] - NOTEBOOK_BORDER))
示例5: start_gui
# 需要导入模块: import wx [as 别名]
# 或者: from wx import aui [as 别名]
def start_gui(self, controller):
self.controller = controller
# tell FrameManager to manage this frame
self._mgr = wx.aui.AuiManager()
self._mgr.SetManagedWindow(self)
# create menu
mb = wx.MenuBar()
file_menu = wx.Menu()
file_menu.Append(wx.ID_EXIT, "Exit")
help_menu = wx.Menu()
help_menu.Append(ID_About, "About...")
mb.Append(file_menu, "File")
mb.Append(help_menu, "Help")
self.SetMenuBar(mb)
self.SetMinSize(wx.Size(400, 300))
# create some center panes
self._mgr.AddPane(MainNotebookPanel(self, self, controller._interp), wx.aui.AuiPaneInfo().Caption("Raw HTTP Content").Name("analysis_notebook").CenterPane())
self._mgr.AddPane(self.CreateNotebook(), wx.aui.AuiPaneInfo().Name("main_notebook").CenterPane())
self._mgr.Update()
self.Bind(wx.EVT_CLOSE, self.OnClose)
self.Bind(wx.EVT_MENU, self.OnExit, id=wx.ID_EXIT)
self.Bind(wx.EVT_MENU, self.OnAbout, id=ID_About)
pub.subscribe(self.OnAddTab, "create_tab")
示例6: CreateNotebook
# 需要导入模块: import wx [as 别名]
# 或者: from wx import aui [as 别名]
def CreateNotebook(self):
bookStyle = aui.AUI_NB_DEFAULT_STYLE
# bookStyle &= ~(aui.AUI_NB_CLOSE_ON_ACTIVE_TAB)
bookStyle = aui.AUI_NB_DEFAULT_STYLE | aui.AUI_NB_TAB_EXTERNAL_MOVE | wx.NO_BORDER
client_size = self.GetClientSize()
nb = aui.AuiNotebook(self, -1, wx.Point(client_size.x, client_size.y), wx.Size(430, 200), agwStyle=bookStyle)
nb.AddPage(ListPanel(self, self, self.controller._model, self.controller._interp), "Main")
return nb
示例7: OnPaneClose
# 需要导入模块: import wx [as 别名]
# 或者: from wx import aui [as 别名]
def OnPaneClose(self, event):
"""
React to a wx.aui.EVT_AUI_PANE_CLOSE event.
Monitors if the toolbar gets closed and updates the check menu
entry accordingly
"""
paneName = event.GetPane().name
if paneName == "toolBar":
Config.showToolbar = False
self.menuBar.Check(ID["HideShowToolbar"], False)
示例8: OnPaneMaximize
# 需要导入模块: import wx [as 别名]
# 或者: from wx import aui [as 别名]
def OnPaneMaximize(self, dummyEvent):
"""
React to a wx.aui.EVT_AUI_PANE_MAXIMIZE event.
"""
Config.perspective2 = self.auiManager.SavePerspective()
示例9: OnPaneRestore
# 需要导入模块: import wx [as 别名]
# 或者: from wx import aui [as 别名]
def OnPaneRestore(self, dummyEvent):
"""
React to a wx.aui.EVT_AUI_PANE_RESTORE event.
"""
if Config.perspective2 is not None:
self.auiManager.LoadPerspective(Config.perspective2)
示例10: AddPage
# 需要导入模块: import wx [as 别名]
# 或者: from wx import aui [as 别名]
def AddPage(self, window, text):
"""Function that add a tab in Notebook, calling refresh for tab DClick event
for wx.aui.AUINotebook.
:param window: Panel to display in tab.
:param text: title for the tab ctrl.
"""
self.TabsOpened.AddPage(window, text)
self.RefreshTabCtrlEvent()
示例11: DeleteAllPages
# 需要导入模块: import wx [as 别名]
# 或者: from wx import aui [as 别名]
def DeleteAllPages(self):
"""Function that fix difference in deleting all tabs between
wx.Notebook and wx.aui.AUINotebook.
"""
for dummy in xrange(self.TabsOpened.GetPageCount()):
self.TabsOpened.DeletePage(0)
self.RefreshTabCtrlEvent()
示例12: SetPageBitmap
# 需要导入模块: import wx [as 别名]
# 或者: from wx import aui [as 别名]
def SetPageBitmap(self, idx, bitmap):
"""Function that fix difference in setting picture on tab between
wx.Notebook and wx.aui.AUINotebook.
:param idx: Tab index.
:param bitmap: wx.Bitmap to define on tab.
:returns: True if operation succeeded
"""
return self.TabsOpened.SetPageBitmap(idx, bitmap)
# -------------------------------------------------------------------------------
# Dialog Message Functions
# -------------------------------------------------------------------------------
示例13: RefreshTabCtrlEvent
# 需要导入模块: import wx [as 别名]
# 或者: from wx import aui [as 别名]
def RefreshTabCtrlEvent(self):
auitabctrl = []
for child in self.TabsOpened.GetChildren():
if isinstance(child, wx.aui.AuiTabCtrl):
auitabctrl.append(child)
if child not in self.AuiTabCtrl:
child.Bind(wx.EVT_LEFT_DCLICK, self.GetTabsOpenedDClickFunction(child))
self.AuiTabCtrl = auitabctrl
if self.TabsOpened.GetPageCount() == 0:
pane = self.AUIManager.GetPane(self.TabsOpened)
if pane.IsMaximized():
self.AUIManager.RestorePane(pane)
self.AUIManager.Update()
示例14: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import aui [as 别名]
def __init__(self,parent,title):
""" Initialise main frame """
wx.Frame.__init__(self,None,title=title,size=(2000,900))
## EXPERIMENTAL
#self._mgr = aui.AuiManager()
#
## notify AUI which frame to use
#self._mgr.SetManagedWindow(self)
#ubuntu sizing:
if os.name == 'posix':
font = wx.Font(9, wx.FONTFAMILY_DEFAULT, wx.NORMAL, wx.NORMAL)
self.SetFont(font)
# Set icons for top-left of frame, alt-tab window ...
frame_icon = wx.IconBundle()
try:
frame_icon.AddIconFromFile(os.path.join(elecsus_dir,'images/elecsus_t_group.ico'), wx.BITMAP_TYPE_ANY)
except:
# new wx version
frame_icon.AddIcon(os.path.join(elecsus_dir,'images/elecsus_t_group.ico'), wx.BITMAP_TYPE_ANY)
self.SetIcons(frame_icon)
#if the window is closed, exit
self.Bind(wx.EVT_CLOSE,self.OnExit)
self.panel = wx.Panel(self)
self.panel.SetBackgroundColour(wx.Colour(240,240,240))
self._init_default_values()
self._init_plot_defaults()
self._init_menus()
self._init_panels()
## redirect stdout (command line text) to status box
sys.stdout = self.StatusPanel
sys.stderr = self.ErrorPanel
# Create initially blank set of axes
#self.OnCreateAxes(self.figs[0],self.canvases[0])
## Bind the event EVT_FIT_COMPLETE to function
## This executes in the main thread once the fitting thread
## (separate from the main thread) completes
self.Bind(EVT_FIT_COMPLETE,self.OnFitCompleted)