]>
git.saurik.com Git - wxWidgets.git/blob - wxPython/demo/EditableListBox.py
   3 import  wx
.gizmos   
as  gizmos
 
   5 #---------------------------------------------------------------------- 
   7 class TestPanel(wx
.Panel
): 
   8     def __init__(self
, parent
, log
): 
   9         wx
.Panel
.__init
__(self
, parent
, -1) 
  12         self
.elb 
= gizmos
.EditableListBox( 
  13                     self
, -1, "List of Stuff", (50,50), (250, 250) 
  15                     #style=wx.EL_ALLOW_NEW | wx.EL_ALLOW_EDIT | wx.EL_ALLOW_DELETE) 
  17         self
.elb
.SetStrings(["This is a nifty ListBox widget", 
  18                              "that is editable by the user.", 
  20                              "Use the buttons above to", 
  21                              "manipulate items in the list", 
  22                              "Or to add new ones.", 
  27 #---------------------------------------------------------------------- 
  29 def runTest(frame
, nb
, log
): 
  30     win 
= TestPanel(nb
, log
) 
  33 #---------------------------------------------------------------------- 
  40 This class provides a composite control that lets the user easily enter and edit  
  43 <p><b>Styles supported:</b><p> 
  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. 
  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") 
  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. 
  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. 
  70     <li><b>GetListCtrl()</b> - Retrieves a reference to the actual list control 
  71     portion of the custom control. 
  73     <li><b>GetDelButton()</b> - Retrieves a reference to the BitmapButton that is used 
  74     as the 'delete' button in the control. 
  76     <li><b>GetNewButton()</b> - Retrieves a reference to the BitmapButton that is used 
  77     as the 'new' button in the control. 
  79     <li><b>GetUpButton()</b> - Retrieves a reference to the BitmapButton that is used 
  80     as the 'up' button in the control. 
  82     <li><b>GetDownButton()</b> - Retrieves a reference to the BitmapButton that is used 
  83     as the 'down' button in the control. 
  85     <li><b>GetEditButton()</b> - Retrieves a reference to the BitmapButton that is used 
  86     as the 'edit' button in the control. 
  93 if __name__ 
== '__main__': 
  96     run
.main(['', os
.path
.basename(sys
.argv
[0])] + sys
.argv
[1:])