X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/cf694132f1c28509a9f84377ce8d374bae4177ad..4120ef2b386b2f3385646d0338ff05c5a177e94c:/utils/wxPython/demo/wxListBox.py?ds=sidebyside diff --git a/utils/wxPython/demo/wxListBox.py b/utils/wxPython/demo/wxListBox.py index dd46fc5e30..769e4fd2bb 100644 --- a/utils/wxPython/demo/wxListBox.py +++ b/utils/wxPython/demo/wxListBox.py @@ -16,30 +16,33 @@ class TestListBox(wxPanel): wxPoint(45, 10)) wxStaticText(self, -1, "Select one:", wxPoint(15, 50), wxSize(65, 18)) - lb = wxListBox(self, 60, wxPoint(80, 50), wxSize(80, 120), + self.lb1 = wxListBox(self, 60, wxPoint(80, 50), wxSize(80, 120), sampleList, wxLB_SINGLE) EVT_LISTBOX(self, 60, self.EvtListBox) EVT_LISTBOX_DCLICK(self, 60, self.EvtListBoxDClick) - lb.SetSelection(0) + EVT_RIGHT_UP(self.lb1, self.EvtRightButton) + self.lb1.SetSelection(0) wxStaticText(self, -1, "Select many:", wxPoint(200, 50), wxSize(65, 18)) - self.lb = wxListBox(self, 70, wxPoint(280, 50), wxSize(80, 120), + self.lb2 = wxListBox(self, 70, wxPoint(280, 50), wxSize(80, 120), sampleList, wxLB_EXTENDED) EVT_LISTBOX(self, 70, self.EvtMultiListBox) EVT_LISTBOX_DCLICK(self, 70, self.EvtListBoxDClick) - self.lb.SetSelection(0) + self.lb2.SetSelection(0) def EvtListBox(self, event): self.log.WriteText('EvtListBox: %s\n' % event.GetString()) def EvtListBoxDClick(self, event): - self.log.WriteText('EvtListBoxDClick:\n') + self.log.WriteText('EvtListBoxDClick: %s\n' % self.lb1.GetSelection()) def EvtMultiListBox(self, event): - self.log.WriteText('EvtMultiListBox: %s\n' % str(self.lb.GetSelections())) + self.log.WriteText('EvtMultiListBox: %s\n' % str(self.lb2.GetSelections())) + def EvtRightButton(self, event): + self.log.WriteText('EvtRightButton: %s\n' % event.GetPosition()) #---------------------------------------------------------------------------