]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/demo/URLDragAndDrop.py
Fixed drive handling on OS/2.
[wxWidgets.git] / wxPython / demo / URLDragAndDrop.py
index 4225a27707d18ff629d126ebc5c4a96e16e3c61e..bb93b95e122f0c3a40cd53c7725f51c41da7c12a 100644 (file)
@@ -30,27 +30,27 @@ class TestPanel(wxPanel):
     def __init__(self, parent, log):
         wxPanel.__init__(self, parent, -1)
 
-        self.SetAutoLayout(true)
+        self.SetAutoLayout(True)
         outsideSizer = wxBoxSizer(wxVERTICAL)
 
         msg = "Drag-And-Drop of URLs"
         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))
         text.SetForegroundColour(wxBLUE)
         outsideSizer.Add(text, 0, wxEXPAND|wxALL, 5)
         outsideSizer.Add(wxStaticLine(self, -1), 0, wxEXPAND)
-        outsideSizer.Add(20,20)
+        outsideSizer.Add((20,20))
 
-        self.SetFont(wxFont(10, wxSWISS, wxNORMAL, wxBOLD, false))
+        self.SetFont(wxFont(10, wxSWISS, wxNORMAL, wxBOLD, False))
 
         inSizer = wxFlexGridSizer(2, 2, 5, 5)
         inSizer.AddGrowableCol(0)
 
-        inSizer.Add(20,20)
-        inSizer.Add(20,20)
+        inSizer.Add((20,20))
+        inSizer.Add((20,20))
         inSizer.Add(wxStaticText(self, -1,
                                  "Drag URLs from your browser to\nthis window:",
                                  style = wxALIGN_RIGHT),
@@ -66,14 +66,16 @@ class TestPanel(wxPanel):
                     0, wxALIGN_RIGHT )
         self.dragText = wxTextCtrl(self, -1, "http://wxPython.org/")
         inSizer.Add(self.dragText, 0, wxEXPAND)
+        EVT_MOTION(self.dragText, self.OnStartDrag)
 
 
-        inSizer.Add(wxStaticText(self, -1,
-                                 "Drag this TEXT to your browser:",
-                                 style = wxALIGN_RIGHT),
-                    0, wxALIGN_RIGHT )
-        self.dragText2 = wxTextCtrl(self, -1, "http://wxPython.org/")
-        inSizer.Add(self.dragText2, 0, wxEXPAND)
+##         inSizer.Add(wxStaticText(self, -1,
+##                                  "Drag this TEXT to your browser:",
+##                                  style = wxALIGN_RIGHT),
+##                     0, wxALIGN_RIGHT )
+##         self.dragText2 = wxTextCtrl(self, -1, "http://wxPython.org/")
+##         inSizer.Add(self.dragText2, 0, wxEXPAND)
+##         EVT_MOTION(self.dragText2, self.OnStartDrag2)
 
 
         outsideSizer.Add(inSizer, 1, wxEXPAND)
@@ -82,8 +84,6 @@ class TestPanel(wxPanel):
 
         self.dropText.SetDropTarget(MyURLDropTarget(self.dropText))
 
-        EVT_MOTION(self.dragText, self.OnStartDrag)
-        EVT_MOTION(self.dragText2, self.OnStartDrag2)
 
 
     def OnStartDrag(self, evt):
@@ -121,3 +121,12 @@ def runTest(frame, nb, log):
 
 overview = """\
 """
+
+
+
+
+if __name__ == '__main__':
+    import sys,os
+    import run
+    run.main(['', os.path.basename(sys.argv[0])])
+