2008-03-08 13:52:38 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: editlbox.h
|
2008-03-10 15:24:38 +00:00
|
|
|
// Purpose: interface of wxEditableListBox
|
2008-03-08 13:52:38 +00:00
|
|
|
// Author: wxWidgets team
|
2010-07-13 13:29:13 +00:00
|
|
|
// Licence: wxWindows licence
|
2008-03-08 13:52:38 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2012-05-22 00:17:03 +00:00
|
|
|
#define wxEL_ALLOW_NEW 0x0100
|
|
|
|
#define wxEL_ALLOW_EDIT 0x0200
|
|
|
|
#define wxEL_ALLOW_DELETE 0x0400
|
|
|
|
#define wxEL_NO_REORDER 0x0800
|
|
|
|
#define wxEL_DEFAULT_STYLE (wxEL_ALLOW_NEW | wxEL_ALLOW_EDIT | wxEL_ALLOW_DELETE)
|
|
|
|
|
2008-03-08 13:52:38 +00:00
|
|
|
/**
|
|
|
|
@class wxEditableListBox
|
2008-03-08 14:43:31 +00:00
|
|
|
|
2008-03-28 16:19:12 +00:00
|
|
|
An editable listbox is composite control that lets the user easily enter,
|
|
|
|
delete and reorder a list of strings.
|
2008-03-08 14:43:31 +00:00
|
|
|
|
2008-03-08 13:52:38 +00:00
|
|
|
@beginStyleTable
|
2008-04-06 14:43:04 +00:00
|
|
|
@style{wxEL_ALLOW_NEW}
|
2008-03-08 13:52:38 +00:00
|
|
|
Allows the user to enter new strings.
|
2008-04-06 14:43:04 +00:00
|
|
|
@style{wxEL_ALLOW_EDIT}
|
2008-03-08 13:52:38 +00:00
|
|
|
Allows the user to edit existing strings.
|
2008-04-06 14:43:04 +00:00
|
|
|
@style{wxEL_ALLOW_DELETE}
|
2008-03-08 13:52:38 +00:00
|
|
|
Allows the user to delete existing strings.
|
2008-04-06 14:43:04 +00:00
|
|
|
@style{wxEL_NO_REORDER}
|
2008-03-08 13:52:38 +00:00
|
|
|
Does not allow the user to reorder the strings.
|
2008-04-06 14:43:04 +00:00
|
|
|
@style{wxEL_DEFAULT_STYLE}
|
2008-03-28 16:19:12 +00:00
|
|
|
Default style: wxEL_ALLOW_NEW|wxEL_ALLOW_EDIT|wxEL_ALLOW_DELETE.
|
2008-03-08 13:52:38 +00:00
|
|
|
@endStyleTable
|
2008-03-08 14:43:31 +00:00
|
|
|
|
2008-09-01 14:18:32 +00:00
|
|
|
The control uses a wxListCtrl internally and emit its events.
|
|
|
|
|
2008-03-08 13:52:38 +00:00
|
|
|
@library{wxadv}
|
2008-03-28 16:19:12 +00:00
|
|
|
@category{ctrl}
|
2008-03-08 14:43:31 +00:00
|
|
|
|
2008-09-01 14:18:32 +00:00
|
|
|
@see wxListBox, wxListCtrl
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
|
|
|
class wxEditableListBox : public wxPanel
|
|
|
|
{
|
|
|
|
public:
|
2008-03-28 16:19:12 +00:00
|
|
|
/**
|
|
|
|
Default ctor.
|
|
|
|
*/
|
|
|
|
wxEditableListBox();
|
|
|
|
|
2008-03-08 13:52:38 +00:00
|
|
|
/**
|
|
|
|
Constructor, creating and showing a list box.
|
2008-03-20 13:45:17 +00:00
|
|
|
|
2008-03-08 14:43:31 +00:00
|
|
|
@param parent
|
2008-03-09 12:33:59 +00:00
|
|
|
Parent window. Must not be @NULL.
|
2008-03-08 14:43:31 +00:00
|
|
|
@param id
|
2008-03-09 12:33:59 +00:00
|
|
|
Window identifier. The value wxID_ANY indicates a default value.
|
2008-03-08 14:43:31 +00:00
|
|
|
@param label
|
2008-03-09 12:33:59 +00:00
|
|
|
The text shown just before the list control.
|
2008-03-08 14:43:31 +00:00
|
|
|
@param pos
|
2008-03-09 12:33:59 +00:00
|
|
|
Window position.
|
2009-04-21 11:21:36 +00:00
|
|
|
If ::wxDefaultPosition is specified then a default position is chosen.
|
2008-03-08 14:43:31 +00:00
|
|
|
@param size
|
2009-04-21 11:21:36 +00:00
|
|
|
Window size.
|
|
|
|
If ::wxDefaultSize is specified then the window is sized appropriately.
|
2008-03-08 14:43:31 +00:00
|
|
|
@param style
|
2008-03-09 12:33:59 +00:00
|
|
|
Window style. See wxEditableListBox.
|
2008-03-08 14:43:31 +00:00
|
|
|
@param name
|
2008-03-09 12:33:59 +00:00
|
|
|
Window name.
|
2008-03-20 13:45:17 +00:00
|
|
|
|
2008-03-09 12:33:59 +00:00
|
|
|
@see Create()
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
2008-03-08 14:43:31 +00:00
|
|
|
wxEditableListBox(wxWindow* parent, wxWindowID id,
|
|
|
|
const wxString& label,
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
|
|
|
long style = wxEL_DEFAULT_STYLE,
|
2008-11-08 15:17:16 +00:00
|
|
|
const wxString& name = wxEditableListBoxNameStr);
|
2008-03-08 13:52:38 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
Destructor, destroying the list box.
|
|
|
|
*/
|
2008-09-27 11:21:10 +00:00
|
|
|
virtual ~wxEditableListBox();
|
2008-03-08 13:52:38 +00:00
|
|
|
|
|
|
|
/**
|
2008-03-28 16:19:12 +00:00
|
|
|
Creates the editable listbox for two-step construction.
|
|
|
|
See wxEditableListBox() for further details.
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
2008-10-28 15:36:26 +00:00
|
|
|
bool Create(wxWindow* parent, wxWindowID id, const wxString& label,
|
2008-03-08 13:52:38 +00:00
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
|
|
|
long style = wxEL_DEFAULT_STYLE,
|
2008-10-28 15:36:26 +00:00
|
|
|
const wxString& name = wxEditableListBoxNameStr);
|
2008-03-08 13:52:38 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
Replaces current contents with given strings.
|
|
|
|
*/
|
|
|
|
void SetStrings(const wxArrayString& strings);
|
2008-03-28 16:19:12 +00:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
Returns in the given array the current contents of the control
|
|
|
|
(the array will be erased before control's contents are appended).
|
|
|
|
*/
|
2008-09-18 18:34:33 +00:00
|
|
|
void GetStrings(wxArrayString& strings) const;
|
2008-03-08 13:52:38 +00:00
|
|
|
};
|
2008-03-10 15:24:38 +00:00
|
|
|
|