]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/demo/wxCheckListBox.py
added missing methods/removed duplicated base methods
[wxWidgets.git] / wxPython / demo / wxCheckListBox.py
index 4727459b0c15e5c88ee2a18277555817588a3443..72003af446c8d1984c8c773a57a8b70d76671409 100644 (file)
@@ -21,6 +21,8 @@ class TestPanel(wxPanel):
         EVT_LISTBOX_DCLICK(self, 60, self.EvtListBoxDClick)
         lb.SetSelection(0)
 
+        EVT_RIGHT_UP(self, self.OnDoPopup)
+
 
     def EvtListBox(self, event):
         self.log.WriteText('EvtListBox: %s\n' % event.GetString())
@@ -28,6 +30,24 @@ class TestPanel(wxPanel):
     def EvtListBoxDClick(self, event):
         self.log.WriteText('EvtListBoxDClick:\n')
 
+    def OnDoPopup(self, evt):
+        menu = wxMenu()
+        # Make this first item bold
+        item = wxMenuItem(menu, wxNewId(), "If supported, this is &bold")
+        df = wxSystemSettings_GetSystemFont(wxSYS_DEFAULT_GUI_FONT)
+        nf = wxFont(df.GetPointSize(), df.GetFamily(), df.GetStyle(), wxBOLD,
+                    false, df.GetFaceName())
+        item.SetFont(nf)
+        menu.AppendItem(item)
+
+        menu.AppendItem(wxMenuItem(menu, wxNewId(), "Normal Item &1"))
+        menu.AppendItem(wxMenuItem(menu, wxNewId(), "Normal Item &2"))
+        menu.AppendItem(wxMenuItem(menu, wxNewId(), "Normal Item &3"))
+        menu.AppendItem(wxMenuItem(menu, wxNewId(), "Normal Item &4"))
+
+        self.PopupMenu(menu, evt.GetPosition())
+        menu.Destroy()
+        evt.Skip()
 
 
 #----------------------------------------------------------------------