本文整理汇总了Python中wx.Notebook方法的典型用法代码示例。如果您正苦于以下问题:Python wx.Notebook方法的具体用法?Python wx.Notebook怎么用?Python wx.Notebook使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类wx
的用法示例。
在下文中一共展示了wx.Notebook方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _init_ctrls
# 需要导入模块: import wx [as 别名]
# 或者: from wx import Notebook [as 别名]
def _init_ctrls(self, prnt):
wx.Frame.__init__(self, id=ID_OBJDICTEDIT, name='objdictedit',
parent=prnt, pos=wx.Point(149, 178), size=wx.Size(1000, 700),
style=wx.DEFAULT_FRAME_STYLE, title=_('Objdictedit'))
self._init_utils()
self.SetClientSize(wx.Size(1000, 700))
self.SetMenuBar(self.MenuBar)
self.Bind(wx.EVT_CLOSE, self.OnCloseFrame)
if not self.ModeSolo:
self.Bind(wx.EVT_MENU, self.OnSaveMenu, id=wx.ID_SAVE)
accel = wx.AcceleratorTable([wx.AcceleratorEntry(wx.ACCEL_CTRL, 83, wx.ID_SAVE)])
self.SetAcceleratorTable(accel)
self.FileOpened = wx.Notebook(id=ID_OBJDICTEDITFILEOPENED,
name='FileOpened', parent=self, pos=wx.Point(0, 0),
size=wx.Size(0, 0), style=0)
self.FileOpened.Bind(wx.EVT_NOTEBOOK_PAGE_CHANGED,
self.OnFileSelectedChanged, id=ID_OBJDICTEDITFILEOPENED)
self.HelpBar = wx.StatusBar(id=ID_OBJDICTEDITHELPBAR, name='HelpBar',
parent=self, style=wx.ST_SIZEGRIP)
self._init_coll_HelpBar_Fields(self.HelpBar)
self.SetStatusBar(self.HelpBar)
示例2: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import Notebook [as 别名]
def __init__(self):
wx.Frame.__init__(self, None, title="Simple Notebook Example")
# Here we create a panel and a notebook on the panel
p = wx.Panel(self)
nb = wx.Notebook(p)
# create the page windows as children of the notebook
page1 = PageOne(nb)
page2 = PageTwo(nb)
page3 = PageThree(nb)
# add the pages to the notebook with the label to show on the tab
nb.AddPage(page1, "Page 1")
nb.AddPage(page2, "Page 2")
nb.AddPage(page3, "Page 3")
# finally, put the notebook in a sizer for the panel to manage
# the layout
sizer = wx.BoxSizer()
sizer.Add(nb, 1, wx.EXPAND)
p.SetSizer(sizer)
示例3: layoutComponent
# 需要导入模块: import wx [as 别名]
# 或者: from wx import Notebook [as 别名]
def layoutComponent(self):
# self.rawWidgets['contents'] = self.rawWidgets['contents'][1:2]
self.notebook = wx.Notebook(self, style=wx.BK_DEFAULT)
panels = [wx.Panel(self.notebook) for _ in self.rawWidgets['contents']]
sizers = [wx.BoxSizer(wx.VERTICAL) for _ in panels]
for group, panel, sizer in zip(self.rawWidgets['contents'], panels, sizers):
self.makeGroup(panel, sizer, group, 0, wx.EXPAND)
panel.SetSizer(sizer)
panel.Layout()
self.notebook.AddPage(panel, group['name'])
self.notebook.Layout()
_sizer = wx.BoxSizer(wx.VERTICAL)
_sizer.Add(self.notebook, 1, wx.EXPAND)
self.SetSizer(_sizer)
self.Layout()
示例4: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import Notebook [as 别名]
def __init__(self, parent, history, *a, **k):
BTPanel.__init__(self, parent, *a, **k)
#self.SetMinSize((200, 200))
self.notebook = wx.Notebook(self, style=wx.CLIP_CHILDREN)
self.statistics = StatisticsPanel(self.notebook, style=wx.CLIP_CHILDREN)
self.notebook.AddPage(self.statistics, _("Statistics"))
self.bling = BandwidthGraphPanel(self.notebook, history)
self.speed_tab_index = self.notebook.GetPageCount()
self.notebook.AddPage(self.bling, _("Speed"))
self.notebook.Bind(wx.EVT_NOTEBOOK_PAGE_CHANGED, self.OnPageChanged)
self.sizer.Add(self.notebook, flag=wx.GROW, proportion=1)
self.Hide()
self.sizer.Layout()
示例5: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import Notebook [as 别名]
def __init__(self, parent):
wx.Panel.__init__( self, parent, -1, name='PropertyPanel' )
self.SetBackgroundColour( compat.wx_SystemSettings_GetColour(wx.SYS_COLOUR_BTNFACE) )
self.current_widget = None # instance currently being edited
self.next_widget = None # the next one, will only be edited after a small delay
self.pagenames = None
sizer = wx.BoxSizer(wx.VERTICAL)
self.heading = wx.TextCtrl(self, style=wx.TE_READONLY)
sizer.Add(self.heading, 0, wx.EXPAND, 0)
self.notebook = wx.Notebook(self)
self.notebook.Bind(wx.EVT_SIZE, self.on_notebook_size)
sizer.Add(self.notebook, 1, wx.EXPAND, 0)
# for GTK3: add a panel to determine page size
p = wx.Panel(self.notebook)
self.notebook.AddPage(p, "panel")
self._notebook_decoration_size = None
p.Bind(wx.EVT_SIZE, self.on_panel_size)
self.SetSizer(sizer)
self.Layout()
示例6: insert_tab
# 需要导入模块: import wx [as 别名]
# 或者: from wx import Notebook [as 别名]
def insert_tab(self, index, label):
# add tab/page; called from GUI
self.properties["tabs"].insert( index, [label,] )
# create panel and node, add to tree
self.insert_item(None, index) # placeholder
editor = EditPanel( self.next_pane_name(), self, index )
if self.widget:
# add to widget
editor.create()
compat.SetToolTip(editor.widget, _("Notebook page pane:\nAdd a sizer here") )
self.vs_insert_tab(index)
try:
wx.CallAfter(editor.sel_marker.update)
except AttributeError:
#self._logger.exception(_('Internal Error'))
if config.debugging: raise
self.widget.SetSelection(index)
self.properties["tabs"].update_display()
misc.rebuild_tree(self)
示例7: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import Notebook [as 别名]
def __init__(self, *args, **kwds):
# begin wxGlade: MyFrame.__init__
kwds["style"] = kwds.get("style", 0) | wx.DEFAULT_FRAME_STYLE
wx.Frame.__init__(self, *args, **kwds)
self.SetSize((400, 300))
self.SetTitle("frame")
sizer_1 = wx.BoxSizer(wx.VERTICAL)
self.notebook_1 = wx.Notebook(self, wx.ID_ANY)
sizer_1.Add(self.notebook_1, 1, wx.EXPAND, 0)
self.panel_1 = YPanel(self.notebook_1, wx.ID_ANY)
self.notebook_1.AddPage(self.panel_1, "Panel 1")
self.panel_2 = XPanel(self.notebook_1, wx.ID_ANY)
self.notebook_1.AddPage(self.panel_2, "Panel 2")
self.SetSizer(sizer_1)
self.Layout()
# end wxGlade
# end of class MyFrame
示例8: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import Notebook [as 别名]
def __init__(self, *args, **kwds):
# begin wxGlade: UIBugDialog.__init__
kwds["style"] = kwds.get("style", 0) | wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER
wx.Dialog.__init__(self, *args, **kwds)
self.SetSize((600, 400))
self.notebook_1 = wx.Notebook(self, wx.ID_ANY, style=wx.NB_BOTTOM)
self.nb1_pane_summary = wx.Panel(self.notebook_1, wx.ID_ANY)
self.st_header = wx.StaticText(self.nb1_pane_summary, wx.ID_ANY, _("An internal error occurred while %(action)s"))
self.st_summary = wx.StaticText(self.nb1_pane_summary, wx.ID_ANY, _("Error type: %(exc_type)s\nError summary: %(exc_msg)s"))
self.st_report = wx.StaticText(self.nb1_pane_summary, wx.ID_ANY, _("This is a bug - please report it."))
self.nb1_pane_details = wx.Panel(self.notebook_1, wx.ID_ANY)
self.st_details = wx.StaticText(self.nb1_pane_details, wx.ID_ANY, _("Error details:"))
self.tc_details = wx.TextCtrl(self.nb1_pane_details, wx.ID_ANY, "", style=wx.TE_MULTILINE)
self.notebook_1_pane_1 = wx.Panel(self.notebook_1, wx.ID_ANY)
self.tc_howto_report = wx.TextCtrl(self.notebook_1_pane_1, wx.ID_ANY, _("Writing a helpful bug report is easy if you follow some hints. The items below should help you to integrate useful information. They are not an absolute rule - it's more like a guideline.\n\n- What did you do? Maybe you want to include a screenshot.\n- What did you want to happen?\n- What did actually happen?\n- Provide a short example to reproduce the issue.\n- Include the internal error log file %(log_file)s if required.\n\nPlease open a new bug in the wxGlade bug tracker https://github.com/wxGlade/wxGlade/issues/ .\nAlternatively you can send the bug report to the wxGlade mailing list wxglade-general@lists.sourceforge.net. Keep in mind that you need a subscription for sending emails to this mailing list.\nThe subscription page is at https://sourceforge.net/projects/wxglade/lists/wxglade-general ."), style=wx.TE_MULTILINE | wx.TE_READONLY)
self.static_line_1 = wx.StaticLine(self, wx.ID_ANY)
self.btn_copy = wx.Button(self, wx.ID_COPY, "")
self.btn_ok = wx.Button(self, wx.ID_OK, "")
self.__set_properties()
self.__do_layout()
self.Bind(wx.EVT_BUTTON, self.OnCopy, self.btn_copy)
# end wxGlade
示例9: Out_Variable_Notebook
# 需要导入模块: import wx [as 别名]
# 或者: from wx import Notebook [as 别名]
def Out_Variable_Notebook(self):
notebook = wx.Notebook(self.panel, style=wx.BK_TOP)
k = 0
n_boxes = self.out_info.n_boxes
labels = ['Grids', 'Values at Pixels', 'Stacks', \
'Z-profiles at Pixels']
for k in range(n_boxes):
data = self.out_info.boxes[k]
page = TF_Output_Var_Box(parent=notebook, \
data=data)
notebook.AddPage(page, labels[k])
return notebook
# Out_Variable_Notebook()
#----------------------------------------------------------------
示例10: In_Variable_Notebook
# 需要导入模块: import wx [as 别名]
# 或者: from wx import Notebook [as 别名]
def In_Variable_Notebook(self):
notebook = wx.Notebook(self.panel, style=wx.BK_TOP)
k = 0
n_layers = self.proc_info.n_layers
for k in range(n_layers):
data = self.proc_info.layers[k]
kstr = str(k+1)
label = "Layer " + kstr + " variables"
page = TF_Input_Var_Box(parent=notebook, \
data=data, \
box_label=label)
notebook.AddPage(page, "Layer " + kstr)
return notebook
# In_Variable_Notebook()
#----------------------------------------------------------------
示例11: StringTest
# 需要导入模块: import wx [as 别名]
# 或者: from wx import Notebook [as 别名]
def StringTest(self, check_string):
"""
Test value 'name' is alphanumeric
@param check_string : input data for check
@return result : output data after check
"""
# string.printable is print this result
# '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ
# !"#$%&\'()*+,-./:;<=>?@[\\]^_`{|}~ \t\n\r\x0b\x0c
allow_range = string.printable
result = check_string
for i in range(0, len(check_string)):
# string.isalnum() is check whether string is alphanumeric or not
if check_string[len(check_string)-1-i:len(check_string)-i] in allow_range:
result = check_string[:len(check_string) - i]
break
return result
# -------------------------------------------------------------------------------
# For SDO Notebook (divide category)
# -------------------------------------------------------------------------------
示例12: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import Notebook [as 别名]
def __init__(self, parent, controler):
"""
Constructor
@param parent: Reference to the parent PDOPanelClass class
@param controler: _EthercatSlaveCTN class in EthercatSlave.py
"""
wx.Choicebook.__init__(self, parent, id=-1, size=(500, 500), style=wx.CHB_DEFAULT)
self.Controler = controler
RxWin = PDONoteBook(self, controler=self.Controler, name="Rx")
TxWin = PDONoteBook(self, controler=self.Controler, name="Tx")
self.AddPage(RxWin, "RxPDO")
self.AddPage(TxWin, "TxPDO")
# -------------------------------------------------------------------------------
# For PDO Notebook (divide PDO index)
# -------------------------------------------------------------------------------
示例13: UpdateSubTable
# 需要导入模块: import wx [as 别名]
# 或者: from wx import Notebook [as 别名]
def UpdateSubTable(self, row, col, data):
"""
Updates sub table.
It's done by deleting the sub table and creating it again.
@param row, col: size of the table
@param data: data
"""
self.SubTable.Destroy()
self.SubTable = RegisterSubTable(self, row, col)
self.Sizer.Detach(self.MainTable)
self.Sizer.AddMany([self.MainTable, self.SubTable])
self.Sizer.Layout()
self.SetSizer(self.Sizer)
self.SubTable.CreateGrid(row, col)
self.SubTable.SetValue(self, data)
self.SubTable.Update()
# -------------------------------------------------------------------------------
# For Register Access Notebook Panel (Main Table)
# -------------------------------------------------------------------------------
示例14: EditProjectSettings
# 需要导入模块: import wx [as 别名]
# 或者: from wx import Notebook [as 别名]
def EditProjectSettings(self):
old_values = self.Controler.GetProjectProperties()
dialog = ProjectDialog(self)
dialog.SetValues(old_values)
if dialog.ShowModal() == wx.ID_OK:
new_values = dialog.GetValues()
new_values["creationDateTime"] = old_values["creationDateTime"]
if new_values != old_values:
self.Controler.SetProjectProperties(None, new_values)
self._Refresh(TITLE, EDITORTOOLBAR, FILEMENU, EDITMENU, DISPLAYMENU,
PROJECTTREE, POUINSTANCEVARIABLESPANEL, SCALING)
dialog.Destroy()
# -------------------------------------------------------------------------------
# Notebook Unified Functions
# -------------------------------------------------------------------------------
示例15: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import Notebook [as 别名]
def __init__( self, parent, id = wx.ID_ANY, pos = wx.DefaultPosition, size = wx.Size( 400,300 ), style = wx.TAB_TRAVERSAL, name = wx.EmptyString ):
wx.Panel.__init__ ( self, parent, id = id, pos = pos, size = size, style = style, name = name )
bSizer20 = wx.BoxSizer( wx.VERTICAL )
self.notebook = wx.Notebook( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.NB_TOP|wx.BORDER_DEFAULT )
bSizer20.Add( self.notebook, 1, wx.EXPAND |wx.ALL, 5 )
bSizer39 = wx.BoxSizer( wx.HORIZONTAL )
self.m_button41 = wx.Button( self, wx.ID_ANY, u"Save current settings", wx.DefaultPosition, wx.DefaultSize, 0|wx.BORDER_DEFAULT )
bSizer39.Add( self.m_button41, 0, wx.ALL, 5 )
bSizer39.Add( ( 50, 0), 0, wx.EXPAND, 5 )
self.m_button42 = wx.Button( self, wx.ID_ANY, u"Generate BOM", wx.DefaultPosition, wx.DefaultSize, 0|wx.BORDER_DEFAULT )
self.m_button42.SetDefault()
bSizer39.Add( self.m_button42, 0, wx.ALL, 5 )
self.m_button43 = wx.Button( self, wx.ID_CANCEL, u"Cancel", wx.DefaultPosition, wx.DefaultSize, 0|wx.BORDER_DEFAULT )
bSizer39.Add( self.m_button43, 0, wx.ALL, 5 )
bSizer20.Add( bSizer39, 0, wx.ALIGN_CENTER, 5 )
self.SetSizer( bSizer20 )
self.Layout()
# Connect Events
self.m_button41.Bind( wx.EVT_BUTTON, self.OnSaveSettings )
self.m_button42.Bind( wx.EVT_BUTTON, self.OnGenerateBom )
self.m_button43.Bind( wx.EVT_BUTTON, self.OnExit )