X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e3a43801df2f05c057892481df9d3cfe30fd8800..22e90769f8da73d398bd7da83f185263a292972f:/include/wx/propform.h diff --git a/include/wx/propform.h b/include/wx/propform.h index c88c4bdbd5..120b0a1bf2 100644 --- a/include/wx/propform.h +++ b/include/wx/propform.h @@ -26,7 +26,7 @@ #define wxID_PROP_UPDATE 3101 // Mediates between a physical panel and the property sheet -class wxPropertyFormView: public wxPropertyView +class WXDLLEXPORT wxPropertyFormView: public wxPropertyView { DECLARE_DYNAMIC_CLASS(wxPropertyFormView) public: @@ -61,12 +61,16 @@ class wxPropertyFormView: public wxPropertyView void OnUpdate(wxCommandEvent& event); void OnRevert(wxCommandEvent& event); - virtual bool OnClose(void); + virtual bool OnClose(); virtual void OnDoubleClick(wxControl *item); - // TODO: does OnCommand still get called...??? + // TODO: does OnCommand still get called...??? No, + // make ProcessEvent do it. virtual void OnCommand(wxWindow& win, wxCommandEvent& event); + // Extend event processing to process OnCommand + virtual bool ProcessEvent(wxEvent& event); + inline virtual void AssociatePanel(wxWindow *win) { m_propertyWindow = win; } inline virtual wxWindow *GetPanel(void) const { return m_propertyWindow; } @@ -85,7 +89,7 @@ public: wxWindow* 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; @@ -93,7 +97,7 @@ public: DECLARE_EVENT_TABLE() }; - + /* * The type of validator used for forms (wxForm style but using an existing panel * or dialog box). @@ -109,17 +113,17 @@ DECLARE_EVENT_TABLE() * assocated with a window. It's that kinda thing. */ -class wxPropertyFormValidator: public wxPropertyValidator +class WXDLLEXPORT wxPropertyFormValidator: public wxPropertyValidator { DECLARE_DYNAMIC_CLASS(wxPropertyFormValidator) protected: public: wxPropertyFormValidator(long flags = 0): wxPropertyValidator(flags) { } ~wxPropertyFormValidator(void) {} - + // Called to check value is OK (e.g. when OK is pressed) // Return FALSE if value didn't check out; signal to restore old value. - virtual bool OnCheckValue( wxProperty *WXUNUSED(property), wxPropertyFormView *WXUNUSED(view), + virtual bool OnCheckValue( wxProperty *WXUNUSED(property), wxPropertyFormView *WXUNUSED(view), wxWindow *WXUNUSED(parentWindow) ) { return TRUE; } // Does the transferance from the property editing area to the property itself. @@ -129,21 +133,28 @@ class wxPropertyFormValidator: public wxPropertyValidator // Called by the view to transfer the property to the window. virtual bool OnDisplayValue(wxProperty *property, wxPropertyFormView *view, wxWindow *parentWindow) = 0; - virtual void OnDoubleClick( wxProperty *WXUNUSED(property), wxPropertyFormView *WXUNUSED(view), - wxWindow *WXUNUSED(parentWindow) ) { } - virtual void OnSetFocus( wxProperty *WXUNUSED(property), wxPropertyFormView *WXUNUSED(view), + virtual void OnDoubleClick( wxProperty *WXUNUSED(property), wxPropertyFormView *WXUNUSED(view), + wxWindow *WXUNUSED(parentWindow) ) { } + virtual void OnSetFocus( wxProperty *WXUNUSED(property), wxPropertyFormView *WXUNUSED(view), wxWindow *WXUNUSED(parentWindow) ) { } - virtual void OnKillFocus( wxProperty *WXUNUSED(property), wxPropertyFormView *WXUNUSED(view), + virtual void OnKillFocus( wxProperty *WXUNUSED(property), wxPropertyFormView *WXUNUSED(view), wxWindow *WXUNUSED(parentWindow) ) { } - virtual void OnCommand( wxProperty *WXUNUSED(property), wxPropertyFormView *WXUNUSED(view), + virtual void OnCommand( wxProperty *WXUNUSED(property), wxPropertyFormView *WXUNUSED(view), wxWindow *WXUNUSED(parentWindow), wxCommandEvent& WXUNUSED(event) ) {} +private: +// Virtual function hiding suppression +#if WXWIN_COMPATIBILITY_2 + virtual void OnCommand(wxWindow& win, + wxCommandEvent& event) + { wxEvtHandler::OnCommand(win, event); } +#endif }; /* * Some default validators */ - -class wxRealFormValidator: public wxPropertyFormValidator + +class WXDLLEXPORT wxRealFormValidator: public wxPropertyFormValidator { DECLARE_DYNAMIC_CLASS(wxRealFormValidator) public: @@ -164,7 +175,7 @@ class wxRealFormValidator: public wxPropertyFormValidator float m_realMax; }; -class wxIntegerFormValidator: public wxPropertyFormValidator +class WXDLLEXPORT wxIntegerFormValidator: public wxPropertyFormValidator { DECLARE_DYNAMIC_CLASS(wxIntegerFormValidator) public: @@ -184,7 +195,7 @@ class wxIntegerFormValidator: public wxPropertyFormValidator long m_integerMax; }; -class wxBoolFormValidator: public wxPropertyFormValidator +class WXDLLEXPORT wxBoolFormValidator: public wxPropertyFormValidator { DECLARE_DYNAMIC_CLASS(wxBoolFormValidator) protected: @@ -199,7 +210,7 @@ class wxBoolFormValidator: public wxPropertyFormValidator bool OnDisplayValue(wxProperty *property, wxPropertyFormView *view, wxWindow *parentWindow); }; -class wxStringFormValidator: public wxPropertyFormValidator +class WXDLLEXPORT wxStringFormValidator: public wxPropertyFormValidator { DECLARE_DYNAMIC_CLASS(wxStringFormValidator) public: @@ -222,15 +233,16 @@ class wxStringFormValidator: public wxPropertyFormValidator /* * A default dialog box class to use. */ - -class wxPropertyFormDialog: public wxDialog + +class WXDLLEXPORT wxPropertyFormDialog: public wxDialog { DECLARE_CLASS(wxPropertyFormDialog) public: wxPropertyFormDialog(wxPropertyFormView *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 OnCloseWindow(wxCloseEvent& event); void OnDefaultAction(wxControl *item); void OnCommand(wxWindow& win, wxCommandEvent& event); @@ -239,13 +251,15 @@ class wxPropertyFormDialog: public wxDialog private: wxPropertyFormView* m_view; + +DECLARE_EVENT_TABLE() }; /* * A default panel class to use. */ - -class wxPropertyFormPanel: public wxPanel + +class WXDLLEXPORT wxPropertyFormPanel: public wxPanel { DECLARE_CLASS(wxPropertyFormPanel) public: @@ -268,20 +282,20 @@ class wxPropertyFormPanel: public wxPanel /* * A default frame class to use. */ - -class wxPropertyFormFrame: public wxFrame + +class WXDLLEXPORT wxPropertyFormFrame: public wxFrame { DECLARE_CLASS(wxPropertyFormFrame) public: wxPropertyFormFrame(wxPropertyFormView *v, wxFrame *parent, const wxString& title, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, - long style = wxDEFAULT_FRAME, const wxString& name = "frame"): + 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); + void OnCloseWindow(wxCloseEvent& event); // Must call this to create panel and associate view virtual bool Initialize(void); @@ -291,6 +305,8 @@ class wxPropertyFormFrame: public wxFrame private: wxPropertyFormView* m_view; wxPanel* m_propertyPanel; + +DECLARE_EVENT_TABLE() }; #endif