Little tweaks and fixes.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@14501 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn 2002-03-08 23:06:21 +00:00
parent ff42dd6650
commit 91a64dfd31
4 changed files with 27 additions and 3 deletions

View File

@ -9,7 +9,9 @@ class TestPanel(wxPanel):
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.",

View File

@ -26,6 +26,22 @@ from wxPython.wx import *
# - 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),
@ -54,6 +70,7 @@ class ColourSelect(wxButton):
self.SetColour(bcolour)
def OnChange(self):
wxPostEvent(self, ColourSelectEvent(self.GetId(), self.GetValue()))
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...

View File

@ -111,8 +111,10 @@ class FileBrowseButton(wxPanel):
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)

View 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.
If anyone is interested, it would be nice to have this ported to C++.
"""