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__
|
|
|
|
|
|
|
|
#ifdef __GNUG__
|
|
|
|
#pragma interface "editlbox.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "wx/panel.h"
|
|
|
|
|
2001-11-26 14:58:06 -05:00
|
|
|
#ifdef GIZMOISDLL
|
|
|
|
#define GIZMODLLEXPORT WXDLLEXPORT
|
|
|
|
#else
|
|
|
|
#define GIZMODLLEXPORT
|
|
|
|
#endif
|
|
|
|
|
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
|
|
|
|
|
2001-11-26 14:58:06 -05:00
|
|
|
class GIZMODLLEXPORT wxEditableListBox : public wxPanel
|
2001-05-05 14:05:12 -04:00
|
|
|
{
|
|
|
|
DECLARE_CLASS(wxEditableListBox);
|
|
|
|
|
|
|
|
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);
|
|
|
|
|
|
|
|
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
|