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