]> git.saurik.com Git - wxWidgets.git/commitdiff
Little tweaks and fixes.
authorRobin Dunn <robin@alldunn.com>
Fri, 8 Mar 2002 23:06:21 +0000 (23:06 +0000)
committerRobin Dunn <robin@alldunn.com>
Fri, 8 Mar 2002 23:06:21 +0000 (23:06 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@14501 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

wxPython/demo/wxEditableListBox.py
wxPython/wxPython/lib/colourselect.py
wxPython/wxPython/lib/filebrowsebutton.py
wxPython/wxPython/lib/rcsizer.py

index 27ebfe4e852c41729f08a401f4d9ff158884ebab..b8816cad1d1fd498ed07e30f23555be4a425442e 100644 (file)
@@ -9,7 +9,9 @@ class TestPanel(wxPanel):
         self.log = log
 
         self.elb = wxEditableListBox(self, -1, "List of Stuff",
         self.log = log
 
         self.elb = wxEditableListBox(self, -1, "List of Stuff",
-                                     (50,50), (250, 250))
+                                     (50,50), (250, 250),
+                                     )
+                                     #style=wxEL_ALLOW_NEW | wxEL_ALLOW_EDIT | wxEL_ALLOW_DELETE)
 
         self.elb.SetStrings(["This is a nifty ListBox widget",
                              "that is editable by the user.",
 
         self.elb.SetStrings(["This is a nifty ListBox widget",
                              "that is editable by the user.",
index 53e828389e0367f9920b4be768ccc31fa063fb7c..db9043d802c1d94c76b826f1a94844be44312816 100644 (file)
@@ -26,6 +26,22 @@ from wxPython.wx import *
 # - Rearranged arguments to more closely follow wx conventions
 # - Simplified some of the code
 
 # - Rearranged arguments to more closely follow wx conventions
 # - Simplified some of the code
 
+# Cliff Wells, 2002/02/07
+# - Added ColourSelect Event
+
+EVT_COMMAND_COLOURSELECT = wxNewId()
+
+class ColourSelectEvent(wxPyCommandEvent):
+        def __init__(self, id, value):
+                wxPyCommandEvent.__init__(self, id = id)
+                self.SetEventType(EVT_COMMAND_COLOURSELECT)
+                self.value = value
+
+        def GetValue(self):
+                return self.value
+
+def EVT_COLOURSELECT(win, id, func):
+    win.Connect(id, -1, EVT_COMMAND_COLOURSELECT, func)
 
 class ColourSelect(wxButton):
     def __init__(self, parent, id, label = "", bcolour=(0, 0, 0),
 
 class ColourSelect(wxButton):
     def __init__(self, parent, id, label = "", bcolour=(0, 0, 0),
@@ -54,6 +70,7 @@ class ColourSelect(wxButton):
         self.SetColour(bcolour)
 
     def OnChange(self):
         self.SetColour(bcolour)
 
     def OnChange(self):
+        wxPostEvent(self, ColourSelectEvent(self.GetId(), self.GetValue()))
         if self.callback is not None:
             self.callback()
 
         if self.callback is not None:
             self.callback()
 
@@ -70,3 +87,4 @@ class ColourSelect(wxButton):
 
         if changed:
             self.OnChange() # moved after dlg.Destroy, since who knows what the callback will do...
 
         if changed:
             self.OnChange() # moved after dlg.Destroy, since who knows what the callback will do...
+
index 5bf576cd917ee1438bbc2564e126ba8aea43c738..0ddc2818c6b45d0e5ccbd73d53d9f9a80cfc9301 100644 (file)
@@ -111,8 +111,10 @@ class FileBrowseButton(wxPanel):
         self.Layout()
         if type( size ) == types.TupleType:
             size = apply( wxSize, size)
         self.Layout()
         if type( size ) == types.TupleType:
             size = apply( wxSize, size)
-        if size.width != -1 or size.height != -1:
-            self.SetSize(size)
+        self.SetDimensions(-1, -1, size.width, size.height, wxSIZE_USE_EXISTING)
+
+#        if size.width != -1 or size.height != -1:
+#            self.SetSize(size)
 
     def SetBackgroundColour(self,color):
         wxPanel.SetBackgroundColour(self,color)
 
     def SetBackgroundColour(self,color):
         wxPanel.SetBackgroundColour(self,color)
index af164089ea1fd833658197cef9331c8f2fd69d71..93029fdaa3217d25e4c8334d7370c0714d310c26 100644 (file)
@@ -16,6 +16,8 @@ wxFlexGridSizer but item position is not implicit but explicitly
 specified by row and col, and row/col spanning is supported.
 
 Adapted from code by Niki Spahiev.
 specified by row and col, and row/col spanning is supported.
 
 Adapted from code by Niki Spahiev.
+
+If anyone is interested, it would be nice to have this ported to C++.
 """
 
 
 """