Typos fixed and other tweaks
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@20516 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -9,7 +9,7 @@ text = """\
|
|||||||
Right-click on the panel (or Ctrl-click on the Mac) to show a popup
|
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
|
menu. Then look at the code for this sample. Notice how the
|
||||||
PopupMenu method is similar to the ShowModal method of a wxDialog in
|
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
|
event handlers for the popup menu items can either be attached to the
|
||||||
menu itself, or to the window that invokes PopupMenu.
|
menu itself, or to the window that invokes PopupMenu.
|
||||||
"""
|
"""
|
||||||
@@ -134,8 +134,8 @@ def runTest(frame, nb, log):
|
|||||||
|
|
||||||
|
|
||||||
overview = """<html><body>
|
overview = """<html><body>
|
||||||
<h2><center>Say something nice here</center></h2>
|
<h2><center>PopupMenu</center></h2>
|
||||||
|
""" + text + """
|
||||||
</body></html>
|
</body></html>
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
@@ -35,7 +35,7 @@ class TestFrame(wxFrame):
|
|||||||
EVT_WINDOW_CREATE(self, self.SetWindowShape)
|
EVT_WINDOW_CREATE(self, self.SetWindowShape)
|
||||||
else:
|
else:
|
||||||
# On wxMSW and wxMac the window has already been created, so go for it.
|
# On wxMSW and wxMac the window has already been created, so go for it.
|
||||||
pass #self.SetWindowShape()
|
self.SetWindowShape()
|
||||||
|
|
||||||
dc = wxClientDC(self)
|
dc = wxClientDC(self)
|
||||||
dc.DrawBitmap(self.bmp, 0,0, True)
|
dc.DrawBitmap(self.bmp, 0,0, True)
|
||||||
|
@@ -53,7 +53,7 @@ class TestVirtualList(wxListCtrl):
|
|||||||
return item.GetText()
|
return item.GetText()
|
||||||
|
|
||||||
def OnItemDeselected(self, evt):
|
def OnItemDeselected(self, evt):
|
||||||
print evt.m_itemIndex
|
self.log.WriteText("OnItemDeselected: %s" % evt.m_itemIndex)
|
||||||
|
|
||||||
|
|
||||||
#---------------------------------------------------
|
#---------------------------------------------------
|
||||||
|
@@ -81,6 +81,8 @@ check the source for this sample to see how to implement them.
|
|||||||
self.SetMenuBar(menuBar)
|
self.SetMenuBar(menuBar)
|
||||||
|
|
||||||
# Menu events
|
# Menu events
|
||||||
|
EVT_MENU_HIGHLIGHT_ALL(self, self.OnMenuHighlight)
|
||||||
|
|
||||||
EVT_MENU(self, 101, self.Menu101)
|
EVT_MENU(self, 101, self.Menu101)
|
||||||
EVT_MENU(self, 102, self.Menu102)
|
EVT_MENU(self, 102, self.Menu102)
|
||||||
EVT_MENU(self, 103, self.Menu103)
|
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, 503, self.TestRemove)
|
||||||
EVT_MENU(self, 505, self.TestRemove2)
|
EVT_MENU(self, 505, self.TestRemove2)
|
||||||
|
|
||||||
|
|
||||||
# Methods
|
# 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):
|
def Menu101(self, event):
|
||||||
self.log.write('Welcome to Mercury\n')
|
self.log.write('Welcome to Mercury\n')
|
||||||
|
|
||||||
|
@@ -95,7 +95,7 @@ class MyCanvas(wxScrolledWindow):
|
|||||||
## dc.SetFont(wxFont(14, wxSWISS, wxNORMAL, wxNORMAL))
|
## dc.SetFont(wxFont(14, wxSWISS, wxNORMAL, wxNORMAL))
|
||||||
## dc.SetTextForeground("BLACK")
|
## dc.SetTextForeground("BLACK")
|
||||||
## dc.DrawText("TEST this STRING", 10, 200)
|
## dc.DrawText("TEST this STRING", 10, 200)
|
||||||
|
## print dc.GetFullTextExtent("TEST this STRING")
|
||||||
|
|
||||||
font = wxFont(20, wxSWISS, wxNORMAL, wxNORMAL)
|
font = wxFont(20, wxSWISS, wxNORMAL, wxNORMAL)
|
||||||
dc.SetFont(font)
|
dc.SetFont(font)
|
||||||
|
@@ -29,8 +29,8 @@ class TestTreeCtrlPanel(wxPanel):
|
|||||||
self.log = log
|
self.log = log
|
||||||
tID = wxNewId()
|
tID = wxNewId()
|
||||||
|
|
||||||
self.tree = MyTreeCtrl(self, tID, wxDefaultPosition, wxDefaultSize,
|
self.tree = MyTreeCtrl(self, tID,
|
||||||
wxTR_HAS_BUTTONS
|
style = wxTR_HAS_BUTTONS
|
||||||
| wxTR_EDIT_LABELS
|
| wxTR_EDIT_LABELS
|
||||||
#| wxTR_MULTIPLE
|
#| wxTR_MULTIPLE
|
||||||
#| wxTR_HIDE_ROOT
|
#| wxTR_HIDE_ROOT
|
||||||
|
Reference in New Issue
Block a user