diff --git a/wxPython/demo/PopupMenu.py b/wxPython/demo/PopupMenu.py index dd71d51585..97966273e3 100644 --- a/wxPython/demo/PopupMenu.py +++ b/wxPython/demo/PopupMenu.py @@ -9,7 +9,7 @@ text = """\ Right-click on the panel (or Ctrl-click on the Mac) to show a popup menu. Then look at the code for this sample. Notice how the PopupMenu method is similar to the ShowModal method of a wxDialog in -that it doesn't retirn until the popup menu has been dismissed. The +that it doesn't return until the popup menu has been dismissed. The event handlers for the popup menu items can either be attached to the menu itself, or to the window that invokes PopupMenu. """ @@ -134,8 +134,8 @@ def runTest(frame, nb, log): overview = """ -

Say something nice here

- +

PopupMenu

+""" + text + """ """ diff --git a/wxPython/demo/ShapedWindow.py b/wxPython/demo/ShapedWindow.py index 13b2389e10..1c06df2984 100644 --- a/wxPython/demo/ShapedWindow.py +++ b/wxPython/demo/ShapedWindow.py @@ -35,7 +35,7 @@ class TestFrame(wxFrame): EVT_WINDOW_CREATE(self, self.SetWindowShape) else: # On wxMSW and wxMac the window has already been created, so go for it. - pass #self.SetWindowShape() + self.SetWindowShape() dc = wxClientDC(self) dc.DrawBitmap(self.bmp, 0,0, True) diff --git a/wxPython/demo/wxListCtrl_virtual.py b/wxPython/demo/wxListCtrl_virtual.py index 7dffd52fdd..c6af18cf2c 100644 --- a/wxPython/demo/wxListCtrl_virtual.py +++ b/wxPython/demo/wxListCtrl_virtual.py @@ -53,7 +53,7 @@ class TestVirtualList(wxListCtrl): return item.GetText() def OnItemDeselected(self, evt): - print evt.m_itemIndex + self.log.WriteText("OnItemDeselected: %s" % evt.m_itemIndex) #--------------------------------------------------- diff --git a/wxPython/demo/wxMenu.py b/wxPython/demo/wxMenu.py index 2a6edde544..3df64ce951 100644 --- a/wxPython/demo/wxMenu.py +++ b/wxPython/demo/wxMenu.py @@ -81,6 +81,8 @@ check the source for this sample to see how to implement them. self.SetMenuBar(menuBar) # Menu events + EVT_MENU_HIGHLIGHT_ALL(self, self.OnMenuHighlight) + EVT_MENU(self, 101, self.Menu101) EVT_MENU(self, 102, self.Menu102) EVT_MENU(self, 103, self.Menu103) @@ -105,8 +107,19 @@ check the source for this sample to see how to implement them. EVT_MENU(self, 503, self.TestRemove) EVT_MENU(self, 505, self.TestRemove2) + # Methods + def OnMenuHighlight(self, event): + # Show how to get menu item imfo from this event handler + id = event.GetMenuId() + item = self.GetMenuBar().FindItemById(id) + text = item.GetText() + help = item.GetHelp() + #print text, help + event.Skip() # but in this case just call Skip so the default is done + + def Menu101(self, event): self.log.write('Welcome to Mercury\n') diff --git a/wxPython/demo/wxScrolledWindow.py b/wxPython/demo/wxScrolledWindow.py index 74ff5ef191..e9108418e8 100644 --- a/wxPython/demo/wxScrolledWindow.py +++ b/wxPython/demo/wxScrolledWindow.py @@ -95,7 +95,7 @@ class MyCanvas(wxScrolledWindow): ## dc.SetFont(wxFont(14, wxSWISS, wxNORMAL, wxNORMAL)) ## dc.SetTextForeground("BLACK") ## dc.DrawText("TEST this STRING", 10, 200) - +## print dc.GetFullTextExtent("TEST this STRING") font = wxFont(20, wxSWISS, wxNORMAL, wxNORMAL) dc.SetFont(font) diff --git a/wxPython/demo/wxTreeCtrl.py b/wxPython/demo/wxTreeCtrl.py index 9a6a24f468..9130b19c97 100644 --- a/wxPython/demo/wxTreeCtrl.py +++ b/wxPython/demo/wxTreeCtrl.py @@ -29,8 +29,8 @@ class TestTreeCtrlPanel(wxPanel): self.log = log tID = wxNewId() - self.tree = MyTreeCtrl(self, tID, wxDefaultPosition, wxDefaultSize, - wxTR_HAS_BUTTONS + self.tree = MyTreeCtrl(self, tID, + style = wxTR_HAS_BUTTONS | wxTR_EDIT_LABELS #| wxTR_MULTIPLE #| wxTR_HIDE_ROOT