]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/propgrid/propgrid.cpp
Add screenshots for wxNotebook, wxChoicebook, wxListbook
[wxWidgets.git] / samples / propgrid / propgrid.cpp
index 5772484f8ce72908f7a5b277b1cacbf3fc3cd5cf..26dbfd835d00dae2923e68f52b3ae8135d0a1db6 100644 (file)
@@ -4,7 +4,7 @@
 // Author:      Jaakko Salli
 // Modified by:
 // Created:     2004-09-25
-// RCS-ID:      $Id:
+// RCS-ID:      $Id$
 // Copyright:   (c) Jaakko Salli
 // Licence:     wxWindows license
 /////////////////////////////////////////////////////////////////////////////
@@ -85,8 +85,6 @@ public:
     wxSampleMultiButtonEditor() {}
     virtual ~wxSampleMultiButtonEditor() {}
 
-    virtual wxString GetName() const { return "SampleMultiButtonEditor"; }
-
     virtual wxPGWindowList CreateControls( wxPropertyGrid* propGrid,
                                            wxPGProperty* property,
                                            const wxPoint& pos,
@@ -609,7 +607,7 @@ public:
     // Set editor to have button
     virtual const wxPGEditor* DoGetEditorClass() const
     {
-        return wxPG_EDITOR(TextCtrlAndButton);
+        return wxPGEditor_TextCtrlAndButton;
     }
 
     // Set what happens on button click
@@ -655,7 +653,6 @@ enum
     ID_CATCOLOURS,
     ID_SETCOLOUR,
     ID_STATICLAYOUT,
-    ID_CLEAR,
     ID_POPULATE1,
     ID_POPULATE2,
     ID_COLLAPSE,
@@ -753,7 +750,6 @@ BEGIN_EVENT_TABLE(FormMain, wxFrame)
     EVT_MENU( ID_SELECTSTYLE, FormMain::OnSelectStyle )
 
     EVT_MENU( ID_STATICLAYOUT, FormMain::OnMisc )
-    EVT_MENU( ID_CLEAR, FormMain::OnMisc )
     EVT_MENU( ID_COLLAPSE, FormMain::OnMisc )
     EVT_MENU( ID_COLLAPSEALL, FormMain::OnMisc )
 
@@ -1368,7 +1364,7 @@ void FormMain::PopulateWithExamples ()
 #if wxUSE_SPINBTN
     pg->Append( new wxIntProperty ( wxT("SpinCtrl"), wxPG_LABEL, 0 ) );
 
-    pg->SetPropertyEditor( wxT("SpinCtrl"), wxPG_EDITOR(SpinCtrl) );
+    pg->SetPropertyEditor( wxT("SpinCtrl"), wxPGEditor_SpinCtrl );
     pg->SetPropertyAttribute( wxT("SpinCtrl"), wxPG_ATTR_MIN, (long)-10 );  // Use constants instead of string
     pg->SetPropertyAttribute( wxT("SpinCtrl"), wxPG_ATTR_MAX, (long)10 );   // for reduced binary size.
     pg->SetPropertyAttribute( wxT("SpinCtrl"), wxT("Step"), (long)2 );
@@ -1376,7 +1372,7 @@ void FormMain::PopulateWithExamples ()
 
     pg->SetPropertyHelpString( wxT("SpinCtrl"),
         wxT("This is regular wxIntProperty, which editor has been ")
-        wxT("changed to wxPG_EDITOR(SpinCtrl). Note however that ")
+        wxT("changed to wxPGEditor_SpinCtrl. Note however that ")
         wxT("static wxPropertyGrid::RegisterAdditionalEditors() ")
         wxT("needs to be called prior to using it."));
 
@@ -1437,11 +1433,11 @@ void FormMain::PopulateWithExamples ()
 
     pid = pg->Append( new wxColourProperty(wxT("ColourProperty"),wxPG_LABEL,*wxRED) );
     //pg->SetPropertyAttribute(pid,wxPG_COLOUR_ALLOW_CUSTOM,false);
-    pg->SetPropertyEditor( wxT("ColourProperty"), wxPG_EDITOR(ComboBox) );
+    pg->SetPropertyEditor( wxT("ColourProperty"), wxPGEditor_ComboBox );
     pg->GetProperty(wxT("ColourProperty"))->SetFlag(wxPG_PROP_AUTO_UNSPECIFIED);
     pg->SetPropertyHelpString( wxT("ColourProperty"),
         wxT("wxPropertyGrid::SetPropertyEditor method has been used to change ")
-        wxT("editor of this property to wxPG_EDITOR(ComboBox)"));
+        wxT("editor of this property to wxPGEditor_ComboBox)"));
 
     //
     // This demonstrates using alternative editor for colour property
@@ -2117,7 +2113,6 @@ FormMain::FormMain(const wxString& title, const wxPoint& pos, const wxSize& size
     menuTools1->AppendSeparator();
     menuTools1->Append(ID_SETCOLOUR, wxT("Set Bg Colour") );
     menuTools1->Append(ID_UNSPECIFY, wxT("Set to Unspecified") );
-    menuTools1->Append(ID_CLEAR, wxT("Set Value to Default") );
     menuTools1->AppendSeparator();
     m_itemEnable = menuTools1->Append(ID_ENABLE, wxT("Enable"),
         wxT("Toggles item's enabled state.") );
@@ -2616,7 +2611,7 @@ void FormMain::OnSetSpinCtrlEditorClick( wxCommandEvent& WXUNUSED(event) )
 #if wxUSE_SPINBTN
     wxPGProperty* pgId = m_pPropGridManager->GetSelection();
     if ( pgId )
-        m_pPropGridManager->SetPropertyEditor( pgId, wxPG_EDITOR(SpinCtrl) );
+        m_pPropGridManager->SetPropertyEditor( pgId, wxPGEditor_SpinCtrl );
     else
         wxMessageBox(wxT("First select a property"));
 #endif
@@ -2846,7 +2841,6 @@ void FormMain::OnSelectStyle( wxCommandEvent& WXUNUSED(event) )
         ADD_FLAG(wxPG_EX_NATIVE_DOUBLE_BUFFERING)
         ADD_FLAG(wxPG_EX_AUTO_UNSPECIFIED_VALUES)
         ADD_FLAG(wxPG_EX_WRITEONLY_BUILTIN_ATTRIBUTES)
-        ADD_FLAG(wxPG_EX_LEGACY_VALIDATORS)
         wxMultiChoiceDialog dlg( this, wxT("Select extra window styles to use"),
                                  wxT("wxPropertyGrid Extra Style"), chs );
         dlg.SetSelections(sel);
@@ -2955,10 +2949,6 @@ void FormMain::OnMisc ( wxCommandEvent& event )
         if ( event.IsChecked() ) m_pPropGridManager->SetWindowStyleFlag( wsf|wxPG_STATIC_LAYOUT );
         else m_pPropGridManager->SetWindowStyleFlag( wsf&~(wxPG_STATIC_LAYOUT) );
     }
-    else if ( id == ID_CLEAR )
-    {
-        m_pPropGridManager->ClearPropertyValue(m_pPropGridManager->GetGrid()->GetSelection());
-    }
     else if ( id == ID_COLLAPSEALL )
     {
         wxPGVIterator it;