]> git.saurik.com Git - wxWidgets.git/blob - wxPython/demo/FileBrowseButton.py
c926dfa13ad1b102c9781daeebc2c1c8b116a45a
[wxWidgets.git] / wxPython / demo / FileBrowseButton.py
1
2 from wxPython.wx import *
3 from wxPython.lib.filebrowsebutton import FileBrowseButton, FileBrowseButtonWithHistory
4
5
6 #----------------------------------------------------------------------
7
8 class TestPanel(wxPanel):
9 def __init__(self, parent, ID, log):
10 wxPanel.__init__(self, parent, ID)
11 self.log = log
12 self.fbb = FileBrowseButton(self, -1, wxPoint(20,20), wxSize(450, -1),
13 changeCallback = self.fbbCallback)
14 self.fbbh = FileBrowseButtonWithHistory(self, -1, wxPoint(20, 50),
15 wxSize(450, -1),
16 #changeCallback = self.fbbhCallback
17 )
18
19 self.fbbh.SetHistory(['You', 'can', 'put', 'some', 'file', 'names', 'here'])
20
21
22 def fbbCallback(self, evt):
23 self.log.write('FileBrowseButton: %s\n' % evt.GetString())
24
25
26 def fbbhCallback(self, evt):
27 if hasattr(self, 'fbbh'):
28 value = evt.GetString()
29 self.log.write('FileBrowseButtonWithHistory: %s\n' % value)
30 history = self.fbbh.GetHistory()
31 history.append(value)
32 self.fbbh.SetHistory(history)
33
34
35 #----------------------------------------------------------------------
36
37 def runTest(frame, nb, log):
38 win = TestPanel(nb, -1, log)
39 return win
40
41
42
43 #----------------------------------------------------------------------
44
45
46
47 overview = FileBrowseButton.__doc__