2001-05-05 14:05:12 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// 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__
|
|
|
|
|
|
|
|
#include "wx/panel.h"
|
2003-07-19 08:03:47 -04:00
|
|
|
#include "wx/gizmos/gizmos.h"
|
2001-05-05 14:05:12 -04:00
|
|
|
|
|
|
|
class WXDLLEXPORT wxBitmapButton;
|
|
|
|
class WXDLLEXPORT wxListCtrl;
|
|
|
|
class WXDLLEXPORT wxListEvent;
|
2001-11-26 14:58:06 -05:00
|
|
|
|
2002-03-08 16:10:04 -05:00
|
|
|
#define wxEL_ALLOW_NEW 0x0100
|
|
|
|
#define wxEL_ALLOW_EDIT 0x0200
|
|
|
|
#define wxEL_ALLOW_DELETE 0x0400
|
|
|
|
|
2001-05-05 14:05:12 -04:00
|
|
|
// This class provides a composite control that lets the
|
|
|
|
// user easily enter list of strings
|
|
|
|
|
2003-07-19 08:03:47 -04:00
|
|
|
class WXDLLIMPEXP_GIZMOS wxEditableListBox : public wxPanel
|
2001-05-05 14:05:12 -04:00
|
|
|
{
|
2005-02-09 09:14:21 -05:00
|
|
|
DECLARE_CLASS(wxEditableListBox)
|
2001-05-05 14:05:12 -04:00
|
|
|
|
|
|
|
public:
|
|
|
|
wxEditableListBox(wxWindow *parent, wxWindowID id,
|
|
|
|
const wxString& label,
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
2001-05-06 18:22:30 -04:00
|
|
|
const wxSize& size = wxDefaultSize,
|
2002-03-08 16:10:04 -05:00
|
|
|
long style = wxEL_ALLOW_NEW | wxEL_ALLOW_EDIT | wxEL_ALLOW_DELETE,
|
2001-05-06 18:22:30 -04:00
|
|
|
const wxString& name = wxT("editableListBox"));
|
2001-05-05 14:05:12 -04:00
|
|
|
|
|
|
|
void SetStrings(const wxArrayString& strings);
|
|
|
|
void GetStrings(wxArrayString& strings);
|
|
|
|
|
2002-06-24 17:51:06 -04:00
|
|
|
wxListCtrl* GetListCtrl() { return m_listCtrl; }
|
|
|
|
wxBitmapButton* GetDelButton() { return m_bDel; }
|
|
|
|
wxBitmapButton* GetNewButton() { return m_bNew; }
|
|
|
|
wxBitmapButton* GetUpButton() { return m_bUp; }
|
|
|
|
wxBitmapButton* GetDownButton() { return m_bDown; }
|
|
|
|
wxBitmapButton* GetEditButton() { return m_bEdit; }
|
|
|
|
|
2001-05-05 14:05:12 -04:00
|
|
|
protected:
|
|
|
|
wxBitmapButton *m_bDel, *m_bNew, *m_bUp, *m_bDown, *m_bEdit;
|
|
|
|
wxListCtrl *m_listCtrl;
|
|
|
|
int m_selection;
|
2002-03-08 16:10:04 -05:00
|
|
|
long m_style;
|
2001-05-05 14:05:12 -04:00
|
|
|
|
|
|
|
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
|