#pragma interface "proplist.h"
#endif
+#if wxUSE_PROPSHEET
+
#include "wx/prop.h"
+#include "wx/panel.h"
#define wxPROP_BUTTON_CLOSE 1
#define wxPROP_BUTTON_OK 2
inline virtual wxButton *GetWindowCloseButton() const { return m_windowCloseButton; }
inline virtual wxButton *GetWindowCancelButton() const { return m_windowCancelButton; }
inline virtual wxButton *GetHelpButton() const { return m_windowHelpButton; }
-
+
bool OnClose(void);
public:
wxButton* m_confirmButton; // A tick, as in VB
wxButton* m_cancelButton; // A cross, as in VB
wxButton* m_editButton; // Invokes the custom validator, if any
+ wxSizer* m_middleSizer;
bool m_detailedEditing; // E.g. using listbox for choices
- static wxBitmap* sm_tickBitmap;
- static wxBitmap* sm_crossBitmap;
-
wxPanel* m_propertyWindow; // Panel that the controls will appear on
wxWindow* m_managedWindow; // Frame or dialog
-
+
wxButton* m_windowCloseButton; // Or OK
wxButton* m_windowCancelButton;
wxButton* m_windowHelpButton;
DECLARE_EVENT_TABLE()
+private:
+ virtual void ShowView(wxPropertySheet *propertySheet, wxWindow *window)
+ { wxPropertyView::ShowView(propertySheet, window); };
};
class WXDLLEXPORT wxPropertyTextEdit: public wxTextCtrl
{
- DECLARE_CLASS(wxPropertyTextEdit)
- public:
- wxPropertyTextEdit(wxPropertyListView *v, wxWindow *parent, const wxWindowID id,
- const wxString& value, const wxPoint& pos = wxDefaultPosition,
- const wxSize& size = wxDefaultSize, long style = 0, const wxString& name = "text");
- void OnSetFocus(void);
- void OnKillFocus(void);
+public:
+ wxPropertyTextEdit(wxPropertyListView *v = NULL,
+ wxWindow *parent = NULL,
+ const wxWindowID id = -1,
+ const wxString& value = wxEmptyString,
+ const wxPoint& pos = wxDefaultPosition,
+ const wxSize& size = wxDefaultSize,
+ long style = 0,
+ const wxString& name = _T("text"));
- wxPropertyListView* m_view;
+ void OnSetFocus();
+ void OnKillFocus();
+
+ wxPropertyListView* m_view;
+
+ DECLARE_CLASS(wxPropertyTextEdit)
};
#define wxPROP_ALLOW_TEXT_EDITING 1
/*
* The type of validator used for property lists (Visual Basic style)
*/
-
+
class WXDLLEXPORT wxPropertyListValidator: public wxPropertyValidator
{
DECLARE_DYNAMIC_CLASS(wxPropertyListValidator)
// Called when the property is double clicked. Extra functionality can be provided, such as
// cycling through possible values.
- inline virtual bool OnDoubleClick(
+ inline virtual bool OnDoubleClick(
wxProperty *WXUNUSED(property), wxPropertyListView *WXUNUSED(view), wxWindow *WXUNUSED(parentWindow) )
{ return TRUE; }
/*
* A default dialog box class to use.
*/
-
+
class WXDLLEXPORT wxPropertyListDialog: public wxDialog
{
- DECLARE_CLASS(wxPropertyListDialog)
- public:
- wxPropertyListDialog(wxPropertyListView *v, wxWindow *parent, const wxString& title,
- const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
- long style = wxDEFAULT_DIALOG_STYLE, const wxString& name = "dialogBox");
- bool OnClose(void);
- void OnDefaultAction(wxControl *item);
- void OnCancel(wxCommandEvent& event);
-
- // Extend event processing to search the view's event table
- virtual bool ProcessEvent(wxEvent& event);
-
- private:
- wxPropertyListView* m_view;
-
-DECLARE_EVENT_TABLE()
+public:
+ wxPropertyListDialog(wxPropertyListView *v = NULL,
+ wxWindow *parent = NULL,
+ const wxString& title = wxEmptyString,
+ const wxPoint& pos = wxDefaultPosition,
+ const wxSize& size = wxDefaultSize,
+ long style = wxDEFAULT_DIALOG_STYLE,
+ const wxString& name = _T("dialogBox"));
+
+ void OnCloseWindow(wxCloseEvent& event);
+ void OnDefaultAction(wxControl *item);
+ void OnCancel(wxCommandEvent& event);
+
+ // Extend event processing to search the view's event table
+ virtual bool ProcessEvent(wxEvent& event);
+
+private:
+ wxPropertyListView* m_view;
+
+ DECLARE_CLASS(wxPropertyListDialog)
+ DECLARE_EVENT_TABLE()
};
/*
* A default panel class to use.
*/
-
+
class WXDLLEXPORT wxPropertyListPanel: public wxPanel
{
- DECLARE_CLASS(wxPropertyListPanel)
- public:
- wxPropertyListPanel(wxPropertyListView *v, wxWindow *parent, const wxPoint& pos = wxDefaultPosition,
- const wxSize& size = wxDefaultSize,
- long style = 0, const wxString& name = "panel"):
- wxPanel(parent, -1, pos, size, style, name)
- {
- m_view = v;
- }
- ~wxPropertyListPanel();
- void OnDefaultAction(wxControl *item);
-
- inline void SetView(wxPropertyListView* v) { m_view = v; }
- inline wxPropertyListView* GetView() const { return m_view; }
-
- // Extend event processing to search the view's event table
- virtual bool ProcessEvent(wxEvent& event);
-
- // Call Layout()
- void OnSize(wxSizeEvent& event);
-
- private:
- wxPropertyListView* m_view;
-
-DECLARE_EVENT_TABLE()
+public:
+ wxPropertyListPanel(wxPropertyListView *v = NULL,
+ wxWindow *parent = NULL,
+ const wxPoint& pos = wxDefaultPosition,
+ const wxSize& size = wxDefaultSize,
+ long style = 0,
+ const wxString& name = _T("panel"))
+ : wxPanel(parent, -1, pos, size, style, name)
+ {
+ m_view = v;
+ }
+ ~wxPropertyListPanel();
+ void OnDefaultAction(wxControl *item);
+
+ inline void SetView(wxPropertyListView* v) { m_view = v; }
+ inline wxPropertyListView* GetView() const { return m_view; }
+
+ // Extend event processing to search the view's event table
+ virtual bool ProcessEvent(wxEvent& event);
+
+ // Call Layout()
+ void OnSize(wxSizeEvent& event);
+
+private:
+ wxPropertyListView* m_view;
+
+ DECLARE_EVENT_TABLE()
+ DECLARE_CLASS(wxPropertyListPanel)
};
/*
* A default frame class to use.
*/
-
+
class WXDLLEXPORT wxPropertyListFrame: public wxFrame
{
- DECLARE_CLASS(wxPropertyListFrame)
- public:
- wxPropertyListFrame(wxPropertyListView *v, wxFrame *parent, const wxString& title,
- const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
- long style = wxDEFAULT_FRAME_STYLE, const wxString& name = "frame"):
- wxFrame(parent, -1, title, pos, size, style, name)
- {
- m_view = v;
- m_propertyPanel = NULL;
- }
- bool OnClose(void);
-
- // Must call this to create panel and associate view
- virtual bool Initialize(void);
- virtual wxPropertyListPanel *OnCreatePanel(wxFrame *parent, wxPropertyListView *v);
- inline virtual wxPropertyListPanel *GetPropertyPanel(void) const { return m_propertyPanel; }
-
- private:
- wxPropertyListView* m_view;
- wxPropertyListPanel* m_propertyPanel;
+public:
+ wxPropertyListFrame(wxPropertyListView *v = NULL,
+ wxFrame *parent = NULL,
+ const wxString& title = wxEmptyString,
+ const wxPoint& pos = wxDefaultPosition,
+ const wxSize& size = wxDefaultSize,
+ long style = wxDEFAULT_FRAME_STYLE,
+ const wxString& name = _T("frame"))
+ : wxFrame(parent, -1, title, pos, size, style, name)
+ {
+ m_view = v;
+ m_propertyPanel = NULL;
+ }
+ void OnCloseWindow(wxCloseEvent& event);
+
+ // Must call this to create panel and associate view
+ virtual bool Initialize(void);
+ virtual wxPropertyListPanel *OnCreatePanel(wxFrame *parent, wxPropertyListView *v);
+ inline virtual wxPropertyListPanel *GetPropertyPanel(void) const { return m_propertyPanel; }
+ inline wxPropertyListView* GetView() const { return m_view; }
+
+private:
+ wxPropertyListView* m_view;
+ wxPropertyListPanel* m_propertyPanel;
+
+ DECLARE_EVENT_TABLE()
+ DECLARE_CLASS(wxPropertyListFrame)
};
/*
* Some default validators
*/
-
+
class WXDLLEXPORT wxRealListValidator: public wxPropertyListValidator
{
DECLARE_DYNAMIC_CLASS(wxRealListValidator)
protected:
wxStringList* m_strings;
};
-
+
class WXDLLEXPORT wxFilenameListValidator: public wxPropertyListValidator
{
DECLARE_DYNAMIC_CLASS(wxFilenameListValidator)
public:
- wxFilenameListValidator(wxString message = "Select a file", wxString wildcard = "*.*", long flags = 0);
+ wxFilenameListValidator(wxString message = "Select a file", wxString wildcard = wxALL_FILES_PATTERN, long flags = 0);
~wxFilenameListValidator(void);
protected:
wxString m_filenameWildCard;
wxString m_filenameMessage;
-
+
};
class WXDLLEXPORT wxColourListValidator: public wxPropertyListValidator
// Called when the property is double clicked.
bool OnDoubleClick(wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow);
- bool EditStringList(wxWindow *parent, wxStringList *stringList, const char *title = "String List Editor");
+ bool EditStringList(wxWindow *parent, wxStringList *stringList, const wxChar *title = wxT("String List Editor"));
// Called when the edit (...) button is pressed.
void OnEdit(wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow);
};
+#endif
+ // wxUSE_PROPSHEET
+
#endif
// _WX_PROPLIST_H_