Added various tests
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@20764 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -7,6 +7,8 @@
|
|||||||
|
|
||||||
from wxPython.wx import *
|
from wxPython.wx import *
|
||||||
|
|
||||||
|
import time
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
|
|
||||||
class MyFrame(wxFrame):
|
class MyFrame(wxFrame):
|
||||||
@@ -76,6 +78,7 @@ check the source for this sample to see how to implement them.
|
|||||||
menu6.Append(601, "Submenu Item")
|
menu6.Append(601, "Submenu Item")
|
||||||
menu5.AppendMenu(504, "submenu", menu6)
|
menu5.AppendMenu(504, "submenu", menu6)
|
||||||
menu5.Append(505, "remove this menu")
|
menu5.Append(505, "remove this menu")
|
||||||
|
menu5.Append(506, "this is updated")
|
||||||
menuBar.Append(menu5, "&Fun")
|
menuBar.Append(menu5, "&Fun")
|
||||||
|
|
||||||
self.SetMenuBar(menuBar)
|
self.SetMenuBar(menuBar)
|
||||||
@@ -107,6 +110,7 @@ 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)
|
||||||
|
|
||||||
|
EVT_UPDATE_UI(wxGetApp(), 506, self.TestUpdateUI)
|
||||||
|
|
||||||
# Methods
|
# Methods
|
||||||
|
|
||||||
@@ -185,6 +189,12 @@ check the source for this sample to see how to implement them.
|
|||||||
mb.Remove(4)
|
mb.Remove(4)
|
||||||
|
|
||||||
|
|
||||||
|
def TestUpdateUI(self, evt):
|
||||||
|
#print 'TestUpdateUI'
|
||||||
|
text = time.ctime()
|
||||||
|
evt.SetText(text)
|
||||||
|
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
|
|
||||||
def runTest(frame, nb, log):
|
def runTest(frame, nb, log):
|
||||||
|
@@ -106,7 +106,7 @@ class MyEvtHandler(wxShapeEvtHandler):
|
|||||||
|
|
||||||
def OnLeftClick(self, x, y, keys = 0, attachment = 0):
|
def OnLeftClick(self, x, y, keys = 0, attachment = 0):
|
||||||
shape = self.GetShape()
|
shape = self.GetShape()
|
||||||
print shape.__class__
|
print shape.__class__, shape.GetClassName()
|
||||||
canvas = shape.GetCanvas()
|
canvas = shape.GetCanvas()
|
||||||
dc = wxClientDC(canvas)
|
dc = wxClientDC(canvas)
|
||||||
canvas.PrepareDC(dc)
|
canvas.PrepareDC(dc)
|
||||||
|
@@ -126,8 +126,11 @@ class DoodleWindow(wxWindow):
|
|||||||
text = self.menuColours[event.GetId()]
|
text = self.menuColours[event.GetId()]
|
||||||
if text == self.colour:
|
if text == self.colour:
|
||||||
event.Check(True)
|
event.Check(True)
|
||||||
|
event.SetText(text.upper())
|
||||||
else:
|
else:
|
||||||
event.Check(False)
|
event.Check(False)
|
||||||
|
event.SetText(text)
|
||||||
|
|
||||||
def OnCheckMenuThickness(self, event):
|
def OnCheckMenuThickness(self, event):
|
||||||
if event.GetId() == self.thickness:
|
if event.GetId() == self.thickness:
|
||||||
event.Check(True)
|
event.Check(True)
|
||||||
|
Reference in New Issue
Block a user