]> git.saurik.com Git - wxWidgets.git/blame - contrib/include/wx/gizmos/editlbox.h
Update to Bakefile 0.1.6
[wxWidgets.git] / contrib / include / wx / gizmos / editlbox.h
CommitLineData
f55d21eb
VS
1/////////////////////////////////////////////////////////////////////////////
2// Name: 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
ab7ce33c 14#if defined(__GNUG__) && !defined(__APPLE__)
a2d49353 15 #pragma interface "editlbox.h"
f55d21eb
VS
16#endif
17
18#include "wx/panel.h"
936a13b5 19#include "wx/gizmos/gizmos.h"
f55d21eb
VS
20
21class WXDLLEXPORT wxBitmapButton;
22class WXDLLEXPORT wxListCtrl;
23class WXDLLEXPORT wxListEvent;
086ab766 24
6187ec8f
RD
25#define wxEL_ALLOW_NEW 0x0100
26#define wxEL_ALLOW_EDIT 0x0200
27#define wxEL_ALLOW_DELETE 0x0400
28
f55d21eb
VS
29// This class provides a composite control that lets the
30// user easily enter list of strings
31
936a13b5 32class WXDLLIMPEXP_GIZMOS wxEditableListBox : public wxPanel
f55d21eb 33{
a2d49353 34 DECLARE_CLASS(wxEditableListBox);
f55d21eb
VS
35
36public:
37 wxEditableListBox(wxWindow *parent, wxWindowID id,
38 const wxString& label,
39 const wxPoint& pos = wxDefaultPosition,
00b2a5df 40 const wxSize& size = wxDefaultSize,
6187ec8f 41 long style = wxEL_ALLOW_NEW | wxEL_ALLOW_EDIT | wxEL_ALLOW_DELETE,
00b2a5df 42 const wxString& name = wxT("editableListBox"));
f55d21eb
VS
43
44 void SetStrings(const wxArrayString& strings);
45 void GetStrings(wxArrayString& strings);
46
366d7bd6
RD
47 wxListCtrl* GetListCtrl() { return m_listCtrl; }
48 wxBitmapButton* GetDelButton() { return m_bDel; }
49 wxBitmapButton* GetNewButton() { return m_bNew; }
50 wxBitmapButton* GetUpButton() { return m_bUp; }
51 wxBitmapButton* GetDownButton() { return m_bDown; }
52 wxBitmapButton* GetEditButton() { return m_bEdit; }
53
f55d21eb
VS
54protected:
55 wxBitmapButton *m_bDel, *m_bNew, *m_bUp, *m_bDown, *m_bEdit;
56 wxListCtrl *m_listCtrl;
57 int m_selection;
6187ec8f 58 long m_style;
f55d21eb
VS
59
60 void OnItemSelected(wxListEvent& event);
61 void OnEndLabelEdit(wxListEvent& event);
62 void OnNewItem(wxCommandEvent& event);
63 void OnDelItem(wxCommandEvent& event);
64 void OnEditItem(wxCommandEvent& event);
65 void OnUpItem(wxCommandEvent& event);
66 void OnDownItem(wxCommandEvent& event);
67
68 DECLARE_EVENT_TABLE()
69};
70
71#endif