Python wx.EVT_LIST_ITEM_SELECTED Examples
The following are 11
code examples of wx.EVT_LIST_ITEM_SELECTED().
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: __init__.py From EventGhost with GNU General Public License v2.0 | 7 votes |
def __init__(self, parent, id, evtList, ix, plugin): width = 205 wx.ListCtrl.__init__(self, parent, id, style=wx.LC_REPORT | wx.LC_NO_HEADER | wx.LC_SINGLE_SEL, size = (width, -1)) self.parent = parent self.id = id self.evtList = evtList self.ix = ix self.plugin = plugin self.sel = -1 self.il = wx.ImageList(16, 16) self.il.Add(wx.BitmapFromImage(wx.Image(join(eg.imagesDir, "event.png"), wx.BITMAP_TYPE_PNG))) self.SetImageList(self.il, wx.IMAGE_LIST_SMALL) self.InsertColumn(0, '') self.SetColumnWidth(0, width - 5 - SYS_VSCROLL_X) self.Bind(wx.EVT_LIST_ITEM_SELECTED, self.OnSelect) self.Bind(wx.EVT_SET_FOCUS, self.OnChange) self.Bind(wx.EVT_LIST_INSERT_ITEM, self.OnChange) self.Bind(wx.EVT_LIST_ITEM_DESELECTED, self.OnChange) self.Bind(wx.EVT_LIST_ITEM_RIGHT_CLICK, self.OnRightClick) self.SetToolTipString(self.plugin.text.toolTip)
Example #2
Source File: toplevels_no_size_Phoenix.py From wxGlade with MIT License | 6 votes |
def __init__(self, *args, **kwds): # begin wxGlade: wxgMeasurementsByDayPnl.__init__ kwds["style"] = kwds.get("style", 0) | wx.TAB_TRAVERSAL wx.Panel.__init__(self, *args, **kwds) __szr_main = wx.BoxSizer(wx.HORIZONTAL) self._LCTRL_days = cReportListCtrl(self, wx.ID_ANY, style=wx.BORDER_NONE | wx.LC_REPORT) self._LCTRL_days.SetMinSize((100, 100)) __szr_main.Add(self._LCTRL_days, 1, wx.EXPAND | wx.RIGHT, 5) self._LCTRL_days_copy = cReportListCtrl(self, wx.ID_ANY, style=wx.BORDER_NONE | wx.LC_REPORT) self._LCTRL_days_copy.SetMinSize((100, 100)) __szr_main.Add(self._LCTRL_days_copy, 1, wx.EXPAND | wx.RIGHT, 5) self.SetSizer(__szr_main) __szr_main.Fit(self) self.Layout() self.Bind(wx.EVT_LIST_ITEM_SELECTED, self._on_day_selected, self._LCTRL_days) self.Bind(wx.EVT_LIST_ITEM_SELECTED, self._on_day_selected, self._LCTRL_days_copy) # end wxGlade
Example #3
Source File: toplevels_no_size_Classic.py From wxGlade with MIT License | 6 votes |
def __init__(self, *args, **kwds): # begin wxGlade: wxgMeasurementsByDayPnl.__init__ kwds["style"] = kwds.get("style", 0) | wx.TAB_TRAVERSAL wx.Panel.__init__(self, *args, **kwds) __szr_main = wx.BoxSizer(wx.HORIZONTAL) self._LCTRL_days = cReportListCtrl(self, wx.ID_ANY, style=wx.BORDER_NONE | wx.LC_REPORT) self._LCTRL_days.SetMinSize((100, 100)) __szr_main.Add(self._LCTRL_days, 1, wx.EXPAND | wx.RIGHT, 5) self._LCTRL_days_copy = cReportListCtrl(self, wx.ID_ANY, style=wx.BORDER_NONE | wx.LC_REPORT) self._LCTRL_days_copy.SetMinSize((100, 100)) __szr_main.Add(self._LCTRL_days_copy, 1, wx.EXPAND | wx.RIGHT, 5) self.SetSizer(__szr_main) __szr_main.Fit(self) self.Layout() self.Bind(wx.EVT_LIST_ITEM_SELECTED, self._on_day_selected, self._LCTRL_days) self.Bind(wx.EVT_LIST_ITEM_SELECTED, self._on_day_selected, self._LCTRL_days_copy) # end wxGlade
Example #4
Source File: DiscoveryPanel.py From OpenPLC_Editor with GNU General Public License v3.0 | 6 votes |
def _init_list_ctrl(self): # Set up list control listID = wx.NewId() self.ServicesList = AutoWidthListCtrl( id=listID, name='ServicesList', parent=self, pos=wx.Point(0, 0), size=wx.Size(0, 0), style=wx.LC_REPORT | wx.LC_EDIT_LABELS | wx.LC_SORT_ASCENDING | wx.LC_SINGLE_SEL) self.ServicesList.InsertColumn(0, _('NAME')) self.ServicesList.InsertColumn(1, _('TYPE')) self.ServicesList.InsertColumn(2, _('IP')) self.ServicesList.InsertColumn(3, _('PORT')) self.ServicesList.SetColumnWidth(0, 150) self.ServicesList.SetColumnWidth(1, 150) self.ServicesList.SetColumnWidth(2, 150) self.ServicesList.SetColumnWidth(3, 150) self.ServicesList.SetInitialSize(wx.Size(-1, 300)) self.Bind(wx.EVT_LIST_ITEM_SELECTED, self.OnItemSelected, id=listID) self.Bind(wx.EVT_LIST_ITEM_ACTIVATED, self.OnItemActivated, id=listID)
Example #5
Source File: listviews.py From pyFileFixity with MIT License | 5 votes |
def CreateControls(self): """Create our sub-controls""" wx.EVT_LIST_COL_CLICK(self, self.GetId(), self.OnReorder) wx.EVT_LIST_ITEM_SELECTED(self, self.GetId(), self.OnNodeSelected) wx.EVT_MOTION(self, self.OnMouseMove) wx.EVT_LIST_ITEM_ACTIVATED(self, self.GetId(), self.OnNodeActivated) self.CreateColumns()
Example #6
Source File: menubar.py From wxGlade with MIT License | 5 votes |
def bind_event_handlers(self): self.Bind(wx.EVT_TEXT, self.on_label_edited, self.label) self.Bind(wx.EVT_TEXT, self.on_event_handler_edited, self.event_handler) self.Bind(wx.EVT_TEXT, self.on_name_edited, self.name) self.Bind(wx.EVT_TEXT, self.on_help_str_edited, self.help_str) self.Bind(wx.EVT_TEXT, self.on_id_edited, self.id) self.Bind(wx.EVT_RADIOBOX, self.on_type_edited, self.type) self.Bind(wx.EVT_BUTTON, self.move_item_left, self.move_left) self.Bind(wx.EVT_BUTTON, self.move_item_right, self.move_right) self.Bind(wx.EVT_BUTTON, self.move_item_up, self.move_up) self.Bind(wx.EVT_BUTTON, self.move_item_down, self.move_down) self.Bind(wx.EVT_BUTTON, self.add_item, self.add) self.Bind(wx.EVT_BUTTON, self.remove_item, self.remove) self.Bind(wx.EVT_BUTTON, self.add_separator, self.add_sep) self.Bind(wx.EVT_BUTTON, self.on_cancel, self.cancel) self.Bind(wx.EVT_BUTTON, self.on_OK, self.ok) self.Bind(wx.EVT_LIST_ITEM_SELECTED, self.show_item, self.items) self.Bind(wx.EVT_CHAR_HOOK, self.on_char) self.remove.Bind(wx.EVT_CHAR_HOOK, self.on_button_char) # to ignore the Enter key while the focus is on Remove self.items.Bind(wx.EVT_MOUSEWHEEL, lambda e: e.Skip()) # workaround to make the scroll wheel work... for c,header in enumerate(self.headers): self.items.InsertColumn(c, _(header)) self.items.SetColumnWidth(c, self.column_widths[c])
Example #7
Source File: toolbar.py From wxGlade with MIT License | 5 votes |
def bind_event_handlers(self): self.Bind(wx.EVT_TEXT, self.on_label_edited, self.label) self.Bind(wx.EVT_TEXT, self.on_event_handler_edited, self.handler) self.Bind(wx.EVT_TEXT, self.on_help_str_edited, self.short_help) self.Bind(wx.EVT_TEXT, self.on_long_help_str_edited, self.long_help) self.Bind(wx.EVT_TEXT, self.on_id_edited, self.id) self.Bind(wx.EVT_RADIOBOX, self.on_type_edited, self.type) self.Bind(wx.EVT_BUTTON, self.move_item_up, self.move_up) self.Bind(wx.EVT_BUTTON, self.move_item_down, self.move_down) self.Bind(wx.EVT_BUTTON, self.add_item, self.add) self.Bind(wx.EVT_BUTTON, self.remove_item, self.remove) self.Bind(wx.EVT_BUTTON, self.add_separator, self.add_sep) self.Bind(wx.EVT_BUTTON, self.on_cancel, self.cancel) self.Bind(wx.EVT_BUTTON, self.on_OK, self.ok) self.Bind(wx.EVT_BUTTON, self.select_bitmap1, self.bitmap1_button) self.Bind(wx.EVT_BUTTON, self.select_bitmap2, self.bitmap2_button) self.Bind(wx.EVT_TEXT, self.on_bitmap1_edited, self.bitmap1) self.Bind(wx.EVT_TEXT, self.on_bitmap2_edited, self.bitmap2) self.Bind(wx.EVT_LIST_ITEM_SELECTED, self.show_item, self.items) self.Bind(wx.EVT_CHAR_HOOK, self.on_char) self.remove.Bind(wx.EVT_CHAR_HOOK, self.on_button_char) # to ignore the Enter key while the focus is on Remove self.items.Bind(wx.EVT_MOUSEWHEEL, lambda e: e.Skip()) # workaround to make the scroll wheel work... for c,header in enumerate(self.headers): self.items.InsertColumn(c, _(header)) self.items.SetColumnWidth(c, self.column_widths[c])
Example #8
Source File: ToolsDialog.py From wxGlade with MIT License | 4 votes |
def __init__(self, *args, **kwds): # begin wxGlade: ToolsDialog.__init__ kwds["style"] = wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER wx.Dialog.__init__(self, *args, **kwds) self.label = wx.TextCtrl(self, wx.ID_ANY, "") self.primary_bitmap = wx.TextCtrl(self, wx.ID_ANY, "") self.primary_bitmap_button = wx.Button(self, wx.ID_ANY, "...") self.disabled_bitmap = wx.TextCtrl(self, wx.ID_ANY, "") self.disabled_bitmap_button = wx.Button(self, wx.ID_ANY, "...") self.event_handler = wx.TextCtrl(self, wx.ID_ANY, "") self.name = wx.TextCtrl(self, wx.ID_ANY, "") self.help_str = wx.TextCtrl(self, wx.ID_ANY, "") self.id = wx.TextCtrl(self, wx.ID_ANY, "") self.check_radio = wx.RadioBox(self, wx.ID_ANY, "Type", choices=["Normal", "Checkable", "Radio"], majorDimension=1, style=wx.RA_SPECIFY_COLS) self.ok = wx.Button(self, wx.ID_OK, "") self.cancel = wx.Button(self, wx.ID_CANCEL, "") self.move_up = wx.Button(self, wx.ID_ANY, "Up") self.move_down = wx.Button(self, wx.ID_ANY, "Down") self.add = wx.Button(self, wx.ID_ANY, "&Add") self.remove = wx.Button(self, wx.ID_ANY, "&Remove") self.add_sep = wx.Button(self, wx.ID_ANY, "Add Separator") self.items = wx.ListCtrl(self, wx.ID_ANY, style=wx.BORDER_DEFAULT | wx.BORDER_SUNKEN | wx.LC_EDIT_LABELS | wx.LC_REPORT | wx.LC_SINGLE_SEL) self.__set_properties() self.__do_layout() self.Bind(wx.EVT_TEXT, self.update_item, self.label) self.Bind(wx.EVT_TEXT, self.update_item, self.primary_bitmap) self.Bind(wx.EVT_BUTTON, self.move_item_up, self.primary_bitmap_button) self.Bind(wx.EVT_TEXT, self.update_item, self.disabled_bitmap) self.Bind(wx.EVT_BUTTON, self.move_item_up, self.disabled_bitmap_button) self.Bind(wx.EVT_TEXT, self.update_item, self.event_handler) self.Bind(wx.EVT_TEXT, self.update_item, self.name) self.Bind(wx.EVT_TEXT, self.update_item, self.help_str) self.Bind(wx.EVT_TEXT, self.update_item, self.id) self.Bind(wx.EVT_RADIOBOX, self.update_item, self.check_radio) self.Bind(wx.EVT_BUTTON, self.move_item_up, self.move_up) self.Bind(wx.EVT_BUTTON, self.move_item_down, self.move_down) self.Bind(wx.EVT_BUTTON, self.add_item, self.add) self.Bind(wx.EVT_BUTTON, self.remove_item, self.remove) self.Bind(wx.EVT_BUTTON, self.add_separator, self.add_sep) self.Bind(wx.EVT_LIST_END_LABEL_EDIT, self.on_label_edited, self.items) self.Bind(wx.EVT_LIST_ITEM_SELECTED, self.show_item, self.items) # end wxGlade
Example #9
Source File: toplevels_no_size_Phoenix.py From wxGlade with MIT License | 4 votes |
def __init__(self, *args, **kwds): # begin wxGlade: wxgMeasurementsByDayPnl.__init__ kwds["style"] = kwds.get("style", 0) | wx.TAB_TRAVERSAL wx.Panel.__init__(self, *args, **kwds) __szr_main = wx.BoxSizer(wx.HORIZONTAL) self._LCTRL_days = cReportListCtrl(self, wx.ID_ANY, style=wx.BORDER_NONE | wx.LC_REPORT) self._LCTRL_days.SetMinSize((100, 100)) __szr_main.Add(self._LCTRL_days, 1, wx.EXPAND | wx.RIGHT, 5) self._LCTRL_results = cReportListCtrl(self, wx.ID_ANY, style=wx.BORDER_NONE | wx.LC_REPORT) self._LCTRL_results.SetMinSize((100, 100)) __szr_main.Add(self._LCTRL_results, 1, wx.EXPAND | wx.RIGHT, 5) __szr_details = wx.BoxSizer(wx.VERTICAL) __szr_main.Add(__szr_details, 1, wx.EXPAND, 0) self._TCTRL_measurements = wx.TextCtrl(self, wx.ID_ANY, "", style=wx.TE_AUTO_URL | wx.TE_MULTILINE | wx.TE_READONLY) self._TCTRL_measurements.SetMinSize((255, 102)) self._TCTRL_measurements.SetBackgroundColour(wx.SystemSettings.GetColour(wx.SYS_COLOUR_BACKGROUND)) __szr_details.Add(self._TCTRL_measurements, 1, wx.EXPAND, 0) __szr_show_docs = wx.BoxSizer(wx.HORIZONTAL) __szr_details.Add(__szr_show_docs, 0, wx.EXPAND, 0) self._LBL_no_of_docs = wx.StaticText(self, wx.ID_ANY, "") self._LBL_no_of_docs.SetMinSize((100, 100)) __szr_show_docs.Add(self._LBL_no_of_docs, 0, wx.ALIGN_CENTER_VERTICAL | wx.RIGHT, 3) self._BTN_show_docs = wx.Button(self, wx.ID_ANY, "Show X documents") self._BTN_show_docs.SetMinSize((100, 100)) self._BTN_show_docs.SetToolTip("Show lab related documents for the episode of the selected measurement.") self._BTN_show_docs.Enable(False) __szr_show_docs.Add(self._BTN_show_docs, 0, wx.ALIGN_CENTER_VERTICAL, 0) __szr_show_docs.Add((20, 20), 1, wx.EXPAND, 0) self.SetSizer(__szr_main) __szr_main.Fit(self) self.Layout() self.Bind(wx.EVT_LIST_ITEM_SELECTED, self._on_day_selected, self._LCTRL_days) self.Bind(wx.EVT_LIST_ITEM_SELECTED, self._on_result_selected, self._LCTRL_results) self.Bind(wx.EVT_BUTTON, self._on_show_docs_button_pressed, self._BTN_show_docs) # end wxGlade
Example #10
Source File: toplevels_no_size_Classic.py From wxGlade with MIT License | 4 votes |
def __init__(self, *args, **kwds): # begin wxGlade: wxgMeasurementsByDayPnl.__init__ kwds["style"] = kwds.get("style", 0) | wx.TAB_TRAVERSAL wx.Panel.__init__(self, *args, **kwds) __szr_main = wx.BoxSizer(wx.HORIZONTAL) self._LCTRL_days = cReportListCtrl(self, wx.ID_ANY, style=wx.BORDER_NONE | wx.LC_REPORT) self._LCTRL_days.SetMinSize((100, 100)) __szr_main.Add(self._LCTRL_days, 1, wx.EXPAND | wx.RIGHT, 5) self._LCTRL_results = cReportListCtrl(self, wx.ID_ANY, style=wx.BORDER_NONE | wx.LC_REPORT) self._LCTRL_results.SetMinSize((100, 100)) __szr_main.Add(self._LCTRL_results, 1, wx.EXPAND | wx.RIGHT, 5) __szr_details = wx.BoxSizer(wx.VERTICAL) __szr_main.Add(__szr_details, 1, wx.EXPAND, 0) self._TCTRL_measurements = wx.TextCtrl(self, wx.ID_ANY, "", style=wx.TE_AUTO_URL | wx.TE_MULTILINE | wx.TE_READONLY) self._TCTRL_measurements.SetMinSize((255, 102)) self._TCTRL_measurements.SetBackgroundColour(wx.SystemSettings_GetColour(wx.SYS_COLOUR_BACKGROUND)) __szr_details.Add(self._TCTRL_measurements, 1, wx.EXPAND, 0) __szr_show_docs = wx.BoxSizer(wx.HORIZONTAL) __szr_details.Add(__szr_show_docs, 0, wx.EXPAND, 0) self._LBL_no_of_docs = wx.StaticText(self, wx.ID_ANY, "") self._LBL_no_of_docs.SetMinSize((100, 100)) __szr_show_docs.Add(self._LBL_no_of_docs, 0, wx.ALIGN_CENTER_VERTICAL | wx.RIGHT, 3) self._BTN_show_docs = wx.Button(self, wx.ID_ANY, "Show X documents") self._BTN_show_docs.SetMinSize((100, 100)) self._BTN_show_docs.SetToolTip(wx.ToolTip("Show lab related documents for the episode of the selected measurement.")) self._BTN_show_docs.Enable(False) __szr_show_docs.Add(self._BTN_show_docs, 0, wx.ALIGN_CENTER_VERTICAL, 0) __szr_show_docs.Add((20, 20), 1, wx.EXPAND, 0) self.SetSizer(__szr_main) __szr_main.Fit(self) self.Layout() self.Bind(wx.EVT_LIST_ITEM_SELECTED, self._on_day_selected, self._LCTRL_days) self.Bind(wx.EVT_LIST_ITEM_SELECTED, self._on_result_selected, self._LCTRL_results) self.Bind(wx.EVT_BUTTON, self._on_show_docs_button_pressed, self._BTN_show_docs) # end wxGlade
Example #11
Source File: toplevels_no_size_Classic.py From wxGlade with MIT License | 4 votes |
def __init__(self, *args, **kwds): # begin wxGlade: MyFrame1.__init__ kwds["style"] = kwds.get("style", 0) | wx.DEFAULT_FRAME_STYLE wx.Frame.__init__(self, *args, **kwds) self.SetTitle("frame_1") __szr_main = wx.BoxSizer(wx.HORIZONTAL) self._LCTRL_days = cReportListCtrl(self, wx.ID_ANY, style=wx.BORDER_NONE | wx.LC_REPORT) self._LCTRL_days.SetMinSize((100, 100)) __szr_main.Add(self._LCTRL_days, 1, wx.EXPAND | wx.RIGHT, 5) self._LCTRL_results = cReportListCtrl(self, wx.ID_ANY, style=wx.BORDER_NONE | wx.LC_REPORT) self._LCTRL_results.SetMinSize((100, 100)) __szr_main.Add(self._LCTRL_results, 1, wx.EXPAND | wx.RIGHT, 5) __szr_details = wx.BoxSizer(wx.VERTICAL) __szr_main.Add(__szr_details, 1, wx.EXPAND, 0) self._TCTRL_measurements = wx.TextCtrl(self, wx.ID_ANY, "", style=wx.TE_AUTO_URL | wx.TE_MULTILINE | wx.TE_READONLY) self._TCTRL_measurements.SetMinSize((255, 102)) self._TCTRL_measurements.SetBackgroundColour(wx.SystemSettings_GetColour(wx.SYS_COLOUR_BACKGROUND)) __szr_details.Add(self._TCTRL_measurements, 1, wx.EXPAND, 0) __szr_show_docs = wx.BoxSizer(wx.HORIZONTAL) __szr_details.Add(__szr_show_docs, 0, wx.EXPAND, 0) self._LBL_no_of_docs = wx.StaticText(self, wx.ID_ANY, "") self._LBL_no_of_docs.SetMinSize((100, 100)) __szr_show_docs.Add(self._LBL_no_of_docs, 0, wx.ALIGN_CENTER_VERTICAL | wx.RIGHT, 3) self._BTN_show_docs = wx.Button(self, wx.ID_ANY, "Show X documents") self._BTN_show_docs.SetMinSize((100, 100)) self._BTN_show_docs.SetToolTip(wx.ToolTip("Show lab related documents for the episode of the selected measurement.")) self._BTN_show_docs.Enable(False) __szr_show_docs.Add(self._BTN_show_docs, 0, wx.ALIGN_CENTER_VERTICAL, 0) __szr_show_docs.Add((20, 20), 1, wx.EXPAND, 0) self.SetSizer(__szr_main) __szr_main.Fit(self) self.Layout() self.Bind(wx.EVT_LIST_ITEM_SELECTED, self._on_day_selected, self._LCTRL_days) self.Bind(wx.EVT_LIST_ITEM_SELECTED, self._on_result_selected, self._LCTRL_results) self.Bind(wx.EVT_BUTTON, self._on_show_docs_button_pressed, self._BTN_show_docs) # end wxGlade