本文整理汇总了Python中wx.EVT_CHECKLISTBOX属性的典型用法代码示例。如果您正苦于以下问题:Python wx.EVT_CHECKLISTBOX属性的具体用法?Python wx.EVT_CHECKLISTBOX怎么用?Python wx.EVT_CHECKLISTBOX使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类wx
的用法示例。
在下文中一共展示了wx.EVT_CHECKLISTBOX属性的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import EVT_CHECKLISTBOX [as 别名]
def __init__(self,parent,style,mainwin,plottype):
wx.PopupTransientWindow.__init__(self,parent,style)
self.mainwin = mainwin
self.plottype = plottype
win = wx.Panel(self) #,wx.ID_ANY,pos=(0,0),size=(180,200),style=0)
self.selection = wx.CheckListBox(win, wx.ID_ANY, choices = OutputPlotTypes, size=(150,-1))#,pos=(0,0))
#self.win.Bind(wx.EVT_CHECKLISTBOX, self.OnTicked, self.selection)
self.selection.Bind(wx.EVT_CHECKLISTBOX, self.OnTicked)
if plottype == 'Theory':
display_curves = self.mainwin.display_theory_curves
else:
display_curves = self.mainwin.display_expt_curves
checked_items = []
for i in range(len(display_curves)):
if display_curves[i]:
checked_items.append(i)
self.selection.SetChecked(checked_items)
self.SetSize(self.selection.GetSize()+(10,10))
self.SetMinSize(self.selection.GetSize()+(10,10))
popup_sizer = wx.BoxSizer(wx.VERTICAL)
popup_sizer.Add(self.selection,0,wx.ALL, 7)
win.SetSizer(popup_sizer)
popup_sizer.Fit(win)
self.Layout()
示例2: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import EVT_CHECKLISTBOX [as 别名]
def __init__(self, parent, value):
pre = wx.PreDialog()
g.frame.res.LoadOnDialog(pre, parent, 'DIALOG_CONTENT_CHECKLIST')
self.PostCreate(pre)
self.list = xrc.XRCCTRL(self, 'CHECK_LIST')
# Set list items
i = 0
for v,ch in value:
self.list.Append(v)
self.list.Check(i, ch)
i += 1
self.SetAutoLayout(True)
self.GetSizer().Fit(self)
# Callbacks
self.ID_BUTTON_APPEND = xrc.XRCID('BUTTON_APPEND')
self.ID_BUTTON_REMOVE = xrc.XRCID('BUTTON_REMOVE')
self.ID_BUTTON_UP = xrc.XRCID('BUTTON_UP')
self.ID_BUTTON_DOWN = xrc.XRCID('BUTTON_DOWN')
wx.EVT_CHECKLISTBOX(self, self.list.GetId(), self.OnCheck)
wx.EVT_BUTTON(self, self.ID_BUTTON_UP, self.OnButtonUp)
wx.EVT_BUTTON(self, self.ID_BUTTON_DOWN, self.OnButtonDown)
wx.EVT_BUTTON(self, self.ID_BUTTON_APPEND, self.OnButtonAppend)
wx.EVT_BUTTON(self, self.ID_BUTTON_REMOVE, self.OnButtonRemove)
wx.EVT_UPDATE_UI(self, self.ID_BUTTON_UP, self.OnUpdateUI)
wx.EVT_UPDATE_UI(self, self.ID_BUTTON_DOWN, self.OnUpdateUI)
wx.EVT_UPDATE_UI(self, self.ID_BUTTON_REMOVE, self.OnUpdateUI)
示例3: _bind
# 需要导入模块: import wx [as 别名]
# 或者: from wx import EVT_CHECKLISTBOX [as 别名]
def _bind(self, ctlName, evt=None, proc=None):
if isinstance(ctlName, wx.PyEventBinder): # binding to self
ctl=super(wx.Window, self)
proc=evt
evt=ctlName
elif isinstance(ctlName, wx.Window):
ctl=ctlName
else:
ctl=self[ctlName]
if not proc:
if not isinstance(evt, wx.PyEventBinder):
proc=evt
evt=None
if not proc:
proc=self.OnCheck
if not evt:
if isinstance(ctl, wx.Button):
evt=wx.EVT_BUTTON
elif isinstance(ctl, wx.CheckBox):
evt=wx.EVT_CHECKBOX
elif isinstance(ctl, wx.CheckListBox):
evt=wx.EVT_CHECKLISTBOX
elif isinstance(ctl, wx.RadioButton):
evt=wx.EVT_RADIOBUTTON
else:
evt=wx.EVT_TEXT
if isinstance(ctl, wx.ComboBox):
ctl.Bind(wx.EVT_COMBOBOX, proc)
ctl.Bind(evt, proc)
示例4: FinishSetup
# 需要导入模块: import wx [as 别名]
# 或者: from wx import EVT_CHECKLISTBOX [as 别名]
def FinishSetup(self):
self.shown = True
if self.lines:
self.AddGrid(self.lines, *self.sizerProps)
spaceSizer = wx.BoxSizer(wx.HORIZONTAL)
spaceSizer.Add((2, 2))
spaceSizer.Add(self.sizer, 1, wx.EXPAND | wx.TOP | wx.BOTTOM, 3)
spaceSizer.Add((4, 4))
self.SetSizerAndFit(spaceSizer)
#self.dialog.FinishSetup()
def OnEvent(dummyEvent):
self.SetIsDirty()
self.Bind(wx.EVT_CHECKBOX, OnEvent)
self.Bind(wx.EVT_BUTTON, OnEvent)
self.Bind(wx.EVT_CHOICE, OnEvent)
self.Bind(wx.EVT_TOGGLEBUTTON, OnEvent)
self.Bind(wx.EVT_TEXT, OnEvent)
self.Bind(wx.EVT_RADIOBOX, OnEvent)
self.Bind(wx.EVT_RADIOBUTTON, OnEvent)
self.Bind(wx.EVT_TREE_SEL_CHANGED, OnEvent)
self.Bind(wx.EVT_DATE_CHANGED, OnEvent)
self.Bind(eg.EVT_VALUE_CHANGED, OnEvent)
self.Bind(wx.EVT_CHECKLISTBOX, OnEvent)
self.Bind(wx.EVT_SCROLL, OnEvent)
self.Bind(wx.EVT_LISTBOX, OnEvent)
示例5: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import EVT_CHECKLISTBOX [as 别名]
def __init__(self, *args, **kwds):
# begin wxGlade: Preferences.__init__
kwds["style"] = kwds.get("style", 0) | wx.DEFAULT_FRAME_STYLE | wx.FRAME_TOOL_WINDOW | wx.STAY_ON_TOP
wx.Frame.__init__(self, *args, **kwds)
Module.__init__(self)
self.SetSize((412, 183))
self.checklist_options = wx.CheckListBox(self, wx.ID_ANY,
choices=[
"Invert Mouse Wheel Zoom",
"Print Shutdown",
])
self.radio_units = wx.RadioBox(self, wx.ID_ANY, _("Units"),
choices=[_("mm"), _("cm"), _("inch"), _("mils")],
majorDimension=1,
style=wx.RA_SPECIFY_ROWS)
from wxMeerK40t import supported_languages
choices = [language_name for language_code, language_name, language_index in supported_languages]
self.combo_language = wx.ComboBox(self, wx.ID_ANY, choices=choices, style=wx.CB_DROPDOWN)
self.__set_properties()
self.__do_layout()
self.Bind(wx.EVT_RADIOBOX, self.on_radio_units, self.radio_units)
self.Bind(wx.EVT_COMBOBOX, self.on_combo_language, self.combo_language)
self.Bind(wx.EVT_CHECKLISTBOX, self.on_checklist_settings, self.checklist_options)
# end wxGlade
self.Bind(wx.EVT_CLOSE, self.on_close, self)