]> git.saurik.com Git - wxWidgets.git/blobdiff - contrib/include/wx/gizmos/editlbox.h
added new gizmo: wxEditableListBox
[wxWidgets.git] / contrib / include / wx / gizmos / editlbox.h
diff --git a/contrib/include/wx/gizmos/editlbox.h b/contrib/include/wx/gizmos/editlbox.h
new file mode 100644 (file)
index 0000000..256c505
--- /dev/null
@@ -0,0 +1,58 @@
+/////////////////////////////////////////////////////////////////////////////
+// Name:        editlbox.h
+// Purpose:     ListBox with editable items
+// Author:      Vaclav Slavik
+// RCS-ID:      $Id$
+// Copyright:   (c) Vaclav Slavik
+// Licence:     wxWindows licence
+/////////////////////////////////////////////////////////////////////////////
+
+
+#ifndef __WX_EDITLBOX_H__
+#define __WX_EDITLBOX_H__
+
+#ifdef __GNUG__
+       #pragma interface "editlbox.h"
+#endif
+
+#include "wx/panel.h"
+
+
+class WXDLLEXPORT wxBitmapButton;
+class WXDLLEXPORT wxListCtrl;
+class WXDLLEXPORT wxListEvent;
+               
+// This class provides a composite control that lets the
+// user easily enter list of strings
+
+class WXDLLEXPORT wxEditableListBox : public wxPanel
+{
+       DECLARE_CLASS(wxEditableListBox);
+
+public:
+    wxEditableListBox(wxWindow *parent, wxWindowID id,
+                      const wxString& label,
+                      const wxPoint& pos = wxDefaultPosition,
+                      const wxSize& size = wxDefaultSize);
+
+    void SetStrings(const wxArrayString& strings);
+    void GetStrings(wxArrayString& strings);
+
+protected:
+    wxBitmapButton *m_bDel, *m_bNew, *m_bUp, *m_bDown, *m_bEdit;
+    wxListCtrl *m_listCtrl;
+    int m_selection;
+    bool m_edittingNew;
+
+    void OnItemSelected(wxListEvent& event);
+    void OnEndLabelEdit(wxListEvent& event);
+    void OnNewItem(wxCommandEvent& event);
+    void OnDelItem(wxCommandEvent& event);
+    void OnEditItem(wxCommandEvent& event);
+    void OnUpItem(wxCommandEvent& event);
+    void OnDownItem(wxCommandEvent& event);
+
+    DECLARE_EVENT_TABLE()
+};
+
+#endif