Switched to using True/False in the wxPython lib and demo instead of
true/false or TRUE/FALSE to prepare for the new boolean type and constants being added to Python. Added code to wx.py to test for the existence of the new constants and to create suitable values if not present. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@19335 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -139,7 +139,7 @@ class DoodleDropTarget(wxPyDropTarget):
|
||||
|
||||
def OnDrop(self, x, y):
|
||||
self.log.WriteText("OnDrop: %d %d\n" % (x, y))
|
||||
return true
|
||||
return True
|
||||
|
||||
def OnDragOver(self, x, y, d):
|
||||
#self.log.WriteText("OnDragOver: %d, %d, %d\n" % (x, y, d))
|
||||
@@ -154,7 +154,7 @@ class DoodleDropTarget(wxPyDropTarget):
|
||||
|
||||
|
||||
|
||||
# Called when OnDrop returns true. We need to get the data and
|
||||
# Called when OnDrop returns True. We need to get the data and
|
||||
# do something with it.
|
||||
def OnData(self, x, y, d):
|
||||
self.log.WriteText("OnData: %d, %d, %d\n" % (x, y, d))
|
||||
@@ -206,7 +206,7 @@ class CustomDnDPanel(wxPanel):
|
||||
def __init__(self, parent, log):
|
||||
wxPanel.__init__(self, parent, -1)
|
||||
|
||||
self.SetFont(wxFont(10, wxSWISS, wxNORMAL, wxBOLD, false))
|
||||
self.SetFont(wxFont(10, wxSWISS, wxNORMAL, wxBOLD, False))
|
||||
|
||||
# Make the controls
|
||||
text1 = wxStaticText(self, -1,
|
||||
@@ -218,9 +218,9 @@ class CustomDnDPanel(wxPanel):
|
||||
)
|
||||
|
||||
rb1 = wxRadioButton(self, -1, "Draw", style=wxRB_GROUP)
|
||||
rb1.SetValue(true)
|
||||
rb1.SetValue(True)
|
||||
rb2 = wxRadioButton(self, -1, "Drag")
|
||||
rb2.SetValue(false)
|
||||
rb2.SetValue(False)
|
||||
|
||||
text2 = wxStaticText(self, -1,
|
||||
"The lower window is accepting a\n"
|
||||
@@ -250,7 +250,7 @@ class CustomDnDPanel(wxPanel):
|
||||
|
||||
sizer.Add(dndsizer, 1, wxEXPAND)
|
||||
|
||||
self.SetAutoLayout(true)
|
||||
self.SetAutoLayout(True)
|
||||
self.SetSizer(sizer)
|
||||
|
||||
# Events
|
||||
@@ -270,12 +270,12 @@ class TestPanel(wxPanel):
|
||||
def __init__(self, parent, log):
|
||||
wxPanel.__init__(self, parent, -1)
|
||||
|
||||
self.SetAutoLayout(true)
|
||||
self.SetAutoLayout(True)
|
||||
sizer = wxBoxSizer(wxVERTICAL)
|
||||
|
||||
msg = "Custom Drag-And-Drop"
|
||||
text = wxStaticText(self, -1, "", style=wxALIGN_CENTRE)
|
||||
text.SetFont(wxFont(24, wxSWISS, wxNORMAL, wxBOLD, false))
|
||||
text.SetFont(wxFont(24, wxSWISS, wxNORMAL, wxBOLD, False))
|
||||
text.SetLabel(msg)
|
||||
w,h = text.GetTextExtent(msg)
|
||||
text.SetSize(wxSize(w,h+1))
|
||||
@@ -306,7 +306,7 @@ if __name__ == '__main__':
|
||||
def OnInit(self):
|
||||
wxInitAllImageHandlers()
|
||||
self.MakeFrame()
|
||||
return true
|
||||
return True
|
||||
|
||||
def MakeFrame(self, event=None):
|
||||
frame = wxFrame(None, -1, "Custom Drag and Drop", size=(550,400))
|
||||
@@ -317,7 +317,7 @@ if __name__ == '__main__':
|
||||
frame.SetMenuBar(mb)
|
||||
EVT_MENU(frame, 6543, self.MakeFrame)
|
||||
panel = TestPanel(frame, DummyLog())
|
||||
frame.Show(true)
|
||||
frame.Show(True)
|
||||
self.SetTopWindow(frame)
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user