]> git.saurik.com Git - wxWidgets.git/blobdiff - utils/wxPython/demo/wxListBox.py
added IsEncodingAvailable and GetAltForEncoding extended by facename argument and...
[wxWidgets.git] / utils / wxPython / demo / wxListBox.py
index dd46fc5e30480fcb2bdaac6faf108200590a1cce..3cba2b0fa2ebc7540955403ca00bd192b6212021 100644 (file)
@@ -16,30 +16,34 @@ 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())
+        self.lb1.Delete(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())
 
 #---------------------------------------------------------------------------