diff --git a/include/wx/propform.h b/include/wx/propform.h index 120b0a1bf2..5a0a28631d 100644 --- a/include/wx/propform.h +++ b/include/wx/propform.h @@ -236,23 +236,27 @@ class WXDLLEXPORT wxStringFormValidator: public wxPropertyFormValidator 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"); +public: + wxPropertyFormDialog(wxPropertyFormView *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 OnCommand(wxWindow& win, wxCommandEvent& event); + void OnCloseWindow(wxCloseEvent& event); + void OnDefaultAction(wxControl *item); + void OnCommand(wxWindow& win, wxCommandEvent& event); - // Extend event processing to search the view's event table - virtual bool ProcessEvent(wxEvent& event); + // Extend event processing to search the view's event table + virtual bool ProcessEvent(wxEvent& event); - private: - wxPropertyFormView* m_view; +private: + wxPropertyFormView* m_view; -DECLARE_EVENT_TABLE() + DECLARE_EVENT_TABLE() + DECLARE_CLASS(wxPropertyFormDialog) }; /* @@ -261,22 +265,27 @@ DECLARE_EVENT_TABLE() class WXDLLEXPORT wxPropertyFormPanel: public wxPanel { - DECLARE_CLASS(wxPropertyFormPanel) - public: - wxPropertyFormPanel(wxPropertyFormView *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; - } - void OnDefaultAction(wxControl *item); - void OnCommand(wxWindow& win, wxCommandEvent& event); +public: + wxPropertyFormPanel(wxPropertyFormView *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; + } + void OnDefaultAction(wxControl *item); + void OnCommand(wxWindow& win, wxCommandEvent& event); - // Extend event processing to search the view's event table - virtual bool ProcessEvent(wxEvent& event); + // Extend event processing to search the view's event table + virtual bool ProcessEvent(wxEvent& event); - private: - wxPropertyFormView* m_view; +private: + wxPropertyFormView* m_view; + + DECLARE_CLASS(wxPropertyFormPanel) }; /* @@ -285,28 +294,32 @@ class WXDLLEXPORT wxPropertyFormPanel: public wxPanel 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_STYLE, const wxString& name = "frame"): - wxFrame(parent, -1, title, pos, size, style, name) - { - m_view = v; - m_propertyPanel = NULL; - } - void OnCloseWindow(wxCloseEvent& event); +public: + wxPropertyFormFrame(wxPropertyFormView *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 wxPanel *OnCreatePanel(wxFrame *parent, wxPropertyFormView *v); - inline virtual wxPanel *GetPropertyPanel(void) const { return m_propertyPanel; } + // Must call this to create panel and associate view + virtual bool Initialize(void); + virtual wxPanel *OnCreatePanel(wxFrame *parent, wxPropertyFormView *v); + inline virtual wxPanel *GetPropertyPanel(void) const { return m_propertyPanel; } - private: - wxPropertyFormView* m_view; - wxPanel* m_propertyPanel; +private: + wxPropertyFormView* m_view; + wxPanel* m_propertyPanel; -DECLARE_EVENT_TABLE() + DECLARE_EVENT_TABLE() + DECLARE_CLASS(wxPropertyFormFrame) }; #endif diff --git a/include/wx/proplist.h b/include/wx/proplist.h index de72221bbd..ea93c33eb0 100644 --- a/include/wx/proplist.h +++ b/include/wx/proplist.h @@ -191,15 +191,22 @@ private: 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 @@ -272,22 +279,27 @@ class WXDLLEXPORT wxPropertyListValidator: public wxPropertyValidator 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"); - void OnCloseWindow(wxCloseEvent& event); - void OnDefaultAction(wxControl *item); - void OnCancel(wxCommandEvent& event); +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")); - // Extend event processing to search the view's event table - virtual bool ProcessEvent(wxEvent& event); + void OnCloseWindow(wxCloseEvent& event); + void OnDefaultAction(wxControl *item); + void OnCancel(wxCommandEvent& event); - private: - wxPropertyListView* m_view; + // Extend event processing to search the view's event table + virtual bool ProcessEvent(wxEvent& event); -DECLARE_EVENT_TABLE() +private: + wxPropertyListView* m_view; + + DECLARE_CLASS(wxPropertyListDialog) + DECLARE_EVENT_TABLE() }; /* @@ -296,31 +308,34 @@ DECLARE_EVENT_TABLE() 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); +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; } + 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); + // Extend event processing to search the view's event table + virtual bool ProcessEvent(wxEvent& event); - // Call Layout() - void OnSize(wxSizeEvent& event); + // Call Layout() + void OnSize(wxSizeEvent& event); - private: - wxPropertyListView* m_view; +private: + wxPropertyListView* m_view; -DECLARE_EVENT_TABLE() + DECLARE_EVENT_TABLE() + DECLARE_CLASS(wxPropertyListPanel) }; /* @@ -329,29 +344,33 @@ DECLARE_EVENT_TABLE() 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; - } - void OnCloseWindow(wxCloseEvent& event); +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; } + // 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; +private: + wxPropertyListView* m_view; + wxPropertyListPanel* m_propertyPanel; -DECLARE_EVENT_TABLE() + DECLARE_EVENT_TABLE() + DECLARE_CLASS(wxPropertyListFrame) }; /* diff --git a/samples/controls/controls.cpp b/samples/controls/controls.cpp index c4e0adbb3e..919ec24018 100644 --- a/samples/controls/controls.cpp +++ b/samples/controls/controls.cpp @@ -810,7 +810,7 @@ void MyPanel::OnPageChanging( wxNotebookEvent &event ) "page change from taking place - if you select\n" "[No] the current page will stay the third one\n", "Control sample", - wxICON_QUESTION | wxYES_NO) != wxYES ) + wxICON_QUESTION | wxYES_NO, this) != wxYES ) { event.Veto(); diff --git a/samples/dnd/dnd.cpp b/samples/dnd/dnd.cpp index 6ba0420bb3..f581776844 100644 --- a/samples/dnd/dnd.cpp +++ b/samples/dnd/dnd.cpp @@ -1071,6 +1071,8 @@ void DnDFrame::OnLeftDown(wxMouseEvent &WXUNUSED(event) ) ,wxCURSOR_PENCIL, // for copy wxCURSOR_SPRAYCAN, // for move wxCURSOR_QUESTION_ARROW // for nothing +#elif defined(__WXGTK__) + ,wxICON(mondrian) #endif ); @@ -1511,19 +1513,19 @@ DnDShapeFrame::DnDShapeFrame(wxFrame *parent) SetDropTarget(new DnDShapeDropTarget(this)); m_shape = NULL; - + SetBackgroundColour(*wxWHITE); } DnDShapeFrame::~DnDShapeFrame() { - if (m_shape) + if (m_shape) delete m_shape; } void DnDShapeFrame::SetShape(DnDShape *shape) { - if (m_shape) + if (m_shape) delete m_shape; m_shape = shape; Refresh(); diff --git a/samples/listctrl/listtest.cpp b/samples/listctrl/listtest.cpp index 1f01d46aa4..755149e6a9 100644 --- a/samples/listctrl/listtest.cpp +++ b/samples/listctrl/listtest.cpp @@ -588,6 +588,8 @@ void MyListCtrl::OnListKeyDown(wxListEvent& event) void MyListCtrl::OnChar(wxKeyEvent& event) { wxLogMessage(_T("Got char event.")); + + event.Skip(); } void MyListCtrl::LogEvent(const wxListEvent& event, const wxChar *eventName) diff --git a/samples/notebook/notebook.cpp b/samples/notebook/notebook.cpp index 0892b51d68..f61101c1f5 100644 --- a/samples/notebook/notebook.cpp +++ b/samples/notebook/notebook.cpp @@ -245,6 +245,9 @@ void MyFrame::OnDeletePage(wxCommandEvent& WXUNUSED(event)) { if (m_notebook->GetPageCount() > 0) m_notebook->DeletePage( m_notebook->GetPageCount()-1 ); + + // VZ: this crashes wxGTK + //m_notebook->RemovePage( m_notebook->GetPageCount()-1 ); } void MyFrame::OnNextPage(wxCommandEvent& WXUNUSED(event)) diff --git a/src/generic/propform.cpp b/src/generic/propform.cpp index e8f651083c..1b9e7089ef 100644 --- a/src/generic/propform.cpp +++ b/src/generic/propform.cpp @@ -284,7 +284,7 @@ void wxPropertyFormView::OnDoubleClick(wxControl *item) * Property form dialog box */ -IMPLEMENT_CLASS(wxPropertyFormDialog, wxDialog) +IMPLEMENT_DYNAMIC_CLASS(wxPropertyFormDialog, wxDialog) BEGIN_EVENT_TABLE(wxPropertyFormDialog, wxDialog) EVT_CLOSE(wxPropertyFormDialog::OnCloseWindow) @@ -337,7 +337,7 @@ bool wxPropertyFormDialog::ProcessEvent(wxEvent& event) * Property form panel */ -IMPLEMENT_CLASS(wxPropertyFormPanel, wxPanel) +IMPLEMENT_DYNAMIC_CLASS(wxPropertyFormPanel, wxPanel) void wxPropertyFormPanel::OnDefaultAction(wxControl *item) { @@ -362,7 +362,7 @@ bool wxPropertyFormPanel::ProcessEvent(wxEvent& event) * Property frame */ -IMPLEMENT_CLASS(wxPropertyFormFrame, wxFrame) +IMPLEMENT_DYNAMIC_CLASS(wxPropertyFormFrame, wxFrame) BEGIN_EVENT_TABLE(wxPropertyFormFrame, wxFrame) EVT_CLOSE(wxPropertyFormFrame::OnCloseWindow) diff --git a/src/generic/proplist.cpp b/src/generic/proplist.cpp index 60e51cadd6..d5f5dcd9c4 100644 --- a/src/generic/proplist.cpp +++ b/src/generic/proplist.cpp @@ -72,7 +72,7 @@ static wxBitmap *GetCrossBitmap(); // Property text edit control // ---------------------------------------------------------------------------- -IMPLEMENT_CLASS(wxPropertyTextEdit, wxTextCtrl) +IMPLEMENT_DYNAMIC_CLASS(wxPropertyTextEdit, wxTextCtrl) wxPropertyTextEdit::wxPropertyTextEdit(wxPropertyListView *v, wxWindow *parent, const wxWindowID id, const wxString& value, @@ -675,7 +675,7 @@ void wxPropertyListView::OnText(wxCommandEvent& event) // Property dialog box // ---------------------------------------------------------------------------- -IMPLEMENT_CLASS(wxPropertyListDialog, wxDialog) +IMPLEMENT_DYNAMIC_CLASS(wxPropertyListDialog, wxDialog) BEGIN_EVENT_TABLE(wxPropertyListDialog, wxDialog) EVT_BUTTON(wxID_CANCEL, wxPropertyListDialog::OnCancel) @@ -735,7 +735,7 @@ bool wxPropertyListDialog::ProcessEvent(wxEvent& event) // Property panel // ---------------------------------------------------------------------------- -IMPLEMENT_CLASS(wxPropertyListPanel, wxPanel) +IMPLEMENT_DYNAMIC_CLASS(wxPropertyListPanel, wxPanel) BEGIN_EVENT_TABLE(wxPropertyListPanel, wxPanel) EVT_SIZE(wxPropertyListPanel::OnSize) @@ -771,7 +771,7 @@ void wxPropertyListPanel::OnSize(wxSizeEvent& WXUNUSED(event)) // Property frame // ---------------------------------------------------------------------------- -IMPLEMENT_CLASS(wxPropertyListFrame, wxFrame) +IMPLEMENT_DYNAMIC_CLASS(wxPropertyListFrame, wxFrame) BEGIN_EVENT_TABLE(wxPropertyListFrame, wxFrame) EVT_CLOSE(wxPropertyListFrame::OnCloseWindow)