]>
git.saurik.com Git - wxWidgets.git/blob - wxPython/demo/EditableListBox.py
1 # 11/17/2003 - Jeff Grimmett (grimmtooth@softhome.net)
3 # o Updated for wx namespace
4 # o Added overview text based on source code delving.
8 import wx
.gizmos
as gizmos
10 #----------------------------------------------------------------------
12 class TestPanel(wx
.Panel
):
13 def __init__(self
, parent
, log
):
14 wx
.Panel
.__init
__(self
, parent
, -1)
17 self
.elb
= gizmos
.EditableListBox(
18 self
, -1, "List of Stuff", (50,50), (250, 250)
20 #style=wx.EL_ALLOW_NEW | wx.EL_ALLOW_EDIT | wx.EL_ALLOW_DELETE)
22 self
.elb
.SetStrings(["This is a nifty ListBox widget",
23 "that is editable by the user.",
25 "Use the buttons above to",
26 "manipulate items in the list",
27 "Or to add new ones.",
32 #----------------------------------------------------------------------
34 def runTest(frame
, nb
, log
):
35 win
= TestPanel(nb
, log
)
38 #----------------------------------------------------------------------
45 This class provides a composite control that lets the user easily enter and edit
48 <p><b>Styles supported:</b><p>
51 <li><b>EL_ALLOW_NEW</b> - Allow user to create new items.
52 <li><b>EL_ALLOW_EDIT</b> - Allow user to edit text in the control.
53 <li><b>EL_ALLOW_DELETE</b> - Allow user to delete text from the control.
58 EditableListBox(wxWindow *parent, wxWindowID id=-1,
59 const wxString& label,
60 const wxPoint& pos = wxDefaultPosition,
61 const wxSize& size = wxDefaultSize,
62 long style = EL_ALLOW_NEW | EL_ALLOW_EDIT | EL_ALLOW_DELETE,
63 const wxString& name = "editableListBox")
68 <li><b>SetStrings(const wxArrayString& strings)</b> - Set an array of strings
69 into the control. <b>Note</b>: The wxPython method accepts a Python list instead
70 of an array of strings.
72 <li><b>void GetStrings(wxArrayString& strings)</b> - Retrieves an array
73 of strings from the control. The wxPython version returns a list of strings.
75 <li><b>GetListCtrl()</b> - Retrieves a reference to the actual list control
76 portion of the custom control.
78 <li><b>GetDelButton()</b> - Retrieves a reference to the BitmapButton that is used
79 as the 'delete' button in the control.
81 <li><b>GetNewButton()</b> - Retrieves a reference to the BitmapButton that is used
82 as the 'new' button in the control.
84 <li><b>GetUpButton()</b> - Retrieves a reference to the BitmapButton that is used
85 as the 'up' button in the control.
87 <li><b>GetDownButton()</b> - Retrieves a reference to the BitmapButton that is used
88 as the 'down' button in the control.
90 <li><b>GetEditButton()</b> - Retrieves a reference to the BitmapButton that is used
91 as the 'edit' button in the control.
98 if __name__
== '__main__':
101 run
.main(['', os
.path
.basename(sys
.argv
[0])])