Merged wxPython 2.4.x to the 2.5 branch (Finally!!!)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@19793 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -35,17 +35,26 @@ class MyFrame(wxFrame):
|
||||
wxStaticText(panel, -1, "Size:",
|
||||
wxDLG_PNT(panel, wxPoint(4, 4)), wxDefaultSize)
|
||||
wxStaticText(panel, -1, "Pos:",
|
||||
wxDLG_PNT(panel, wxPoint(4, 14)), wxDefaultSize)
|
||||
wxDLG_PNT(panel, wxPoint(4, 18)), wxDefaultSize)
|
||||
wxStaticText(panel, -1, "ScreenPos:",
|
||||
wxDLG_PNT(panel, wxPoint(4, 32)), wxDefaultSize)
|
||||
self.sizeCtrl = wxTextCtrl(panel, -1, "",
|
||||
wxDLG_PNT(panel, wxPoint(24, 4)),
|
||||
wxDLG_PNT(panel, wxPoint(36, 4)),
|
||||
wxDLG_SZE(panel, wxSize(36, -1)),
|
||||
wxTE_READONLY)
|
||||
|
||||
self.posCtrl = wxTextCtrl(panel, -1, "",
|
||||
wxDLG_PNT(panel, wxPoint(24, 14)),
|
||||
wxDLG_PNT(panel, wxPoint(36, 18)),
|
||||
wxDLG_SZE(panel, wxSize(36, -1)),
|
||||
wxTE_READONLY)
|
||||
|
||||
self.sposCtrl = wxTextCtrl(panel, -1, "",
|
||||
wxDLG_PNT(panel, wxPoint(36, 32)),
|
||||
wxDLG_SZE(panel, wxSize(36, -1)),
|
||||
wxTE_READONLY)
|
||||
|
||||
panel.Fit()
|
||||
self.Fit()
|
||||
|
||||
# This method is called automatically when the CLOSE event is
|
||||
# sent to this window
|
||||
@@ -59,6 +68,8 @@ class MyFrame(wxFrame):
|
||||
def OnSize(self, event):
|
||||
size = event.GetSize()
|
||||
self.sizeCtrl.SetValue("%s, %s" % (size.width, size.height))
|
||||
p = self.ClientToScreen((0,0))
|
||||
self.sposCtrl.SetValue("%s, %s" % (p.x, p.y))
|
||||
|
||||
# tell the event system to continue looking for an event handler,
|
||||
# so the default handler will get called.
|
||||
@@ -69,6 +80,8 @@ class MyFrame(wxFrame):
|
||||
def OnMove(self, event):
|
||||
pos = event.GetPosition()
|
||||
self.posCtrl.SetValue("%s, %s" % (pos.x, pos.y))
|
||||
p = self.ClientToScreen((0,0))
|
||||
self.sposCtrl.SetValue("%s, %s" % (p.x, p.y))
|
||||
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user