]> git.saurik.com Git - wxWidgets.git/blob - wxPython/demo/EditableListBox.py
wchar_t (4 bytes) / unichar (2 bytes) problems first attempt to fix
[wxWidgets.git] / wxPython / demo / EditableListBox.py
1
2 import wx
3 import wx.gizmos as gizmos
4
5 #----------------------------------------------------------------------
6
7 class TestPanel(wx.Panel):
8 def __init__(self, parent, log):
9 wx.Panel.__init__(self, parent, -1)
10 self.log = log
11
12 self.elb = gizmos.EditableListBox(
13 self, -1, "List of Stuff", (50,50), (250, 250)
14 )
15 #style=wx.EL_ALLOW_NEW | wx.EL_ALLOW_EDIT | wx.EL_ALLOW_DELETE)
16
17 self.elb.SetStrings(["This is a nifty ListBox widget",
18 "that is editable by the user.",
19 "",
20 "Use the buttons above to",
21 "manipulate items in the list",
22 "Or to add new ones.",
23 ])
24
25
26
27 #----------------------------------------------------------------------
28
29 def runTest(frame, nb, log):
30 win = TestPanel(nb, log)
31 return win
32
33 #----------------------------------------------------------------------
34
35
36
37 overview = """\
38 <html>
39 <body>
40 This class provides a composite control that lets the user easily enter and edit
41 a list of strings.
42
43 <p><b>Styles supported:</b><p>
44
45 <ul>
46 <li><b>EL_ALLOW_NEW</b> - Allow user to create new items.
47 <li><b>EL_ALLOW_EDIT</b> - Allow user to edit text in the control.
48 <li><b>EL_ALLOW_DELETE</b> - Allow user to delete text from the control.
49 </ul>
50
51 <p><b>Init:</b>
52 <pre>
53 EditableListBox(wxWindow *parent, wxWindowID id=-1,
54 const wxString& label,
55 const wxPoint& pos = wxDefaultPosition,
56 const wxSize& size = wxDefaultSize,
57 long style = EL_ALLOW_NEW | EL_ALLOW_EDIT | EL_ALLOW_DELETE,
58 const wxString& name = "editableListBox")
59 </pre>
60
61 <p><b>Methods:</b>
62 <ul>
63 <li><b>SetStrings(const wxArrayString& strings)</b> - Set an array of strings
64 into the control. <b>Note</b>: The wxPython method accepts a Python list instead
65 of an array of strings.
66
67 <li><b>void GetStrings(wxArrayString& strings)</b> - Retrieves an array
68 of strings from the control. The wxPython version returns a list of strings.
69
70 <li><b>GetListCtrl()</b> - Retrieves a reference to the actual list control
71 portion of the custom control.
72
73 <li><b>GetDelButton()</b> - Retrieves a reference to the BitmapButton that is used
74 as the 'delete' button in the control.
75
76 <li><b>GetNewButton()</b> - Retrieves a reference to the BitmapButton that is used
77 as the 'new' button in the control.
78
79 <li><b>GetUpButton()</b> - Retrieves a reference to the BitmapButton that is used
80 as the 'up' button in the control.
81
82 <li><b>GetDownButton()</b> - Retrieves a reference to the BitmapButton that is used
83 as the 'down' button in the control.
84
85 <li><b>GetEditButton()</b> - Retrieves a reference to the BitmapButton that is used
86 as the 'edit' button in the control.
87 </ul>
88 </body>
89 </html>
90 """
91
92
93 if __name__ == '__main__':
94 import sys,os
95 import run
96 run.main(['', os.path.basename(sys.argv[0])])
97