]> git.saurik.com Git - wxWidgets.git/blame - include/wx/editlbox.h
assert that wxRound() argument is in the supported range
[wxWidgets.git] / include / wx / editlbox.h
CommitLineData
806ad819
VZ
1/////////////////////////////////////////////////////////////////////////////
2// Name: wx/editlbox.h
3// Purpose: ListBox with editable items
4// Author: Vaclav Slavik
5// RCS-ID: $Id$
6// Copyright: (c) Vaclav Slavik
7// Licence: wxWindows licence
8/////////////////////////////////////////////////////////////////////////////
9
10
11#ifndef __WX_EDITLBOX_H__
12#define __WX_EDITLBOX_H__
13
23575150
RR
14#include "wx/defs.h"
15
16#if wxUSE_EDITABLELISTBOX
17
806ad819
VZ
18#include "wx/panel.h"
19
20class WXDLLEXPORT wxBitmapButton;
21class WXDLLEXPORT wxListCtrl;
22class WXDLLEXPORT wxListEvent;
23
24#define wxEL_ALLOW_NEW 0x0100
25#define wxEL_ALLOW_EDIT 0x0200
26#define wxEL_ALLOW_DELETE 0x0400
27#define wxEL_NO_REORDER 0x0800
28
29// This class provides a composite control that lets the
30// user easily enter list of strings
31
32class WXDLLIMPEXP_ADV wxEditableListBox : public wxPanel
33{
34public:
35 wxEditableListBox(wxWindow *parent, wxWindowID id,
36 const wxString& label,
37 const wxPoint& pos = wxDefaultPosition,
38 const wxSize& size = wxDefaultSize,
39 long style = wxEL_ALLOW_NEW | wxEL_ALLOW_EDIT | wxEL_ALLOW_DELETE,
40 const wxString& name = wxT("editableListBox"));
41
42 void SetStrings(const wxArrayString& strings);
43 void GetStrings(wxArrayString& strings) const;
44
45 wxListCtrl* GetListCtrl() { return m_listCtrl; }
46 wxBitmapButton* GetDelButton() { return m_bDel; }
47 wxBitmapButton* GetNewButton() { return m_bNew; }
48 wxBitmapButton* GetUpButton() { return m_bUp; }
49 wxBitmapButton* GetDownButton() { return m_bDown; }
50 wxBitmapButton* GetEditButton() { return m_bEdit; }
51
52protected:
53 wxBitmapButton *m_bDel, *m_bNew, *m_bUp, *m_bDown, *m_bEdit;
54 wxListCtrl *m_listCtrl;
55 int m_selection;
56 long m_style;
57
58 void OnItemSelected(wxListEvent& event);
59 void OnEndLabelEdit(wxListEvent& event);
60 void OnNewItem(wxCommandEvent& event);
61 void OnDelItem(wxCommandEvent& event);
62 void OnEditItem(wxCommandEvent& event);
63 void OnUpItem(wxCommandEvent& event);
64 void OnDownItem(wxCommandEvent& event);
65
66 DECLARE_CLASS(wxEditableListBox)
67 DECLARE_EVENT_TABLE()
68};
69
23575150
RR
70#endif // wxUSE_EDITABLELISTBOX
71
806ad819 72#endif // __WX_EDITLBOX_H__