attempts to fix the proplist crash - fruitless

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_2_BRANCH@7294 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2000-04-27 18:03:34 +00:00
parent 071bb1283a
commit b12ce2ff6d
8 changed files with 157 additions and 118 deletions

View File

@@ -236,23 +236,27 @@ class WXDLLEXPORT wxStringFormValidator: public wxPropertyFormValidator
class WXDLLEXPORT wxPropertyFormDialog: public wxDialog class WXDLLEXPORT wxPropertyFormDialog: public wxDialog
{ {
DECLARE_CLASS(wxPropertyFormDialog) public:
public: wxPropertyFormDialog(wxPropertyFormView *v = NULL,
wxPropertyFormDialog(wxPropertyFormView *v, wxWindow *parent, const wxString& title, wxWindow *parent = NULL,
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, const wxString& title = wxEmptyString,
long style = wxDEFAULT_DIALOG_STYLE, const wxString& name = "dialogBox"); const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxDEFAULT_DIALOG_STYLE,
const wxString& name = _T("dialogBox"));
void OnCloseWindow(wxCloseEvent& event); void OnCloseWindow(wxCloseEvent& event);
void OnDefaultAction(wxControl *item); void OnDefaultAction(wxControl *item);
void OnCommand(wxWindow& win, wxCommandEvent& event); void OnCommand(wxWindow& win, wxCommandEvent& event);
// Extend event processing to search the view's event table // Extend event processing to search the view's event table
virtual bool ProcessEvent(wxEvent& event); virtual bool ProcessEvent(wxEvent& event);
private: private:
wxPropertyFormView* m_view; wxPropertyFormView* m_view;
DECLARE_EVENT_TABLE() DECLARE_EVENT_TABLE()
DECLARE_CLASS(wxPropertyFormDialog)
}; };
/* /*
@@ -261,22 +265,27 @@ DECLARE_EVENT_TABLE()
class WXDLLEXPORT wxPropertyFormPanel: public wxPanel class WXDLLEXPORT wxPropertyFormPanel: public wxPanel
{ {
DECLARE_CLASS(wxPropertyFormPanel) public:
public: wxPropertyFormPanel(wxPropertyFormView *v = NULL,
wxPropertyFormPanel(wxPropertyFormView *v, wxWindow *parent, const wxPoint& pos = wxDefaultPosition, wxWindow *parent = NULL,
const wxSize& size = wxDefaultSize, long style = 0, const wxString& name = "panel"): const wxPoint& pos = wxDefaultPosition,
wxPanel(parent, -1, pos, size, style, name) const wxSize& size = wxDefaultSize,
{ long style = 0,
m_view = v; const wxString& name = _T("panel"))
} : wxPanel(parent, -1, pos, size, style, name)
void OnDefaultAction(wxControl *item); {
void OnCommand(wxWindow& win, wxCommandEvent& event); m_view = v;
}
void OnDefaultAction(wxControl *item);
void OnCommand(wxWindow& win, wxCommandEvent& event);
// Extend event processing to search the view's event table // Extend event processing to search the view's event table
virtual bool ProcessEvent(wxEvent& event); virtual bool ProcessEvent(wxEvent& event);
private: private:
wxPropertyFormView* m_view; wxPropertyFormView* m_view;
DECLARE_CLASS(wxPropertyFormPanel)
}; };
/* /*
@@ -285,28 +294,32 @@ class WXDLLEXPORT wxPropertyFormPanel: public wxPanel
class WXDLLEXPORT wxPropertyFormFrame: public wxFrame class WXDLLEXPORT wxPropertyFormFrame: public wxFrame
{ {
DECLARE_CLASS(wxPropertyFormFrame) public:
public: wxPropertyFormFrame(wxPropertyFormView *v = NULL,
wxPropertyFormFrame(wxPropertyFormView *v, wxFrame *parent, const wxString& title, wxFrame *parent = NULL,
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, const wxString& title = wxEmptyString,
long style = wxDEFAULT_FRAME_STYLE, const wxString& name = "frame"): const wxPoint& pos = wxDefaultPosition,
wxFrame(parent, -1, title, pos, size, style, name) const wxSize& size = wxDefaultSize,
{ long style = wxDEFAULT_FRAME_STYLE,
m_view = v; const wxString& name = _T("frame"))
m_propertyPanel = NULL; : wxFrame(parent, -1, title, pos, size, style, name)
} {
void OnCloseWindow(wxCloseEvent& event); m_view = v;
m_propertyPanel = NULL;
}
void OnCloseWindow(wxCloseEvent& event);
// Must call this to create panel and associate view // Must call this to create panel and associate view
virtual bool Initialize(void); virtual bool Initialize(void);
virtual wxPanel *OnCreatePanel(wxFrame *parent, wxPropertyFormView *v); virtual wxPanel *OnCreatePanel(wxFrame *parent, wxPropertyFormView *v);
inline virtual wxPanel *GetPropertyPanel(void) const { return m_propertyPanel; } inline virtual wxPanel *GetPropertyPanel(void) const { return m_propertyPanel; }
private: private:
wxPropertyFormView* m_view; wxPropertyFormView* m_view;
wxPanel* m_propertyPanel; wxPanel* m_propertyPanel;
DECLARE_EVENT_TABLE() DECLARE_EVENT_TABLE()
DECLARE_CLASS(wxPropertyFormFrame)
}; };
#endif #endif

View File

@@ -191,15 +191,22 @@ private:
class WXDLLEXPORT wxPropertyTextEdit: public wxTextCtrl class WXDLLEXPORT wxPropertyTextEdit: public wxTextCtrl
{ {
DECLARE_CLASS(wxPropertyTextEdit) public:
public: wxPropertyTextEdit(wxPropertyListView *v = NULL,
wxPropertyTextEdit(wxPropertyListView *v, wxWindow *parent, const wxWindowID id, wxWindow *parent = NULL,
const wxString& value, const wxPoint& pos = wxDefaultPosition, const wxWindowID id = -1,
const wxSize& size = wxDefaultSize, long style = 0, const wxString& name = "text"); const wxString& value = wxEmptyString,
void OnSetFocus(void); const wxPoint& pos = wxDefaultPosition,
void OnKillFocus(void); 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 #define wxPROP_ALLOW_TEXT_EDITING 1
@@ -272,22 +279,27 @@ class WXDLLEXPORT wxPropertyListValidator: public wxPropertyValidator
class WXDLLEXPORT wxPropertyListDialog: public wxDialog class WXDLLEXPORT wxPropertyListDialog: public wxDialog
{ {
DECLARE_CLASS(wxPropertyListDialog) public:
public: wxPropertyListDialog(wxPropertyListView *v = NULL,
wxPropertyListDialog(wxPropertyListView *v, wxWindow *parent, const wxString& title, wxWindow *parent = NULL,
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, const wxString& title = wxEmptyString,
long style = wxDEFAULT_DIALOG_STYLE, const wxString& name = "dialogBox"); const wxPoint& pos = wxDefaultPosition,
void OnCloseWindow(wxCloseEvent& event); const wxSize& size = wxDefaultSize,
void OnDefaultAction(wxControl *item); long style = wxDEFAULT_DIALOG_STYLE,
void OnCancel(wxCommandEvent& event); const wxString& name = _T("dialogBox"));
// Extend event processing to search the view's event table void OnCloseWindow(wxCloseEvent& event);
virtual bool ProcessEvent(wxEvent& event); void OnDefaultAction(wxControl *item);
void OnCancel(wxCommandEvent& event);
private: // Extend event processing to search the view's event table
wxPropertyListView* m_view; 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 class WXDLLEXPORT wxPropertyListPanel: public wxPanel
{ {
DECLARE_CLASS(wxPropertyListPanel) public:
public: wxPropertyListPanel(wxPropertyListView *v = NULL,
wxPropertyListPanel(wxPropertyListView *v, wxWindow *parent, const wxPoint& pos = wxDefaultPosition, wxWindow *parent = NULL,
const wxSize& size = wxDefaultSize, const wxPoint& pos = wxDefaultPosition,
long style = 0, const wxString& name = "panel"): const wxSize& size = wxDefaultSize,
wxPanel(parent, -1, pos, size, style, name) long style = 0,
{ const wxString& name = _T("panel"))
m_view = v; : wxPanel(parent, -1, pos, size, style, name)
} {
~wxPropertyListPanel(); m_view = v;
void OnDefaultAction(wxControl *item); }
~wxPropertyListPanel();
void OnDefaultAction(wxControl *item);
inline void SetView(wxPropertyListView* v) { m_view = v; } inline void SetView(wxPropertyListView* v) { m_view = v; }
inline wxPropertyListView* GetView() const { return m_view; } inline wxPropertyListView* GetView() const { return m_view; }
// Extend event processing to search the view's event table // Extend event processing to search the view's event table
virtual bool ProcessEvent(wxEvent& event); virtual bool ProcessEvent(wxEvent& event);
// Call Layout() // Call Layout()
void OnSize(wxSizeEvent& event); void OnSize(wxSizeEvent& event);
private: private:
wxPropertyListView* m_view; wxPropertyListView* m_view;
DECLARE_EVENT_TABLE() DECLARE_EVENT_TABLE()
DECLARE_CLASS(wxPropertyListPanel)
}; };
/* /*
@@ -329,29 +344,33 @@ DECLARE_EVENT_TABLE()
class WXDLLEXPORT wxPropertyListFrame: public wxFrame class WXDLLEXPORT wxPropertyListFrame: public wxFrame
{ {
DECLARE_CLASS(wxPropertyListFrame) public:
public: wxPropertyListFrame(wxPropertyListView *v = NULL,
wxPropertyListFrame(wxPropertyListView *v, wxFrame *parent, const wxString& title, wxFrame *parent = NULL,
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, const wxString& title = wxEmptyString,
long style = wxDEFAULT_FRAME_STYLE, const wxString& name = "frame"): const wxPoint& pos = wxDefaultPosition,
wxFrame(parent, -1, title, pos, size, style, name) const wxSize& size = wxDefaultSize,
{ long style = wxDEFAULT_FRAME_STYLE,
m_view = v; const wxString& name = _T("frame"))
m_propertyPanel = NULL; : wxFrame(parent, -1, title, pos, size, style, name)
} {
void OnCloseWindow(wxCloseEvent& event); m_view = v;
m_propertyPanel = NULL;
}
void OnCloseWindow(wxCloseEvent& event);
// Must call this to create panel and associate view // Must call this to create panel and associate view
virtual bool Initialize(void); virtual bool Initialize(void);
virtual wxPropertyListPanel *OnCreatePanel(wxFrame *parent, wxPropertyListView *v); virtual wxPropertyListPanel *OnCreatePanel(wxFrame *parent, wxPropertyListView *v);
inline virtual wxPropertyListPanel *GetPropertyPanel(void) const { return m_propertyPanel; } inline virtual wxPropertyListPanel *GetPropertyPanel(void) const { return m_propertyPanel; }
inline wxPropertyListView* GetView() const { return m_view; } inline wxPropertyListView* GetView() const { return m_view; }
private: private:
wxPropertyListView* m_view; wxPropertyListView* m_view;
wxPropertyListPanel* m_propertyPanel; wxPropertyListPanel* m_propertyPanel;
DECLARE_EVENT_TABLE() DECLARE_EVENT_TABLE()
DECLARE_CLASS(wxPropertyListFrame)
}; };
/* /*

View File

@@ -810,7 +810,7 @@ void MyPanel::OnPageChanging( wxNotebookEvent &event )
"page change from taking place - if you select\n" "page change from taking place - if you select\n"
"[No] the current page will stay the third one\n", "[No] the current page will stay the third one\n",
"Control sample", "Control sample",
wxICON_QUESTION | wxYES_NO) != wxYES ) wxICON_QUESTION | wxYES_NO, this) != wxYES )
{ {
event.Veto(); event.Veto();

View File

@@ -1071,6 +1071,8 @@ void DnDFrame::OnLeftDown(wxMouseEvent &WXUNUSED(event) )
,wxCURSOR_PENCIL, // for copy ,wxCURSOR_PENCIL, // for copy
wxCURSOR_SPRAYCAN, // for move wxCURSOR_SPRAYCAN, // for move
wxCURSOR_QUESTION_ARROW // for nothing wxCURSOR_QUESTION_ARROW // for nothing
#elif defined(__WXGTK__)
,wxICON(mondrian)
#endif #endif
); );

View File

@@ -588,6 +588,8 @@ void MyListCtrl::OnListKeyDown(wxListEvent& event)
void MyListCtrl::OnChar(wxKeyEvent& event) void MyListCtrl::OnChar(wxKeyEvent& event)
{ {
wxLogMessage(_T("Got char event.")); wxLogMessage(_T("Got char event."));
event.Skip();
} }
void MyListCtrl::LogEvent(const wxListEvent& event, const wxChar *eventName) void MyListCtrl::LogEvent(const wxListEvent& event, const wxChar *eventName)

View File

@@ -245,6 +245,9 @@ void MyFrame::OnDeletePage(wxCommandEvent& WXUNUSED(event))
{ {
if (m_notebook->GetPageCount() > 0) if (m_notebook->GetPageCount() > 0)
m_notebook->DeletePage( m_notebook->GetPageCount()-1 ); m_notebook->DeletePage( m_notebook->GetPageCount()-1 );
// VZ: this crashes wxGTK
//m_notebook->RemovePage( m_notebook->GetPageCount()-1 );
} }
void MyFrame::OnNextPage(wxCommandEvent& WXUNUSED(event)) void MyFrame::OnNextPage(wxCommandEvent& WXUNUSED(event))

View File

@@ -284,7 +284,7 @@ void wxPropertyFormView::OnDoubleClick(wxControl *item)
* Property form dialog box * Property form dialog box
*/ */
IMPLEMENT_CLASS(wxPropertyFormDialog, wxDialog) IMPLEMENT_DYNAMIC_CLASS(wxPropertyFormDialog, wxDialog)
BEGIN_EVENT_TABLE(wxPropertyFormDialog, wxDialog) BEGIN_EVENT_TABLE(wxPropertyFormDialog, wxDialog)
EVT_CLOSE(wxPropertyFormDialog::OnCloseWindow) EVT_CLOSE(wxPropertyFormDialog::OnCloseWindow)
@@ -337,7 +337,7 @@ bool wxPropertyFormDialog::ProcessEvent(wxEvent& event)
* Property form panel * Property form panel
*/ */
IMPLEMENT_CLASS(wxPropertyFormPanel, wxPanel) IMPLEMENT_DYNAMIC_CLASS(wxPropertyFormPanel, wxPanel)
void wxPropertyFormPanel::OnDefaultAction(wxControl *item) void wxPropertyFormPanel::OnDefaultAction(wxControl *item)
{ {
@@ -362,7 +362,7 @@ bool wxPropertyFormPanel::ProcessEvent(wxEvent& event)
* Property frame * Property frame
*/ */
IMPLEMENT_CLASS(wxPropertyFormFrame, wxFrame) IMPLEMENT_DYNAMIC_CLASS(wxPropertyFormFrame, wxFrame)
BEGIN_EVENT_TABLE(wxPropertyFormFrame, wxFrame) BEGIN_EVENT_TABLE(wxPropertyFormFrame, wxFrame)
EVT_CLOSE(wxPropertyFormFrame::OnCloseWindow) EVT_CLOSE(wxPropertyFormFrame::OnCloseWindow)

View File

@@ -72,7 +72,7 @@ static wxBitmap *GetCrossBitmap();
// Property text edit control // Property text edit control
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
IMPLEMENT_CLASS(wxPropertyTextEdit, wxTextCtrl) IMPLEMENT_DYNAMIC_CLASS(wxPropertyTextEdit, wxTextCtrl)
wxPropertyTextEdit::wxPropertyTextEdit(wxPropertyListView *v, wxWindow *parent, wxPropertyTextEdit::wxPropertyTextEdit(wxPropertyListView *v, wxWindow *parent,
const wxWindowID id, const wxString& value, const wxWindowID id, const wxString& value,
@@ -675,7 +675,7 @@ void wxPropertyListView::OnText(wxCommandEvent& event)
// Property dialog box // Property dialog box
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
IMPLEMENT_CLASS(wxPropertyListDialog, wxDialog) IMPLEMENT_DYNAMIC_CLASS(wxPropertyListDialog, wxDialog)
BEGIN_EVENT_TABLE(wxPropertyListDialog, wxDialog) BEGIN_EVENT_TABLE(wxPropertyListDialog, wxDialog)
EVT_BUTTON(wxID_CANCEL, wxPropertyListDialog::OnCancel) EVT_BUTTON(wxID_CANCEL, wxPropertyListDialog::OnCancel)
@@ -735,7 +735,7 @@ bool wxPropertyListDialog::ProcessEvent(wxEvent& event)
// Property panel // Property panel
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
IMPLEMENT_CLASS(wxPropertyListPanel, wxPanel) IMPLEMENT_DYNAMIC_CLASS(wxPropertyListPanel, wxPanel)
BEGIN_EVENT_TABLE(wxPropertyListPanel, wxPanel) BEGIN_EVENT_TABLE(wxPropertyListPanel, wxPanel)
EVT_SIZE(wxPropertyListPanel::OnSize) EVT_SIZE(wxPropertyListPanel::OnSize)
@@ -771,7 +771,7 @@ void wxPropertyListPanel::OnSize(wxSizeEvent& WXUNUSED(event))
// Property frame // Property frame
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
IMPLEMENT_CLASS(wxPropertyListFrame, wxFrame) IMPLEMENT_DYNAMIC_CLASS(wxPropertyListFrame, wxFrame)
BEGIN_EVENT_TABLE(wxPropertyListFrame, wxFrame) BEGIN_EVENT_TABLE(wxPropertyListFrame, wxFrame)
EVT_CLOSE(wxPropertyListFrame::OnCloseWindow) EVT_CLOSE(wxPropertyListFrame::OnCloseWindow)