a fix for the last fix
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@9589 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -81,6 +81,7 @@ class FileBrowseButton(wxPanel):
|
||||
# SetValue is used to disable the callback
|
||||
self.SetValue( initialValue, 0)
|
||||
|
||||
|
||||
def createDialog( self, parent, id, pos, size, style ):
|
||||
"""Setup the graphic representation of the dialog"""
|
||||
wxPanel.__init__ (self, parent, id, pos, size, style)
|
||||
@@ -134,7 +135,7 @@ class FileBrowseButton(wxPanel):
|
||||
return textControl
|
||||
|
||||
def OnChanged(self, evt):
|
||||
if self.callCallback:
|
||||
if self.callCallback and self.changeCallback:
|
||||
self.changeCallback(evt)
|
||||
|
||||
def createBrowseButton( self):
|
||||
@@ -161,14 +162,13 @@ class FileBrowseButton(wxPanel):
|
||||
dlg = wxFileDialog(self, self.dialogTitle, directory, current, self.fileMask, self.fileMode)
|
||||
|
||||
if dlg.ShowModal() == wxID_OK:
|
||||
self.SetValue (dlg.GetPath())
|
||||
self.SetValue(dlg.GetPath())
|
||||
dlg.Destroy()
|
||||
|
||||
|
||||
|
||||
def GetValue (self):
|
||||
""" Convenient access to text control value """
|
||||
return self.textControl.GetValue ()
|
||||
return self.textControl.GetValue()
|
||||
|
||||
def SetValue (self, value, callBack=1):
|
||||
""" Convenient setting of text control value """
|
||||
@@ -196,6 +196,7 @@ class FileBrowseButton(wxPanel):
|
||||
|
||||
|
||||
|
||||
|
||||
class FileBrowseButtonWithHistory( FileBrowseButton ):
|
||||
""" with following additions:
|
||||
__init__(..., history=None)
|
||||
@@ -230,6 +231,7 @@ class FileBrowseButtonWithHistory( FileBrowseButton ):
|
||||
self.history=None
|
||||
apply( FileBrowseButton.__init__, ( self,)+arguments, namedarguments)
|
||||
|
||||
|
||||
def createTextControl( self):
|
||||
"""Create the text control"""
|
||||
ID = wxNewId()
|
||||
@@ -245,6 +247,7 @@ class FileBrowseButtonWithHistory( FileBrowseButton ):
|
||||
self.SetHistory( history, control=textControl)
|
||||
return textControl
|
||||
|
||||
|
||||
def GetHistoryControl( self ):
|
||||
"""Return a pointer to the control which provides (at least)
|
||||
the following methods for manipulating the history list.:
|
||||
@@ -256,6 +259,7 @@ class FileBrowseButtonWithHistory( FileBrowseButton ):
|
||||
"""
|
||||
return self.textControl
|
||||
|
||||
|
||||
def SetHistory( self, value=(), selectionIndex = None, control=None ):
|
||||
"""Set the current history list"""
|
||||
if control is None:
|
||||
@@ -274,6 +278,7 @@ class FileBrowseButtonWithHistory( FileBrowseButton ):
|
||||
if selectionIndex is not None:
|
||||
control.SetSelection( selectionIndex )
|
||||
|
||||
|
||||
def GetHistory( self ):
|
||||
"""Return the current history list"""
|
||||
if self.historyCallBack != None:
|
||||
@@ -281,12 +286,14 @@ class FileBrowseButtonWithHistory( FileBrowseButton ):
|
||||
else:
|
||||
return list( self.history )
|
||||
|
||||
|
||||
def OnSetFocus(self, event):
|
||||
"""When the history scroll is selected, update the history"""
|
||||
if self.historyCallBack != None:
|
||||
self.SetHistory( self.historyCallBack(), control=self.textControl)
|
||||
event.Skip()
|
||||
|
||||
|
||||
if wxPlatform == "__WXMSW__":
|
||||
def SetValue (self, value, callBack=1):
|
||||
""" Convenient setting of text control value, works
|
||||
|
Reference in New Issue
Block a user