Python wx.EVT_LISTBOX_DCLICK Examples
The following are 5
code examples of wx.EVT_LISTBOX_DCLICK().
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example.
You may also want to check out all available functions/classes of the module
wx
, or try the search function
.
Example #1
Source File: bomsaway.py From Boms-Away with GNU General Public License v3.0 | 6 votes |
def __init__(self, parent, id, title): wx.Dialog.__init__(self, parent, id, title) self.selection_idx = None self.selection_text = None vbox = wx.BoxSizer(wx.VERTICAL) stline = wx.StaticText( self, 11, 'Duplicate Component values found!' '\n\nPlease select which format to follow:') vbox.Add(stline, 0, wx.ALIGN_CENTER|wx.TOP) self.comp_list = wx.ListBox(self, 331, style=wx.LB_SINGLE) vbox.Add(self.comp_list, 1, wx.ALIGN_CENTER_HORIZONTAL | wx.EXPAND) self.SetSizer(vbox) self.comp_list.Bind(wx.EVT_LISTBOX_DCLICK, self.on_selection, id=wx.ID_ANY) self.Show(True)
Example #2
Source File: templates_ui.py From wxGlade with MIT License | 6 votes |
def __init__(self, *args, **kwds): # begin wxGlade: TemplateListDialog.__init__ kwds["style"] = wx.DEFAULT_DIALOG_STYLE wx.Dialog.__init__(self, *args, **kwds) self.template_names = wx.ListBox(self, wx.ID_ANY, choices=[]) self.template_name = wx.StaticText(self, wx.ID_ANY, _("wxGlade template:\n")) self.author = wx.TextCtrl(self, wx.ID_ANY, "", style=wx.TE_READONLY) self.description = wx.TextCtrl(self, wx.ID_ANY, "", style=wx.TE_MULTILINE | wx.TE_READONLY) self.instructions = wx.TextCtrl(self, wx.ID_ANY, "", style=wx.TE_MULTILINE | wx.TE_READONLY) self.btn_open = wx.Button(self, wx.ID_OPEN, "") self.btn_edit = wx.Button(self, ID_EDIT, _("&Edit")) self.btn_delete = wx.Button(self, wx.ID_DELETE, "") self.btn_cancel = wx.Button(self, wx.ID_CANCEL, "") self.__set_properties() self.__do_layout() self.Bind(wx.EVT_LISTBOX_DCLICK, self.on_open, self.template_names) self.Bind(wx.EVT_LISTBOX, self.on_select_template, self.template_names) self.Bind(wx.EVT_BUTTON, self.on_open, self.btn_open) self.Bind(wx.EVT_BUTTON, self.on_edit, id=ID_EDIT) self.Bind(wx.EVT_BUTTON, self.on_delete, self.btn_delete) # end wxGlade
Example #3
Source File: cfgdlg.py From trelby with GNU General Public License v2.0 | 4 votes |
def __init__(self, parent, id, cfg): wx.Panel.__init__(self, parent, id) self.cfg = cfg vsizer = wx.BoxSizer(wx.VERTICAL) vsizer.Add(wx.StaticText(self, -1, "Screen fonts:")) self.fontsLb = wx.ListBox(self, -1, size = (300, 100)) for it in ["fontNormal", "fontBold", "fontItalic", "fontBoldItalic"]: self.fontsLb.Append("", it) vsizer.Add(self.fontsLb, 0, wx.BOTTOM, 10) hsizer = wx.BoxSizer(wx.HORIZONTAL) btn = wx.Button(self, -1, "Change") wx.EVT_LISTBOX_DCLICK(self, self.fontsLb.GetId(), self.OnChangeFont) wx.EVT_BUTTON(self, btn.GetId(), self.OnChangeFont) self.errText = wx.StaticText(self, -1, "") self.origColor = self.errText.GetForegroundColour() hsizer.Add(btn) hsizer.Add((20, -1)) hsizer.Add(self.errText, 0, wx.ALIGN_CENTER_VERTICAL) vsizer.Add(hsizer, 0, wx.BOTTOM, 20) vsizer.Add(wx.StaticText(self, -1, "The settings below apply only" " to 'Draft' view mode."), 0, wx.BOTTOM, 15) hsizer = wx.BoxSizer(wx.HORIZONTAL) hsizer.Add(wx.StaticText(self, -1, "Row spacing:"), 0, wx.ALIGN_CENTER_VERTICAL | wx.RIGHT, 10) self.spacingEntry = wx.SpinCtrl(self, -1) self.spacingEntry.SetRange(*self.cfg.cvars.getMinMax("fontYdelta")) wx.EVT_SPINCTRL(self, self.spacingEntry.GetId(), self.OnMisc) wx.EVT_KILL_FOCUS(self.spacingEntry, self.OnKillFocus) hsizer.Add(self.spacingEntry, 0) hsizer.Add(wx.StaticText(self, -1, "pixels"), 0, wx.ALIGN_CENTER_VERTICAL | wx.LEFT, 10) vsizer.Add(hsizer, 0, wx.EXPAND | wx.BOTTOM, 15) self.pbRb = wx.RadioBox(self, -1, "Page break lines to show", style = wx.RA_SPECIFY_COLS, majorDimension = 1, choices = [ "None", "Normal", "Normal + unadjusted " ]) vsizer.Add(self.pbRb) self.fontsLb.SetSelection(0) self.updateFontLb() self.cfg2gui() util.finishWindow(self, vsizer, center = False) wx.EVT_RADIOBOX(self, self.pbRb.GetId(), self.OnMisc)
Example #4
Source File: commondialogs.py From CANFestivino with GNU Lesser General Public License v2.1 | 4 votes |
def _init_ctrls(self, prnt): wx.Dialog.__init__(self, id=ID_COMMUNICATIONDIALOG, name='CommunicationDialog', parent=prnt, pos=wx.Point(234, 216), size=wx.Size(726, 437), style=wx.DEFAULT_DIALOG_STYLE|wx.RESIZE_BORDER, title=_('Edit Communication Profile')) self.SetClientSize(wx.Size(726, 437)) self.staticText1 = wx.StaticText(id=ID_COMMUNICATIONDIALOGSTATICTEXT1, label=_('Possible Profile Indexes:'), name='staticText1', parent=self, pos=wx.Point(0, 0), size=wx.Size(0, 17), style=0) self.PossibleIndexes = wx.ListBox(choices=[], id=ID_COMMUNICATIONDIALOGPOSSIBLEINDEXES, name='PossibleIndexes', parent=self, pos=wx.Point(0, 0), size=wx.Size(0, 0), style=wx.LB_EXTENDED) self.Bind(wx.EVT_LISTBOX_DCLICK, self.OnPossibleIndexesDClick, id=ID_COMMUNICATIONDIALOGPOSSIBLEINDEXES) self.Select = wx.Button(id=ID_COMMUNICATIONDIALOGSELECT, label='>>', name='Select', parent=self, pos=wx.Point(0, 0), size=wx.Size(32, 32), style=0) self.Select.Bind(wx.EVT_BUTTON, self.OnSelectButton, id=ID_COMMUNICATIONDIALOGSELECT) self.Unselect = wx.Button(id=ID_COMMUNICATIONDIALOGUNSELECT, label='<<', name='Unselect', parent=self, pos=wx.Point(0, 0), size=wx.Size(32, 32), style=0) self.Unselect.Bind(wx.EVT_BUTTON, self.OnUnselectButton, id=ID_COMMUNICATIONDIALOGUNSELECT) self.staticText2 = wx.StaticText(id=ID_COMMUNICATIONDIALOGSTATICTEXT2, label=_('Current Profile Indexes:'), name='staticText2', parent=self, pos=wx.Point(0, 0), size=wx.Size(0, 17), style=0) self.CurrentIndexes = wx.ListBox(choices=[], id=ID_COMMUNICATIONDIALOGCURRENTINDEXES, name='CurrentIndexes', parent=self, pos=wx.Point(0, 0), size=wx.Size(0, 0), style=wx.LB_EXTENDED) self.Bind(wx.EVT_LISTBOX_DCLICK, self.OnCurrentIndexesDClick, id=ID_COMMUNICATIONDIALOGCURRENTINDEXES) self.ButtonSizer = self.CreateButtonSizer(wx.OK|wx.CANCEL) self._init_sizers()
Example #5
Source File: JobInfo.py From meerk40t with MIT License | 4 votes |
def __init__(self, *args, **kwds): # begin wxGlade: JobInfo.__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((659, 612)) self.operations_listbox = wx.ListBox(self, wx.ID_ANY, choices=[], style=wx.LB_ALWAYS_SB | wx.LB_SINGLE) self.commands_listbox = wx.ListBox(self, wx.ID_ANY, choices=[], style=wx.LB_ALWAYS_SB | wx.LB_SINGLE) self.button_job_spooler = wx.BitmapButton(self, wx.ID_ANY, icons8_route_50.GetBitmap()) self.button_writer_control = wx.Button(self, wx.ID_ANY, _("Start Job")) self.button_writer_control.SetBitmap(icons8_laser_beam_52.GetBitmap()) self.button_writer_control.SetFont( wx.Font(15, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, 0, "Segoe UI")) # Menu Bar self.JobInfo_menubar = wx.MenuBar() wxglade_tmp_menu = wx.Menu() self.menu_autostart = wxglade_tmp_menu.Append(wx.ID_ANY, _("Start Spooler"), "", wx.ITEM_CHECK) self.Bind(wx.EVT_MENU, self.on_check_auto_start_controller, id=self.menu_autostart.GetId()) self.menu_prehome = wxglade_tmp_menu.Append(wx.ID_ANY, _("Home Before"), "", wx.ITEM_CHECK) self.Bind(wx.EVT_MENU, self.on_check_home_before, id=self.menu_prehome.GetId()) self.menu_autohome = wxglade_tmp_menu.Append(wx.ID_ANY, _("Home After"), "", wx.ITEM_CHECK) self.Bind(wx.EVT_MENU, self.on_check_home_after, id=self.menu_autohome.GetId()) self.menu_autobeep = wxglade_tmp_menu.Append(wx.ID_ANY, _("Beep After"), "", wx.ITEM_CHECK) self.Bind(wx.EVT_MENU, self.on_check_beep_after, id=self.menu_autobeep.GetId()) self.JobInfo_menubar.Append(wxglade_tmp_menu, _("Automatic")) wxglade_tmp_menu = wx.Menu() t = wxglade_tmp_menu.Append(wx.ID_ANY, _("Home"), "") self.Bind(wx.EVT_MENU, self.jobadd_home, id=t.GetId()) t = wxglade_tmp_menu.Append(wx.ID_ANY, _("Wait"), "") self.Bind(wx.EVT_MENU, self.jobadd_wait, id=t.GetId()) t = wxglade_tmp_menu.Append(wx.ID_ANY, _("Beep"), "") self.Bind(wx.EVT_MENU, self.jobadd_beep, id=t.GetId()) t = wxglade_tmp_menu.Append(wx.ID_ANY, _("Interrupt"), "") self.Bind(wx.EVT_MENU, self.jobadd_interrupt, id=t.GetId()) self.JobInfo_menubar.Append(wxglade_tmp_menu, _("Add")) self.SetMenuBar(self.JobInfo_menubar) # Menu Bar end self.__set_properties() self.__do_layout() self.Bind(wx.EVT_LISTBOX, self.on_listbox_operation_click, self.operations_listbox) self.Bind(wx.EVT_LISTBOX_DCLICK, self.on_listbox_operation_dclick, self.operations_listbox) self.Bind(wx.EVT_LISTBOX, self.on_listbox_commands_click, self.commands_listbox) self.Bind(wx.EVT_LISTBOX_DCLICK, self.on_listbox_commands_dclick, self.commands_listbox) self.Bind(wx.EVT_BUTTON, self.on_button_start_job, self.button_writer_control) self.Bind(wx.EVT_BUTTON, self.on_button_job_spooler, self.button_job_spooler) # end wxGlade self.Bind(wx.EVT_CLOSE, self.on_close, self) # TODO: Move this to Elements self.preprocessor = OperationPreprocessor() self.operations = []