ID_SELECTSTYLE,
ID_SAVESTATE,
ID_RESTORESTATE,
- ID_RUNMINIMAL
+ ID_RUNMINIMAL,
+ ID_ENABLELABELEDITING
};
// -----------------------------------------------------------------------
EVT_PG_DOUBLE_CLICK( PGID, FormMain::OnPropertyGridItemDoubleClick )
// This occurs when propgridmanager's page changes.
EVT_PG_PAGE_CHANGED( PGID, FormMain::OnPropertyGridPageChange )
+ // This occurs when user starts editing a property label
+ EVT_PG_LABEL_EDIT_BEGIN( PGID,
+ FormMain::OnPropertyGridLabelEditBegin )
+ // This occurs when user stops editing a property label
+ EVT_PG_LABEL_EDIT_ENDING( PGID,
+ FormMain::OnPropertyGridLabelEditEnding )
// This occurs when property's editor button (if any) is clicked.
EVT_BUTTON( PGID, FormMain::OnPropertyGridButtonClick )
EVT_MENU( ID_SETBGCOLOURRECUR, FormMain::OnSetBackgroundColour )
EVT_MENU( ID_CLEARMODIF, FormMain::OnClearModifyStatusClick )
EVT_MENU( ID_FREEZE, FormMain::OnFreezeClick )
+ EVT_MENU( ID_ENABLELABELEDITING, FormMain::OnEnableLabelEditing )
EVT_MENU( ID_DUMPLIST, FormMain::OnDumpList )
EVT_MENU( ID_COLOURSCHEME1, FormMain::OnColourScheme )
// -----------------------------------------------------------------------
+void FormMain::OnPropertyGridLabelEditBegin( wxPropertyGridEvent& event )
+{
+ wxLogDebug("wxPG_EVT_LABEL_EDIT_BEGIN(%s)",
+ event.GetProperty()->GetLabel().c_str());
+}
+
+// -----------------------------------------------------------------------
+
+void FormMain::OnPropertyGridLabelEditEnding( wxPropertyGridEvent& event )
+{
+ wxLogDebug("wxPG_EVT_LABEL_EDIT_ENDING(%s)",
+ event.GetProperty()->GetLabel().c_str());
+}
+
+// -----------------------------------------------------------------------
+
void FormMain::OnPropertyGridHighlight( wxPropertyGridEvent& WXUNUSED(event) )
{
}
if ( extraStyle == -1 )
// default extra style
- extraStyle = wxPG_EX_MODE_BUTTONS;
+ extraStyle = wxPG_EX_MODE_BUTTONS |
+ wxPG_EX_MULTIPLE_SELECTION;
//| wxPG_EX_AUTO_UNSPECIFIED_VALUES
//| wxPG_EX_GREY_LABEL_WHEN_DISABLED
//| wxPG_EX_NATIVE_DOUBLE_BUFFERING
// event handling will obviously be broken.
PGID, /*wxID_ANY*/
wxDefaultPosition,
- wxDefaultSize,
+ wxSize(100, 100), // FIXME: wxDefaultSize gives assertion in propgrid.
+ // But calling SetInitialSize in manager changes the code
+ // order to the grid gets created immediately, before SetExtraStyle
+ // is called.
style );
m_propGrid = pgman->GetGrid();
wxPG_TOOLBAR |
wxPG_DESCRIPTION,
// extra style
- wxPG_EX_MODE_BUTTONS
+ wxPG_EX_MODE_BUTTONS |
+ wxPG_EX_MULTIPLE_SELECTION
//| wxPG_EX_AUTO_UNSPECIFIED_VALUES
//| wxPG_EX_GREY_LABEL_WHEN_DISABLED
//| wxPG_EX_NATIVE_DOUBLE_BUFFERING
menuTry->Append(ID_SELECTSTYLE, wxT("Set Window Style"),
wxT("Select window style flags used by the grid."));
+ menuTry->Append(ID_ENABLELABELEDITING, "Enable label editing",
+ "This calls wxPropertyGrid::MakeColumnEditable(0)");
menuTry->AppendSeparator();
menuTry->AppendRadioItem( ID_COLOURSCHEME1, wxT("Standard Colour Scheme") );
menuTry->AppendRadioItem( ID_COLOURSCHEME2, wxT("White Colour Scheme") );
// -----------------------------------------------------------------------
-void FormMain::OnContextMenu( wxContextMenuEvent& WXUNUSED(event) )
+void FormMain::OnContextMenu( wxContextMenuEvent& event )
{
wxLogDebug(wxT("FormMain::OnContextMenu(%i,%i)"),
event.GetPosition().x,event.GetPosition().y);
+ wxUnusedVar(event);
+
//event.Skip();
}
// -----------------------------------------------------------------------
+void FormMain::OnEnableLabelEditing( wxCommandEvent& WXUNUSED(event) )
+{
+ m_propGrid->MakeColumnEditable(0);
+}
+
+// -----------------------------------------------------------------------
+
void FormMain::OnAbout(wxCommandEvent& WXUNUSED(event))
{
wxString msg;
wxT("Jaakko Salli"), wxVERSION_STRING
);
- wxMessageBox(msg, _T("About"), wxOK | wxICON_INFORMATION, this);
+ wxMessageBox(msg, wxT("About"), wxOK | wxICON_INFORMATION, this);
}
// -----------------------------------------------------------------------
ADD_FLAG(wxPG_LIMITED_EDITING)
ADD_FLAG(wxPG_TOOLBAR)
ADD_FLAG(wxPG_DESCRIPTION)
+ ADD_FLAG(wxPG_NO_INTERNAL_BORDER)
wxMultiChoiceDialog dlg( this, wxT("Select window styles to use"),
wxT("wxPropertyGrid Window Style"), chs );
dlg.SetSelections(sel);
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_HIDE_PAGE_BUTTONS)
+ ADD_FLAG(wxPG_EX_MULTIPLE_SELECTION)
+ ADD_FLAG(wxPG_EX_ENABLE_TLP_TRACKING)
+ ADD_FLAG(wxPG_EX_NO_TOOLBAR_DIVIDER)
+ ADD_FLAG(wxPG_EX_TOOLBAR_SEPARATOR)
wxMultiChoiceDialog dlg( this, wxT("Select extra window styles to use"),
wxT("wxPropertyGrid Extra Style"), chs );
dlg.SetSelections(sel);
//wxLocale Locale;
//Locale.Init(wxLANGUAGE_FINNISH);
- FormMain* frame = Form1 = new FormMain( wxT("wxPropertyGrid Sample"), wxPoint(0,0), wxSize(300,500) );
- frame->Show(true);
+ FormMain* frame = Form1 = new FormMain( wxT("wxPropertyGrid Sample"), wxPoint(0,0), wxSize(300,500) );
+ frame->Show(true);
//
// Parse command-line
}
}
- return true;
+ return true;
}
// -----------------------------------------------------------------------