1 /////////////////////////////////////////////////////////////////////////////
2 // Name: samples/propgrid/propgrid_minimal.cpp
3 // Purpose: Minimal portion of wxPropertyGrid sample
4 // Author: Jaakko Salli
8 // Copyright: (c) Jaakko Salli
9 // Licence: wxWindows license
10 /////////////////////////////////////////////////////////////////////////////
13 #include "wx/propgrid/propgrid.h"
15 class MyFrame
: public wxFrame
18 MyFrame(wxWindow
* parent
);
20 void OnAction(wxCommandEvent
& event
);
21 void OnPropertyGridChange(wxPropertyGridEvent
& event
);
28 BEGIN_EVENT_TABLE(MyFrame
, wxFrame
)
29 EVT_MENU(wxID_HIGHEST
+1, MyFrame::OnAction
)
30 EVT_PG_CHANGED( -1, MyFrame::OnPropertyGridChange
)
33 MyFrame::MyFrame(wxWindow
* parent
)
34 : wxFrame(parent
, wxID_ANY
, wxT("PropertyGrid Test"))
36 wxMenu
*Menu
= new wxMenu
;
37 Menu
->Append(wxID_HIGHEST
+1, wxT("Action"));
38 wxMenuBar
*MenuBar
= new wxMenuBar();
39 MenuBar
->Append(Menu
, wxT("Action"));
42 wxPropertyGrid
*pg
= new wxPropertyGrid(this,-1,wxDefaultPosition
,wxSize(400,400),
43 wxPG_SPLITTER_AUTO_CENTER
|
47 pg
->Append( new wxStringProperty("String Property", wxPG_LABEL
) );
48 pg
->Append( new wxIntProperty("Int Property", wxPG_LABEL
) );
49 pg
->Append( new wxBoolProperty("Bool Property", wxPG_LABEL
) );
54 void MyFrame::OnPropertyGridChange(wxPropertyGridEvent
&event
)
56 wxPGProperty
* p
= event
.GetProperty();
59 wxLogDebug("OnPropertyGridChange(%s)", p
->GetName().c_str());
61 wxLogDebug("OnPropertyGridChange(NULL)");
64 void MyFrame::OnAction(wxCommandEvent
&)
68 // Called from propgridsample.cpp
70 void DisplayMinimalFrame(wxWindow
* parent
)
72 MyFrame
*frame
= new MyFrame(parent
);