various tweaks and updates
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15520 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -166,11 +166,7 @@ class TestWindow(wxShapeCanvas):
|
||||
# for some reason, the shapes have to be moved for the line to show up...
|
||||
fromShape.Move(dc, fromShape.GetX(), fromShape.GetY())
|
||||
|
||||
## EVT_PAINT(self, self.OnPaint)
|
||||
|
||||
## def OnPaint(self, evt):
|
||||
## evt.Skip()
|
||||
## print "TheLists:", wxThePenList.GetCount(), wxTheBrushList.GetCount(), wxTheFontList.GetCount()
|
||||
EVT_WINDOW_DESTROY(self, self.OnDestroy)
|
||||
|
||||
|
||||
def MyAddShape(self, shape, x, y, pen, brush, text):
|
||||
@@ -194,7 +190,8 @@ class TestWindow(wxShapeCanvas):
|
||||
|
||||
|
||||
|
||||
def __del__(self):
|
||||
def OnDestroy(self, evt):
|
||||
# Do some cleanup
|
||||
for shape in self.diagram.GetShapeList():
|
||||
if shape.GetParent() == None:
|
||||
shape.SetCanvas(None)
|
||||
|
@@ -52,27 +52,24 @@ class TestPopup(wxPopupWindow):
|
||||
self.Destroy()
|
||||
|
||||
|
||||
class TestPopupWithListbox(wxPopupWindow):
|
||||
def __init__(self, parent, style, log):
|
||||
wxPopupWindow.__init__(self, parent, style)
|
||||
import keyword
|
||||
self.lb = wxListBox(self, -1, choices = keyword.kwlist)
|
||||
## class TestPopupWithListbox(wxPopupWindow):
|
||||
## def __init__(self, parent, style, log):
|
||||
## wxPopupWindow.__init__(self, parent, style)
|
||||
## import keyword
|
||||
## self.lb = wxListBox(self, -1, choices = keyword.kwlist)
|
||||
## #sz = self.lb.GetBestSize()
|
||||
## self.SetSize((150, 75)) #sz)
|
||||
## self.lb.SetSize(self.GetClientSize())
|
||||
## self.lb.SetFocus()
|
||||
## EVT_LEFT_DOWN(self.lb, self.OnLeft)
|
||||
## EVT_LISTBOX(self, -1, self.OnListBox)
|
||||
|
||||
#sz = self.lb.GetBestSize()
|
||||
self.SetSize((150, 75)) #sz)
|
||||
self.lb.SetSize(self.GetClientSize())
|
||||
self.lb.SetFocus()
|
||||
|
||||
EVT_LEFT_DOWN(self.lb, self.OnLeft)
|
||||
EVT_LISTBOX(self, -1, self.OnListBox)
|
||||
|
||||
|
||||
def OnLeft(self, evt):
|
||||
print "OnLeft", evt.GetEventObject()
|
||||
evt.Skip()
|
||||
def OnListBox(self, evt):
|
||||
print "OnListBox", evt.GetEventObject()
|
||||
evt.Skip()
|
||||
## def OnLeft(self, evt):
|
||||
## print "OnLeft", evt.GetEventObject()
|
||||
## evt.Skip()
|
||||
## def OnListBox(self, evt):
|
||||
## print "OnListBox", evt.GetEventObject()
|
||||
## evt.Skip()
|
||||
|
||||
|
||||
|
||||
@@ -145,17 +142,17 @@ class TestPanel(wxPanel):
|
||||
win.Popup()
|
||||
|
||||
|
||||
def OnShowPopupListbox(self, evt):
|
||||
win = TestPopupWithListbox(self, wxNO_BORDER, self.log)
|
||||
## def OnShowPopupListbox(self, evt):
|
||||
## win = TestPopupWithListbox(self, wxNO_BORDER, self.log)
|
||||
|
||||
# Show the popup right below or above the button
|
||||
# depending on available screen space...
|
||||
btn = evt.GetEventObject()
|
||||
pos = btn.ClientToScreen( (0,0) )
|
||||
sz = btn.GetSize()
|
||||
win.Position(pos, (0, sz.height))
|
||||
## # Show the popup right below or above the button
|
||||
## # depending on available screen space...
|
||||
## btn = evt.GetEventObject()
|
||||
## pos = btn.ClientToScreen( (0,0) )
|
||||
## sz = btn.GetSize()
|
||||
## win.Position(pos, (0, sz.height))
|
||||
|
||||
win.Show(true)
|
||||
## win.Show(true)
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
|
Reference in New Issue
Block a user