Generate wxPropertyGrid splitter (column divider) events: wxEVT_PG_COL_BEGIN_DRAG, wxEVT_PG_COL_DRAGGING, wxEVT_PG_COL_END_DRAG

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62861 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Jaakko Salli
2009-12-12 09:38:10 +00:00
parent 9dac189e72
commit 5405bfb439
5 changed files with 131 additions and 26 deletions

View File

@@ -688,7 +688,8 @@ enum
ID_SAVESTATE,
ID_RESTORESTATE,
ID_RUNMINIMAL,
ID_ENABLELABELEDITING
ID_ENABLELABELEDITING,
ID_VETOCOLDRAG
};
// -----------------------------------------------------------------------
@@ -726,6 +727,10 @@ BEGIN_EVENT_TABLE(FormMain, wxFrame)
EVT_PG_ITEM_COLLAPSED( PGID, FormMain::OnPropertyGridItemCollapse )
EVT_PG_ITEM_EXPANDED( PGID, FormMain::OnPropertyGridItemExpand )
EVT_PG_COL_BEGIN_DRAG( PGID, FormMain::OnPropertyGridColBeginDrag )
EVT_PG_COL_DRAGGING( PGID, FormMain::OnPropertyGridColDragging )
EVT_PG_COL_END_DRAG( PGID, FormMain::OnPropertyGridColEndDrag )
EVT_TEXT( PGID, FormMain::OnPropertyGridTextUpdate )
//
@@ -1128,6 +1133,36 @@ void FormMain::OnPropertyGridItemExpand( wxPropertyGridEvent& )
// -----------------------------------------------------------------------
void FormMain::OnPropertyGridColBeginDrag( wxPropertyGridEvent& event )
{
if ( m_itemVetoDragging->IsChecked() )
{
wxLogDebug("Splitter %i resize was vetoed", event.GetColumn());
event.Veto();
}
else
{
wxLogDebug("Splitter %i resize began", event.GetColumn());
}
}
// -----------------------------------------------------------------------
void FormMain::OnPropertyGridColDragging( wxPropertyGridEvent& event )
{
// For now, let's not spam the log output
//wxLogDebug("Splitter %i is being resized", event.GetColumn());
}
// -----------------------------------------------------------------------
void FormMain::OnPropertyGridColEndDrag( wxPropertyGridEvent& event )
{
wxLogDebug("Splitter %i resize ended", event.GetColumn());
}
// -----------------------------------------------------------------------
// EVT_TEXT handling
void FormMain::OnPropertyGridTextUpdate( wxCommandEvent& event )
{
@@ -2248,6 +2283,9 @@ FormMain::FormMain(const wxString& title, const wxPoint& pos, const wxSize& size
menuTools2->Append(ID_REMOVEPAGE, wxT("Remove Page") );
menuTools2->AppendSeparator();
menuTools2->Append(ID_FITCOLUMNS, wxT("Fit Columns") );
m_itemVetoDragging =
menuTools2->AppendCheckItem(ID_VETOCOLDRAG,
"Veto Column Dragging");
menuTools2->AppendSeparator();
menuTools2->Append(ID_CHANGEFLAGSITEMS, wxT("Change Children of FlagsProp") );
menuTools2->AppendSeparator();