# 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)
return textControl
def OnChanged(self, evt):
- if self.callCallback:
+ if self.callCallback and self.changeCallback:
self.changeCallback(evt)
def createBrowseButton( self):
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 """
+
class FileBrowseButtonWithHistory( FileBrowseButton ):
""" with following additions:
__init__(..., history=None)
self.history=None
apply( FileBrowseButton.__init__, ( self,)+arguments, namedarguments)
+
def createTextControl( self):
"""Create the text control"""
ID = wxNewId()
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.:
"""
return self.textControl
+
def SetHistory( self, value=(), selectionIndex = None, control=None ):
"""Set the current history list"""
if control is None:
if selectionIndex is not None:
control.SetSelection( selectionIndex )
+
def GetHistory( self ):
"""Return the current history list"""
if self.historyCallBack != None:
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