Avoid using Hungarian notation in propgrid sample
Rename m_pPropGridManager to just m_propGridManager for consistency with the existing m_propGrid.
This commit is contained in:
parent
cb852632e2
commit
5b064c0fde
2 changed files with 165 additions and 165 deletions
|
|
@ -565,7 +565,7 @@ wxEND_EVENT_TABLE()
|
|||
|
||||
void FormMain::OnMove( wxMoveEvent& event )
|
||||
{
|
||||
if ( !m_pPropGridManager )
|
||||
if ( !m_propGridManager )
|
||||
{
|
||||
// this check is here so the frame layout can be tested
|
||||
// without creating propertygrid
|
||||
|
|
@ -581,18 +581,18 @@ void FormMain::OnMove( wxMoveEvent& event )
|
|||
|
||||
// Must check if properties exist (as they may be deleted).
|
||||
|
||||
// Using m_pPropGridManager, we can scan all pages automatically.
|
||||
id = m_pPropGridManager->GetPropertyByName( "X" );
|
||||
// Using m_propGridManager, we can scan all pages automatically.
|
||||
id = m_propGridManager->GetPropertyByName( "X" );
|
||||
if ( id )
|
||||
m_pPropGridManager->SetPropertyValue( id, x );
|
||||
m_propGridManager->SetPropertyValue( id, x );
|
||||
|
||||
id = m_pPropGridManager->GetPropertyByName( "Y" );
|
||||
id = m_propGridManager->GetPropertyByName( "Y" );
|
||||
if ( id )
|
||||
m_pPropGridManager->SetPropertyValue( id, y );
|
||||
m_propGridManager->SetPropertyValue( id, y );
|
||||
|
||||
id = m_pPropGridManager->GetPropertyByName( "Position" );
|
||||
id = m_propGridManager->GetPropertyByName( "Position" );
|
||||
if ( id )
|
||||
m_pPropGridManager->SetPropertyValue( id, WXVARIANT(wxPoint(x,y)) );
|
||||
m_propGridManager->SetPropertyValue( id, WXVARIANT(wxPoint(x,y)) );
|
||||
|
||||
// Should always call event.Skip() in frame's MoveEvent handler
|
||||
event.Skip();
|
||||
|
|
@ -602,7 +602,7 @@ void FormMain::OnMove( wxMoveEvent& event )
|
|||
|
||||
void FormMain::OnResize( wxSizeEvent& event )
|
||||
{
|
||||
if ( !m_pPropGridManager )
|
||||
if ( !m_propGridManager )
|
||||
{
|
||||
// this check is here so the frame layout can be tested
|
||||
// without creating propertygrid
|
||||
|
|
@ -619,18 +619,18 @@ void FormMain::OnResize( wxSizeEvent& event )
|
|||
|
||||
// Must check if properties exist (as they may be deleted).
|
||||
|
||||
// Using m_pPropGridManager, we can scan all pages automatically.
|
||||
p = m_pPropGridManager->GetPropertyByName( "Width" );
|
||||
// Using m_propGridManager, we can scan all pages automatically.
|
||||
p = m_propGridManager->GetPropertyByName( "Width" );
|
||||
if ( p && !p->IsValueUnspecified() )
|
||||
m_pPropGridManager->SetPropertyValue( p, w );
|
||||
m_propGridManager->SetPropertyValue( p, w );
|
||||
|
||||
p = m_pPropGridManager->GetPropertyByName( "Height" );
|
||||
p = m_propGridManager->GetPropertyByName( "Height" );
|
||||
if ( p && !p->IsValueUnspecified() )
|
||||
m_pPropGridManager->SetPropertyValue( p, h );
|
||||
m_propGridManager->SetPropertyValue( p, h );
|
||||
|
||||
id = m_pPropGridManager->GetPropertyByName ( "Size" );
|
||||
id = m_propGridManager->GetPropertyByName ( "Size" );
|
||||
if ( id )
|
||||
m_pPropGridManager->SetPropertyValue( id, WXVARIANT(wxSize(w,h)) );
|
||||
m_propGridManager->SetPropertyValue( id, WXVARIANT(wxSize(w,h)) );
|
||||
|
||||
// Should always call event.Skip() in frame's SizeEvent handler
|
||||
event.Skip();
|
||||
|
|
@ -647,7 +647,7 @@ void FormMain::OnPropertyGridChanging( wxPropertyGridEvent& event )
|
|||
int res =
|
||||
wxMessageBox(wxString::Format("'%s' is about to change (to variant of type '%s')\n\nAllow or deny?",
|
||||
p->GetName(),event.GetValue().GetType()),
|
||||
"Testing wxEVT_PG_CHANGING", wxYES_NO, m_pPropGridManager);
|
||||
"Testing wxEVT_PG_CHANGING", wxYES_NO, m_propGridManager);
|
||||
|
||||
if ( res == wxNO )
|
||||
{
|
||||
|
|
@ -706,28 +706,28 @@ void FormMain::OnPropertyGridChange( wxPropertyGridEvent& event )
|
|||
wxFont font = value.As<wxFont>();
|
||||
wxASSERT( font.IsOk() );
|
||||
|
||||
m_pPropGridManager->SetFont( font );
|
||||
m_propGridManager->SetFont( font );
|
||||
}
|
||||
else
|
||||
if ( name == "Margin Colour" )
|
||||
{
|
||||
wxColourPropertyValue cpv = value.As<wxColourPropertyValue>();
|
||||
m_pPropGridManager->GetGrid()->SetMarginColour( cpv.m_colour );
|
||||
m_propGridManager->GetGrid()->SetMarginColour( cpv.m_colour );
|
||||
}
|
||||
else if ( name == "Cell Colour" )
|
||||
{
|
||||
wxColourPropertyValue cpv = value.As<wxColourPropertyValue>();
|
||||
m_pPropGridManager->GetGrid()->SetCellBackgroundColour( cpv.m_colour );
|
||||
m_propGridManager->GetGrid()->SetCellBackgroundColour( cpv.m_colour );
|
||||
}
|
||||
else if ( name == "Line Colour" )
|
||||
{
|
||||
wxColourPropertyValue cpv = value.As<wxColourPropertyValue>();
|
||||
m_pPropGridManager->GetGrid()->SetLineColour( cpv.m_colour );
|
||||
m_propGridManager->GetGrid()->SetLineColour( cpv.m_colour );
|
||||
}
|
||||
else if ( name == "Cell Text Colour" )
|
||||
{
|
||||
wxColourPropertyValue cpv = value.As<wxColourPropertyValue>();
|
||||
m_pPropGridManager->GetGrid()->SetCellTextColour( cpv.m_colour );
|
||||
m_propGridManager->GetGrid()->SetCellTextColour( cpv.m_colour );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -755,7 +755,7 @@ void FormMain::OnPropertyGridSelect( wxPropertyGridEvent& event )
|
|||
if ( prop )
|
||||
{
|
||||
wxString text("Selected: ");
|
||||
text += m_pPropGridManager->GetPropertyLabel( prop );
|
||||
text += m_propGridManager->GetPropertyLabel( prop );
|
||||
sb->SetStatusText ( text );
|
||||
}
|
||||
#endif
|
||||
|
|
@ -768,7 +768,7 @@ void FormMain::OnPropertyGridPageChange( wxPropertyGridEvent& WXUNUSED(event) )
|
|||
#if wxUSE_STATUSBAR
|
||||
wxStatusBar* sb = GetStatusBar();
|
||||
wxString text("Page Changed: ");
|
||||
text += m_pPropGridManager->GetPageName(m_pPropGridManager->GetSelectedPage());
|
||||
text += m_propGridManager->GetPageName(m_propGridManager->GetSelectedPage());
|
||||
sb->SetStatusText( text );
|
||||
#endif
|
||||
}
|
||||
|
|
@ -807,7 +807,7 @@ void FormMain::OnPropertyGridItemRightClick( wxPropertyGridEvent& event )
|
|||
wxString text("Right-clicked: ");
|
||||
text += prop->GetLabel();
|
||||
text += ", name=";
|
||||
text += m_pPropGridManager->GetPropertyName(prop);
|
||||
text += m_propGridManager->GetPropertyName(prop);
|
||||
sb->SetStatusText( text );
|
||||
}
|
||||
else
|
||||
|
|
@ -829,7 +829,7 @@ void FormMain::OnPropertyGridItemDoubleClick( wxPropertyGridEvent& event )
|
|||
wxString text("Double-clicked: ");
|
||||
text += prop->GetLabel();
|
||||
text += ", name=";
|
||||
text += m_pPropGridManager->GetPropertyName(prop);
|
||||
text += m_propGridManager->GetPropertyName(prop);
|
||||
sb->SetStatusText ( text );
|
||||
}
|
||||
else
|
||||
|
|
@ -844,14 +844,14 @@ void FormMain::OnPropertyGridItemDoubleClick( wxPropertyGridEvent& event )
|
|||
void FormMain::OnPropertyGridButtonClick ( wxCommandEvent& )
|
||||
{
|
||||
#if wxUSE_STATUSBAR
|
||||
wxPGProperty* prop = m_pPropGridManager->GetSelection();
|
||||
wxPGProperty* prop = m_propGridManager->GetSelection();
|
||||
wxStatusBar* sb = GetStatusBar();
|
||||
if ( prop )
|
||||
{
|
||||
wxString text("Button clicked: ");
|
||||
text += m_pPropGridManager->GetPropertyLabel(prop);
|
||||
text += m_propGridManager->GetPropertyLabel(prop);
|
||||
text += ", name=";
|
||||
text += m_pPropGridManager->GetPropertyName(prop);
|
||||
text += m_propGridManager->GetPropertyName(prop);
|
||||
sb->SetStatusText( text );
|
||||
}
|
||||
else
|
||||
|
|
@ -927,9 +927,9 @@ void FormMain::OnPropertyGridKeyEvent( wxKeyEvent& WXUNUSED(event) )
|
|||
void FormMain::OnLabelTextChange( wxCommandEvent& WXUNUSED(event) )
|
||||
{
|
||||
// Uncomment following to allow property label modify in real-time
|
||||
// wxPGProperty& p = m_pPropGridManager->GetGrid()->GetSelection();
|
||||
// wxPGProperty& p = m_propGridManager->GetGrid()->GetSelection();
|
||||
// if ( !p.IsOk() ) return;
|
||||
// m_pPropGridManager->SetPropertyLabel( p, m_tcPropLabel->DoGetValue() );
|
||||
// m_propGridManager->SetPropertyLabel( p, m_tcPropLabel->DoGetValue() );
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
|
|
@ -996,7 +996,7 @@ void FormMain::OnTestXRC(wxCommandEvent& WXUNUSED(event))
|
|||
|
||||
void FormMain::OnEnableCommonValues(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
wxPGProperty* prop = m_pPropGridManager->GetSelection();
|
||||
wxPGProperty* prop = m_propGridManager->GetSelection();
|
||||
if ( prop )
|
||||
prop->EnableCommonValue();
|
||||
else
|
||||
|
|
@ -1005,7 +1005,7 @@ void FormMain::OnEnableCommonValues(wxCommandEvent& WXUNUSED(event))
|
|||
|
||||
void FormMain::PopulateWithStandardItems ()
|
||||
{
|
||||
wxPropertyGridPage* pg = m_pPropGridManager->GetPage("Standard Items");
|
||||
wxPropertyGridPage* pg = m_propGridManager->GetPage("Standard Items");
|
||||
|
||||
// Append is ideal way to add items to wxPropertyGrid.
|
||||
pg->Append( new wxPropertyCategory("Appearance",wxPG_LABEL) );
|
||||
|
|
@ -1154,7 +1154,7 @@ void FormMain::PopulateWithStandardItems ()
|
|||
|
||||
void FormMain::PopulateWithExamples ()
|
||||
{
|
||||
wxPropertyGridPage* pg = m_pPropGridManager->GetPage("Examples");
|
||||
wxPropertyGridPage* pg = m_propGridManager->GetPage("Examples");
|
||||
wxPGProperty* pid;
|
||||
wxPGProperty* prop;
|
||||
|
||||
|
|
@ -1594,12 +1594,12 @@ void FormMain::PopulateWithExamples ()
|
|||
|
||||
void FormMain::PopulateWithLibraryConfig ()
|
||||
{
|
||||
wxPropertyGridPage* pg = m_pPropGridManager->GetPage("wxWidgets Library Config");
|
||||
wxPropertyGridPage* pg = m_propGridManager->GetPage("wxWidgets Library Config");
|
||||
|
||||
// Set custom column proportions (here in the sample app we need
|
||||
// to check if the grid has wxPG_SPLITTER_AUTO_CENTER style. You usually
|
||||
// need not to do it in your application).
|
||||
if ( m_pPropGridManager->HasFlag(wxPG_SPLITTER_AUTO_CENTER) )
|
||||
if ( m_propGridManager->HasFlag(wxPG_SPLITTER_AUTO_CENTER) )
|
||||
{
|
||||
pg->SetColumnProportion(0, 3);
|
||||
pg->SetColumnProportion(1, 1);
|
||||
|
|
@ -1611,7 +1611,7 @@ void FormMain::PopulateWithLibraryConfig ()
|
|||
|
||||
wxPGProperty* pid;
|
||||
|
||||
wxFont italicFont = m_pPropGridManager->GetGrid()->GetCaptionFont();
|
||||
wxFont italicFont = m_propGridManager->GetGrid()->GetCaptionFont();
|
||||
italicFont.SetStyle(wxFONTSTYLE_ITALIC);
|
||||
|
||||
wxString italicFontHelp = "Font of this property's wxPGCell has "
|
||||
|
|
@ -1837,11 +1837,11 @@ wxEND_EVENT_TABLE()
|
|||
|
||||
void FormMain::PopulateGrid()
|
||||
{
|
||||
m_pPropGridManager->AddPage("Standard Items");
|
||||
m_propGridManager->AddPage("Standard Items");
|
||||
|
||||
PopulateWithStandardItems();
|
||||
|
||||
m_pPropGridManager->AddPage("wxWidgets Library Config");
|
||||
m_propGridManager->AddPage("wxWidgets Library Config");
|
||||
|
||||
PopulateWithLibraryConfig();
|
||||
|
||||
|
|
@ -1850,7 +1850,7 @@ void FormMain::PopulateGrid()
|
|||
|
||||
// Use wxMyPropertyGridPage (see above) to test the
|
||||
// custom wxPropertyGridPage feature.
|
||||
m_pPropGridManager->AddPage("Examples", wxBitmapBundle(), myPage);
|
||||
m_propGridManager->AddPage("Examples", wxBitmapBundle(), myPage);
|
||||
|
||||
PopulateWithExamples();
|
||||
}
|
||||
|
|
@ -1889,7 +1889,7 @@ void FormMain::CreateGrid( int style, int extraStyle )
|
|||
m_combinedFlags.Add( WXSIZEOF(_fs_windowstyle_labels), _fs_windowstyle_labels, _fs_windowstyle_values );
|
||||
m_combinedFlags.Add( WXSIZEOF(_fs_framestyle_labels), _fs_framestyle_labels, _fs_framestyle_values );
|
||||
|
||||
m_pPropGridManager = new wxPropertyGridManager(m_panel,
|
||||
m_propGridManager = new wxPropertyGridManager(m_panel,
|
||||
// Don't change this into wxID_ANY in the sample, or the
|
||||
// event handling will obviously be broken.
|
||||
PGID, /*wxID_ANY*/
|
||||
|
|
@ -1897,15 +1897,15 @@ void FormMain::CreateGrid( int style, int extraStyle )
|
|||
wxDefaultSize,
|
||||
style );
|
||||
|
||||
m_propGrid = m_pPropGridManager->GetGrid();
|
||||
m_propGrid = m_propGridManager->GetGrid();
|
||||
|
||||
m_pPropGridManager->SetExtraStyle(extraStyle);
|
||||
m_propGridManager->SetExtraStyle(extraStyle);
|
||||
|
||||
// This is the default validation failure behaviour
|
||||
m_pPropGridManager->SetValidationFailureBehavior( wxPGVFBFlags::MarkCell |
|
||||
m_propGridManager->SetValidationFailureBehavior( wxPGVFBFlags::MarkCell |
|
||||
wxPGVFBFlags::ShowMessageBox );
|
||||
|
||||
m_pPropGridManager->GetGrid()->SetVerticalSpacing( 2 );
|
||||
m_propGridManager->GetGrid()->SetVerticalSpacing( 2 );
|
||||
|
||||
//
|
||||
// Set somewhat different unspecified value appearance
|
||||
|
|
@ -1917,26 +1917,26 @@ void FormMain::CreateGrid( int style, int extraStyle )
|
|||
PopulateGrid();
|
||||
|
||||
m_propGrid->MakeColumnEditable(0, m_labelEditingEnabled);
|
||||
m_pPropGridManager->ShowHeader(m_hasHeader);
|
||||
m_propGridManager->ShowHeader(m_hasHeader);
|
||||
if ( m_hasHeader )
|
||||
{
|
||||
m_pPropGridManager->SetColumnTitle(2, "Units");
|
||||
m_propGridManager->SetColumnTitle(2, "Units");
|
||||
}
|
||||
|
||||
// Change some attributes in all properties
|
||||
//m_pPropGridManager->SetPropertyAttributeAll(wxPG_BOOL_USE_DOUBLE_CLICK_CYCLING,true);
|
||||
//m_propGridManager->SetPropertyAttributeAll(wxPG_BOOL_USE_DOUBLE_CLICK_CYCLING,true);
|
||||
|
||||
//m_pPropGridManager->SetSplitterLeft(true);
|
||||
//m_pPropGridManager->SetSplitterPosition(137);
|
||||
//m_propGridManager->SetSplitterLeft(true);
|
||||
//m_propGridManager->SetSplitterPosition(137);
|
||||
}
|
||||
|
||||
void FormMain::ReplaceGrid(int style, int extraStyle)
|
||||
{
|
||||
wxPropertyGridManager* pgmanOld = m_pPropGridManager;
|
||||
wxPropertyGridManager* pgmanOld = m_propGridManager;
|
||||
CreateGrid(style, extraStyle);
|
||||
m_topSizer->Replace(pgmanOld, m_pPropGridManager);
|
||||
m_topSizer->Replace(pgmanOld, m_propGridManager);
|
||||
pgmanOld->Destroy();
|
||||
m_pPropGridManager->SetFocus();
|
||||
m_propGridManager->SetFocus();
|
||||
|
||||
m_panel->Layout();
|
||||
}
|
||||
|
|
@ -1947,7 +1947,7 @@ FormMain::FormMain(const wxString& title)
|
|||
: wxFrame(nullptr, -1, title, wxDefaultPosition, wxDefaultSize,
|
||||
(wxMINIMIZE_BOX|wxMAXIMIZE_BOX|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCAPTION|
|
||||
wxTAB_TRAVERSAL|wxCLOSE_BOX) )
|
||||
, m_pPropGridManager(nullptr)
|
||||
, m_propGridManager(nullptr)
|
||||
, m_propGrid(nullptr)
|
||||
, m_hasHeader(false)
|
||||
, m_labelEditingEnabled(false)
|
||||
|
|
@ -2131,7 +2131,7 @@ FormMain::FormMain(const wxString& title)
|
|||
|
||||
m_topSizer = new wxBoxSizer(wxVERTICAL);
|
||||
|
||||
m_topSizer->Add(m_pPropGridManager, wxSizerFlags(1).Expand());
|
||||
m_topSizer->Add(m_propGridManager, wxSizerFlags(1).Expand());
|
||||
|
||||
// Button for tab traversal testing
|
||||
wxBoxSizer* btnSizer = new wxBoxSizer(wxHORIZONTAL);
|
||||
|
|
@ -2190,13 +2190,13 @@ void FormMain::OnInsertPropClick( wxCommandEvent& WXUNUSED(event) )
|
|||
{
|
||||
wxString propLabel;
|
||||
|
||||
if ( !m_pPropGridManager->GetGrid()->GetRoot()->HasAnyChild() )
|
||||
if ( !m_propGridManager->GetGrid()->GetRoot()->HasAnyChild() )
|
||||
{
|
||||
wxMessageBox("No items to relate - first add some with Append.");
|
||||
return;
|
||||
}
|
||||
|
||||
wxPGProperty* id = m_pPropGridManager->GetGrid()->GetSelection();
|
||||
wxPGProperty* id = m_propGridManager->GetGrid()->GetSelection();
|
||||
if ( !id )
|
||||
{
|
||||
wxMessageBox("First select a property - new one will be inserted right before that.");
|
||||
|
|
@ -2204,9 +2204,9 @@ void FormMain::OnInsertPropClick( wxCommandEvent& WXUNUSED(event) )
|
|||
}
|
||||
if ( propLabel.Len() < 1 ) propLabel = "Property";
|
||||
|
||||
GenerateUniquePropertyLabel( m_pPropGridManager, propLabel );
|
||||
GenerateUniquePropertyLabel( m_propGridManager, propLabel );
|
||||
|
||||
m_pPropGridManager->Insert( m_pPropGridManager->GetPropertyParent(id),
|
||||
m_propGridManager->Insert( m_propGridManager->GetPropertyParent(id),
|
||||
id->GetIndexInParent(),
|
||||
new wxStringProperty(propLabel) );
|
||||
|
||||
|
|
@ -2220,18 +2220,18 @@ void FormMain::OnAppendPropClick( wxCommandEvent& WXUNUSED(event) )
|
|||
|
||||
if ( propLabel.Len() < 1 ) propLabel = "Property";
|
||||
|
||||
GenerateUniquePropertyLabel( m_pPropGridManager, propLabel );
|
||||
GenerateUniquePropertyLabel( m_propGridManager, propLabel );
|
||||
|
||||
m_pPropGridManager->Append( new wxStringProperty(propLabel) );
|
||||
m_propGridManager->Append( new wxStringProperty(propLabel) );
|
||||
|
||||
m_pPropGridManager->Refresh();
|
||||
m_propGridManager->Refresh();
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
|
||||
void FormMain::OnClearClick( wxCommandEvent& WXUNUSED(event) )
|
||||
{
|
||||
m_pPropGridManager->GetGrid()->Clear();
|
||||
m_propGridManager->GetGrid()->Clear();
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
|
|
@ -2242,11 +2242,11 @@ void FormMain::OnAppendCatClick( wxCommandEvent& WXUNUSED(event) )
|
|||
|
||||
if ( propLabel.Len() < 1 ) propLabel = "Category";
|
||||
|
||||
GenerateUniquePropertyLabel( m_pPropGridManager, propLabel );
|
||||
GenerateUniquePropertyLabel( m_propGridManager, propLabel );
|
||||
|
||||
m_pPropGridManager->Append( new wxPropertyCategory (propLabel) );
|
||||
m_propGridManager->Append( new wxPropertyCategory (propLabel) );
|
||||
|
||||
m_pPropGridManager->Refresh();
|
||||
m_propGridManager->Refresh();
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -2256,13 +2256,13 @@ void FormMain::OnInsertCatClick( wxCommandEvent& WXUNUSED(event) )
|
|||
{
|
||||
wxString propLabel;
|
||||
|
||||
if ( !m_pPropGridManager->GetGrid()->GetRoot()->HasAnyChild() )
|
||||
if ( !m_propGridManager->GetGrid()->GetRoot()->HasAnyChild() )
|
||||
{
|
||||
wxMessageBox("No items to relate - first add some with Append.");
|
||||
return;
|
||||
}
|
||||
|
||||
wxPGProperty* id = m_pPropGridManager->GetGrid()->GetSelection();
|
||||
wxPGProperty* id = m_propGridManager->GetGrid()->GetSelection();
|
||||
if ( !id )
|
||||
{
|
||||
wxMessageBox("First select a property - new one will be inserted right before that.");
|
||||
|
|
@ -2271,9 +2271,9 @@ void FormMain::OnInsertCatClick( wxCommandEvent& WXUNUSED(event) )
|
|||
|
||||
if ( propLabel.Len() < 1 ) propLabel = "Category";
|
||||
|
||||
GenerateUniquePropertyLabel( m_pPropGridManager, propLabel );
|
||||
GenerateUniquePropertyLabel( m_propGridManager, propLabel );
|
||||
|
||||
m_pPropGridManager->Insert( m_pPropGridManager->GetPropertyParent(id),
|
||||
m_propGridManager->Insert( m_propGridManager->GetPropertyParent(id),
|
||||
id->GetIndexInParent(),
|
||||
new wxPropertyCategory (propLabel) );
|
||||
}
|
||||
|
|
@ -2282,14 +2282,14 @@ void FormMain::OnInsertCatClick( wxCommandEvent& WXUNUSED(event) )
|
|||
|
||||
void FormMain::OnDelPropClick( wxCommandEvent& WXUNUSED(event) )
|
||||
{
|
||||
wxPGProperty* id = m_pPropGridManager->GetGrid()->GetSelection();
|
||||
wxPGProperty* id = m_propGridManager->GetGrid()->GetSelection();
|
||||
if ( !id )
|
||||
{
|
||||
wxMessageBox("First select a property.");
|
||||
return;
|
||||
}
|
||||
|
||||
m_pPropGridManager->DeleteProperty( id );
|
||||
m_propGridManager->DeleteProperty( id );
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
|
|
@ -2297,7 +2297,7 @@ void FormMain::OnDelPropClick( wxCommandEvent& WXUNUSED(event) )
|
|||
void FormMain::OnDelPropRClick( wxCommandEvent& WXUNUSED(event) )
|
||||
{
|
||||
// Delete random property
|
||||
wxPGProperty* p = m_pPropGridManager->GetGrid()->GetRoot();
|
||||
wxPGProperty* p = m_propGridManager->GetGrid()->GetRoot();
|
||||
std::uniform_int_distribution<unsigned int> distrib(0, 1000);
|
||||
|
||||
for (;;)
|
||||
|
|
@ -2311,7 +2311,7 @@ void FormMain::OnDelPropRClick( wxCommandEvent& WXUNUSED(event) )
|
|||
if ( !p->IsCategory() )
|
||||
{
|
||||
wxString label = p->GetLabel();
|
||||
m_pPropGridManager->DeleteProperty(p);
|
||||
m_propGridManager->DeleteProperty(p);
|
||||
wxLogMessage("Property deleted: %s", label);
|
||||
break;
|
||||
}
|
||||
|
|
@ -2335,7 +2335,7 @@ void FormMain::OnContextMenu( wxContextMenuEvent& event )
|
|||
void FormMain::OnCloseClick( wxCommandEvent& WXUNUSED(event) )
|
||||
{
|
||||
/*#ifdef __WXDEBUG__
|
||||
m_pPropGridManager->GetGrid()->DumpAllocatedChoiceSets();
|
||||
m_propGridManager->GetGrid()->DumpAllocatedChoiceSets();
|
||||
wxLogDebug("\\-> Don't worry, this is perfectly normal in this sample.");
|
||||
#endif*/
|
||||
|
||||
|
|
@ -2360,7 +2360,7 @@ void FormMain::OnIterate1Click( wxCommandEvent& WXUNUSED(event) )
|
|||
{
|
||||
wxPropertyGridIterator it;
|
||||
|
||||
for ( it = m_pPropGridManager->GetCurrentPage()->
|
||||
for ( it = m_propGridManager->GetCurrentPage()->
|
||||
GetIterator();
|
||||
!it.AtEnd();
|
||||
++it )
|
||||
|
|
@ -2377,7 +2377,7 @@ void FormMain::OnIterate2Click( wxCommandEvent& WXUNUSED(event) )
|
|||
{
|
||||
wxPropertyGridIterator it;
|
||||
|
||||
for ( it = m_pPropGridManager->GetCurrentPage()->
|
||||
for ( it = m_propGridManager->GetCurrentPage()->
|
||||
GetIterator( wxPG_ITERATE_VISIBLE );
|
||||
!it.AtEnd();
|
||||
++it )
|
||||
|
|
@ -2396,7 +2396,7 @@ void FormMain::OnIterate3Click( wxCommandEvent& WXUNUSED(event) )
|
|||
// iterate over items in reverse order
|
||||
wxPropertyGridIterator it;
|
||||
|
||||
for ( it = m_pPropGridManager->GetCurrentPage()->
|
||||
for ( it = m_propGridManager->GetCurrentPage()->
|
||||
GetIterator( wxPG_ITERATE_DEFAULT, wxBOTTOM );
|
||||
!it.AtEnd();
|
||||
--it )
|
||||
|
|
@ -2414,7 +2414,7 @@ void FormMain::OnIterate4Click( wxCommandEvent& WXUNUSED(event) )
|
|||
{
|
||||
wxPropertyGridIterator it;
|
||||
|
||||
for ( it = m_pPropGridManager->GetCurrentPage()->
|
||||
for ( it = m_propGridManager->GetCurrentPage()->
|
||||
GetIterator( wxPG_ITERATE_CATEGORIES );
|
||||
!it.AtEnd();
|
||||
++it )
|
||||
|
|
@ -2432,7 +2432,7 @@ void FormMain::OnExtendedKeyNav( wxCommandEvent& WXUNUSED(event) )
|
|||
{
|
||||
// Use AddActionTrigger() and DedicateKey() to set up Enter,
|
||||
// Up, and Down keys for navigating between properties.
|
||||
wxPropertyGrid* propGrid = m_pPropGridManager->GetGrid();
|
||||
wxPropertyGrid* propGrid = m_propGridManager->GetGrid();
|
||||
|
||||
propGrid->AddActionTrigger(wxPGKeyboardAction::NextProperty,
|
||||
WXK_RETURN);
|
||||
|
|
@ -2449,14 +2449,14 @@ void FormMain::OnExtendedKeyNav( wxCommandEvent& WXUNUSED(event) )
|
|||
|
||||
void FormMain::OnFitColumnsClick( wxCommandEvent& WXUNUSED(event) )
|
||||
{
|
||||
wxPropertyGridPage* page = m_pPropGridManager->GetCurrentPage();
|
||||
wxPropertyGridPage* page = m_propGridManager->GetCurrentPage();
|
||||
|
||||
// Remove auto-centering
|
||||
m_pPropGridManager->SetWindowStyle( m_pPropGridManager->GetWindowStyle() & ~wxPG_SPLITTER_AUTO_CENTER);
|
||||
m_propGridManager->SetWindowStyle( m_propGridManager->GetWindowStyle() & ~wxPG_SPLITTER_AUTO_CENTER);
|
||||
|
||||
// Grow manager size just prior fit - otherwise
|
||||
// column information may be lost.
|
||||
wxSize oldGridSize = m_pPropGridManager->GetGrid()->GetClientSize();
|
||||
wxSize oldGridSize = m_propGridManager->GetGrid()->GetClientSize();
|
||||
wxSize oldFullSize = GetSize();
|
||||
SetSize(1000, oldFullSize.y);
|
||||
|
||||
|
|
@ -2474,7 +2474,7 @@ void FormMain::OnFitColumnsClick( wxCommandEvent& WXUNUSED(event) )
|
|||
|
||||
void FormMain::OnChangeFlagsPropItemsClick( wxCommandEvent& WXUNUSED(event) )
|
||||
{
|
||||
wxPGProperty* p = m_pPropGridManager->GetPropertyByName("Window Styles");
|
||||
wxPGProperty* p = m_propGridManager->GetPropertyByName("Window Styles");
|
||||
|
||||
wxPGChoices newChoices;
|
||||
|
||||
|
|
@ -2490,21 +2490,21 @@ void FormMain::OnChangeFlagsPropItemsClick( wxCommandEvent& WXUNUSED(event) )
|
|||
|
||||
void FormMain::OnEnableDisable( wxCommandEvent& )
|
||||
{
|
||||
wxPGProperty* id = m_pPropGridManager->GetGrid()->GetSelection();
|
||||
wxPGProperty* id = m_propGridManager->GetGrid()->GetSelection();
|
||||
if ( !id )
|
||||
{
|
||||
wxMessageBox("First select a property.");
|
||||
return;
|
||||
}
|
||||
|
||||
if ( m_pPropGridManager->IsPropertyEnabled( id ) )
|
||||
if ( m_propGridManager->IsPropertyEnabled( id ) )
|
||||
{
|
||||
m_pPropGridManager->DisableProperty ( id );
|
||||
m_propGridManager->DisableProperty ( id );
|
||||
m_itemEnable->SetItemLabel( "Enable" );
|
||||
}
|
||||
else
|
||||
{
|
||||
m_pPropGridManager->EnableProperty ( id );
|
||||
m_propGridManager->EnableProperty ( id );
|
||||
m_itemEnable->SetItemLabel( "Disable" );
|
||||
}
|
||||
}
|
||||
|
|
@ -2513,32 +2513,32 @@ void FormMain::OnEnableDisable( wxCommandEvent& )
|
|||
|
||||
void FormMain::OnSetReadOnly( wxCommandEvent& WXUNUSED(event) )
|
||||
{
|
||||
wxPGProperty* p = m_pPropGridManager->GetGrid()->GetSelection();
|
||||
wxPGProperty* p = m_propGridManager->GetGrid()->GetSelection();
|
||||
if ( !p )
|
||||
{
|
||||
wxMessageBox("First select a property.");
|
||||
return;
|
||||
}
|
||||
m_pPropGridManager->SetPropertyReadOnly(p);
|
||||
m_propGridManager->SetPropertyReadOnly(p);
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
|
||||
void FormMain::OnHide( wxCommandEvent& WXUNUSED(event) )
|
||||
{
|
||||
wxPGProperty* id = m_pPropGridManager->GetGrid()->GetSelection();
|
||||
wxPGProperty* id = m_propGridManager->GetGrid()->GetSelection();
|
||||
if ( !id )
|
||||
{
|
||||
wxMessageBox("First select a property.");
|
||||
return;
|
||||
}
|
||||
|
||||
m_pPropGridManager->HideProperty( id, true );
|
||||
m_propGridManager->HideProperty( id, true );
|
||||
}
|
||||
|
||||
void FormMain::OnBoolCheckbox(wxCommandEvent& evt)
|
||||
{
|
||||
m_pPropGridManager->SetPropertyAttributeAll(wxPG_BOOL_USE_CHECKBOX, evt.IsChecked());
|
||||
m_propGridManager->SetPropertyAttributeAll(wxPG_BOOL_USE_CHECKBOX, evt.IsChecked());
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
|
|
@ -2548,7 +2548,7 @@ void FormMain::OnBoolCheckbox(wxCommandEvent& evt)
|
|||
void
|
||||
FormMain::OnSetBackgroundColour( wxCommandEvent& event )
|
||||
{
|
||||
wxPropertyGrid* pg = m_pPropGridManager->GetGrid();
|
||||
wxPropertyGrid* pg = m_propGridManager->GetGrid();
|
||||
wxPGProperty* prop = pg->GetSelection();
|
||||
if ( !prop )
|
||||
{
|
||||
|
|
@ -2570,21 +2570,21 @@ FormMain::OnSetBackgroundColour( wxCommandEvent& event )
|
|||
|
||||
void FormMain::OnInsertPage( wxCommandEvent& WXUNUSED(event) )
|
||||
{
|
||||
m_pPropGridManager->AddPage("New Page");
|
||||
m_propGridManager->AddPage("New Page");
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
|
||||
void FormMain::OnRemovePage( wxCommandEvent& WXUNUSED(event) )
|
||||
{
|
||||
m_pPropGridManager->RemovePage(m_pPropGridManager->GetSelectedPage());
|
||||
m_propGridManager->RemovePage(m_propGridManager->GetSelectedPage());
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
|
||||
void FormMain::OnSaveState( wxCommandEvent& WXUNUSED(event) )
|
||||
{
|
||||
m_savedState = m_pPropGridManager->SaveEditableState();
|
||||
m_savedState = m_propGridManager->SaveEditableState();
|
||||
wxLogDebug("Saved editable state string: \"%s\"", m_savedState);
|
||||
}
|
||||
|
||||
|
|
@ -2592,7 +2592,7 @@ void FormMain::OnSaveState( wxCommandEvent& WXUNUSED(event) )
|
|||
|
||||
void FormMain::OnRestoreState( wxCommandEvent& WXUNUSED(event) )
|
||||
{
|
||||
m_pPropGridManager->RestoreEditableState(m_savedState);
|
||||
m_propGridManager->RestoreEditableState(m_savedState);
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
|
|
@ -2600,9 +2600,9 @@ void FormMain::OnRestoreState( wxCommandEvent& WXUNUSED(event) )
|
|||
void FormMain::OnSetSpinCtrlEditorClick( wxCommandEvent& WXUNUSED(event) )
|
||||
{
|
||||
#if wxUSE_SPINBTN
|
||||
wxPGProperty* pgId = m_pPropGridManager->GetSelection();
|
||||
wxPGProperty* pgId = m_propGridManager->GetSelection();
|
||||
if ( pgId )
|
||||
m_pPropGridManager->SetPropertyEditor( pgId, wxPGEditor_SpinCtrl );
|
||||
m_propGridManager->SetPropertyEditor( pgId, wxPGEditor_SpinCtrl );
|
||||
else
|
||||
wxMessageBox("First select a property");
|
||||
#endif
|
||||
|
|
@ -2612,7 +2612,7 @@ void FormMain::OnSetSpinCtrlEditorClick( wxCommandEvent& WXUNUSED(event) )
|
|||
|
||||
void FormMain::OnTestReplaceClick( wxCommandEvent& WXUNUSED(event) )
|
||||
{
|
||||
wxPGProperty* pgId = m_pPropGridManager->GetSelection();
|
||||
wxPGProperty* pgId = m_propGridManager->GetSelection();
|
||||
if ( pgId )
|
||||
{
|
||||
wxPGChoices choices;
|
||||
|
|
@ -2624,20 +2624,20 @@ void FormMain::OnTestReplaceClick( wxCommandEvent& WXUNUSED(event) )
|
|||
// Look for unused property name
|
||||
wxString propName = "ReplaceFlagsProperty";
|
||||
int idx = 0;
|
||||
while ( m_pPropGridManager->GetPropertyByName(propName) )
|
||||
while ( m_propGridManager->GetPropertyByName(propName) )
|
||||
{
|
||||
propName = wxString::Format("ReplaceFlagsProperty %i", ++idx);
|
||||
}
|
||||
// Replace property and select new one
|
||||
// with random value in range [1..maxVal]
|
||||
const long propVal = wxGetLocalTime() % maxVal + 1;
|
||||
wxPGProperty* newId = m_pPropGridManager->ReplaceProperty( pgId,
|
||||
wxPGProperty* newId = m_propGridManager->ReplaceProperty( pgId,
|
||||
new wxFlagsProperty(propName, wxPG_LABEL, choices, propVal) );
|
||||
m_pPropGridManager->SetPropertyAttribute( newId,
|
||||
m_propGridManager->SetPropertyAttribute( newId,
|
||||
wxPG_BOOL_USE_CHECKBOX,
|
||||
true,
|
||||
wxPGPropertyValuesFlags::Recurse );
|
||||
m_pPropGridManager->SelectProperty(newId);
|
||||
m_propGridManager->SelectProperty(newId);
|
||||
}
|
||||
else
|
||||
wxMessageBox("First select a property");
|
||||
|
|
@ -2647,8 +2647,8 @@ void FormMain::OnTestReplaceClick( wxCommandEvent& WXUNUSED(event) )
|
|||
|
||||
void FormMain::OnClearModifyStatusClick( wxCommandEvent& WXUNUSED(event) )
|
||||
{
|
||||
m_pPropGridManager->ClearModifiedStatus();
|
||||
m_pPropGridManager->Refresh();
|
||||
m_propGridManager->ClearModifiedStatus();
|
||||
m_propGridManager->Refresh();
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
|
|
@ -2656,21 +2656,21 @@ void FormMain::OnClearModifyStatusClick( wxCommandEvent& WXUNUSED(event) )
|
|||
// Freeze check-box checked?
|
||||
void FormMain::OnFreezeClick( wxCommandEvent& event )
|
||||
{
|
||||
if ( !m_pPropGridManager ) return;
|
||||
if ( !m_propGridManager ) return;
|
||||
|
||||
if ( event.IsChecked() )
|
||||
{
|
||||
if ( !m_pPropGridManager->IsFrozen() )
|
||||
if ( !m_propGridManager->IsFrozen() )
|
||||
{
|
||||
m_pPropGridManager->Freeze();
|
||||
m_propGridManager->Freeze();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( m_pPropGridManager->IsFrozen() )
|
||||
if ( m_propGridManager->IsFrozen() )
|
||||
{
|
||||
m_pPropGridManager->Thaw();
|
||||
m_pPropGridManager->Refresh();
|
||||
m_propGridManager->Thaw();
|
||||
m_propGridManager->Refresh();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -2689,10 +2689,10 @@ void FormMain::OnEnableLabelEditing(wxCommandEvent& event)
|
|||
void FormMain::OnShowHeader( wxCommandEvent& event )
|
||||
{
|
||||
m_hasHeader = event.IsChecked();
|
||||
m_pPropGridManager->ShowHeader(m_hasHeader);
|
||||
m_propGridManager->ShowHeader(m_hasHeader);
|
||||
if ( m_hasHeader )
|
||||
{
|
||||
m_pPropGridManager->SetColumnTitle(2, "Units");
|
||||
m_propGridManager->SetColumnTitle(2, "Units");
|
||||
}
|
||||
}
|
||||
#endif // wxUSE_HEADERCTRL
|
||||
|
|
@ -2735,31 +2735,31 @@ void FormMain::OnColourScheme( wxCommandEvent& event )
|
|||
int id = event.GetId();
|
||||
if ( id == ID_COLOURSCHEME1 )
|
||||
{
|
||||
m_pPropGridManager->GetGrid()->ResetColours();
|
||||
m_propGridManager->GetGrid()->ResetColours();
|
||||
}
|
||||
else if ( id == ID_COLOURSCHEME2 )
|
||||
{
|
||||
// white
|
||||
wxColour my_grey_1(212,208,200);
|
||||
wxColour my_grey_3(113,111,100);
|
||||
m_pPropGridManager->Freeze();
|
||||
m_pPropGridManager->GetGrid()->SetMarginColour( *wxWHITE );
|
||||
m_pPropGridManager->GetGrid()->SetCaptionBackgroundColour( *wxWHITE );
|
||||
m_pPropGridManager->GetGrid()->SetCellBackgroundColour( *wxWHITE );
|
||||
m_pPropGridManager->GetGrid()->SetCellTextColour( my_grey_3 );
|
||||
m_pPropGridManager->GetGrid()->SetLineColour( my_grey_1 ); //wxColour(160,160,160)
|
||||
m_pPropGridManager->Thaw();
|
||||
m_propGridManager->Freeze();
|
||||
m_propGridManager->GetGrid()->SetMarginColour( *wxWHITE );
|
||||
m_propGridManager->GetGrid()->SetCaptionBackgroundColour( *wxWHITE );
|
||||
m_propGridManager->GetGrid()->SetCellBackgroundColour( *wxWHITE );
|
||||
m_propGridManager->GetGrid()->SetCellTextColour( my_grey_3 );
|
||||
m_propGridManager->GetGrid()->SetLineColour( my_grey_1 ); //wxColour(160,160,160)
|
||||
m_propGridManager->Thaw();
|
||||
}
|
||||
else if ( id == ID_COLOURSCHEME3 )
|
||||
{
|
||||
// .NET
|
||||
wxColour my_grey_1(212,208,200);
|
||||
wxColour my_grey_2(236,233,216);
|
||||
m_pPropGridManager->Freeze();
|
||||
m_pPropGridManager->GetGrid()->SetMarginColour( my_grey_1 );
|
||||
m_pPropGridManager->GetGrid()->SetCaptionBackgroundColour( my_grey_1 );
|
||||
m_pPropGridManager->GetGrid()->SetLineColour( my_grey_1 );
|
||||
m_pPropGridManager->Thaw();
|
||||
m_propGridManager->Freeze();
|
||||
m_propGridManager->GetGrid()->SetMarginColour( my_grey_1 );
|
||||
m_propGridManager->GetGrid()->SetCaptionBackgroundColour( my_grey_1 );
|
||||
m_propGridManager->GetGrid()->SetLineColour( my_grey_1 );
|
||||
m_propGridManager->Thaw();
|
||||
}
|
||||
else if ( id == ID_COLOURSCHEME4 )
|
||||
{
|
||||
|
|
@ -2768,14 +2768,14 @@ void FormMain::OnColourScheme( wxCommandEvent& event )
|
|||
wxColour my_grey_1(212,208,200);
|
||||
wxColour my_grey_2(241,239,226);
|
||||
wxColour my_grey_3(113,111,100);
|
||||
m_pPropGridManager->Freeze();
|
||||
m_pPropGridManager->GetGrid()->SetMarginColour( *wxWHITE );
|
||||
m_pPropGridManager->GetGrid()->SetCaptionBackgroundColour( *wxWHITE );
|
||||
m_pPropGridManager->GetGrid()->SetCellBackgroundColour( my_grey_2 );
|
||||
m_pPropGridManager->GetGrid()->SetCellBackgroundColour( my_grey_2 );
|
||||
m_pPropGridManager->GetGrid()->SetCellTextColour( my_grey_3 );
|
||||
m_pPropGridManager->GetGrid()->SetLineColour( my_grey_1 );
|
||||
m_pPropGridManager->Thaw();
|
||||
m_propGridManager->Freeze();
|
||||
m_propGridManager->GetGrid()->SetMarginColour( *wxWHITE );
|
||||
m_propGridManager->GetGrid()->SetCaptionBackgroundColour( *wxWHITE );
|
||||
m_propGridManager->GetGrid()->SetCellBackgroundColour( my_grey_2 );
|
||||
m_propGridManager->GetGrid()->SetCellBackgroundColour( my_grey_2 );
|
||||
m_propGridManager->GetGrid()->SetCellTextColour( my_grey_3 );
|
||||
m_propGridManager->GetGrid()->SetLineColour( my_grey_1 );
|
||||
m_propGridManager->Thaw();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -2785,7 +2785,7 @@ void FormMain::OnCatColoursUpdateUI(wxUpdateUIEvent& WXUNUSED(event))
|
|||
{
|
||||
// Prevent menu item from being checked
|
||||
// if it is selected from improper page.
|
||||
const wxPropertyGrid* pg = m_pPropGridManager->GetGrid();
|
||||
const wxPropertyGrid* pg = m_propGridManager->GetGrid();
|
||||
m_itemCatColours->SetCheckable(
|
||||
pg->GetPropertyByName("Appearance") &&
|
||||
pg->GetPropertyByName("PositionCategory") &&
|
||||
|
|
@ -2795,7 +2795,7 @@ void FormMain::OnCatColoursUpdateUI(wxUpdateUIEvent& WXUNUSED(event))
|
|||
|
||||
void FormMain::OnCatColours( wxCommandEvent& event )
|
||||
{
|
||||
wxPropertyGrid* pg = m_pPropGridManager->GetGrid();
|
||||
wxPropertyGrid* pg = m_propGridManager->GetGrid();
|
||||
if ( !pg->GetPropertyByName("Appearance") ||
|
||||
!pg->GetPropertyByName("PositionCategory") ||
|
||||
!pg->GetPropertyByName("Environment") ||
|
||||
|
|
@ -2805,7 +2805,7 @@ void FormMain::OnCatColours( wxCommandEvent& event )
|
|||
return;
|
||||
}
|
||||
|
||||
m_pPropGridManager->Freeze();
|
||||
m_propGridManager->Freeze();
|
||||
|
||||
if ( event.IsChecked() )
|
||||
{
|
||||
|
|
@ -2833,8 +2833,8 @@ void FormMain::OnCatColours( wxCommandEvent& event )
|
|||
pg->SetPropertyColoursToDefault( "Environment", wxPGPropertyValuesFlags::Recurse );
|
||||
pg->SetPropertyColoursToDefault( "More Examples", wxPGPropertyValuesFlags::Recurse );
|
||||
}
|
||||
m_pPropGridManager->Thaw();
|
||||
m_pPropGridManager->Refresh();
|
||||
m_propGridManager->Thaw();
|
||||
m_propGridManager->Refresh();
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
|
|
@ -2855,7 +2855,7 @@ void FormMain::OnSelectStyle( wxCommandEvent& WXUNUSED(event) )
|
|||
wxArrayInt vls;
|
||||
wxArrayInt sel;
|
||||
unsigned int ind = 0;
|
||||
int flags = m_pPropGridManager->GetWindowStyle();
|
||||
int flags = m_propGridManager->GetWindowStyle();
|
||||
ADD_FLAG(wxPG_HIDE_CATEGORIES)
|
||||
ADD_FLAG(wxPG_AUTO_SORT)
|
||||
ADD_FLAG(wxPG_BOLD_MODIFIED)
|
||||
|
|
@ -2886,7 +2886,7 @@ void FormMain::OnSelectStyle( wxCommandEvent& WXUNUSED(event) )
|
|||
wxArrayInt vls;
|
||||
wxArrayInt sel;
|
||||
unsigned int ind = 0;
|
||||
int flags = m_pPropGridManager->GetExtraStyle();
|
||||
int flags = m_propGridManager->GetExtraStyle();
|
||||
ADD_FLAG(wxPG_EX_INIT_NOCAT)
|
||||
ADD_FLAG(wxPG_EX_NO_FLAT_TOOLBAR)
|
||||
ADD_FLAG(wxPG_EX_MODE_BUTTONS)
|
||||
|
|
@ -2922,12 +2922,12 @@ void FormMain::OnSelectStyle( wxCommandEvent& WXUNUSED(event) )
|
|||
void FormMain::OnSetColumns( wxCommandEvent& WXUNUSED(event) )
|
||||
{
|
||||
long colCount = ::wxGetNumberFromUser("Enter number of columns (2-20).","Columns:",
|
||||
"Change Columns",m_pPropGridManager->GetColumnCount(),
|
||||
"Change Columns",m_propGridManager->GetColumnCount(),
|
||||
2,20);
|
||||
|
||||
if ( colCount >= 2 )
|
||||
{
|
||||
m_pPropGridManager->SetColumnCount(colCount);
|
||||
m_propGridManager->SetColumnCount(colCount);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -2935,7 +2935,7 @@ void FormMain::OnSetColumns( wxCommandEvent& WXUNUSED(event) )
|
|||
|
||||
void FormMain::OnSetVirtualWidth(wxCommandEvent& WXUNUSED(evt))
|
||||
{
|
||||
long oldWidth = m_pPropGridManager->GetState()->GetVirtualWidth();
|
||||
long oldWidth = m_propGridManager->GetState()->GetVirtualWidth();
|
||||
long newWidth = oldWidth;
|
||||
{
|
||||
wxNumberEntryDialog dlg(this, "Enter virtual width (-1-2000).", "Width:",
|
||||
|
|
@ -2947,7 +2947,7 @@ void FormMain::OnSetVirtualWidth(wxCommandEvent& WXUNUSED(evt))
|
|||
}
|
||||
if ( newWidth != oldWidth )
|
||||
{
|
||||
m_pPropGridManager->GetGrid()->SetVirtualWidth((int)newWidth);
|
||||
m_propGridManager->GetGrid()->SetVirtualWidth((int)newWidth);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -2955,14 +2955,14 @@ void FormMain::OnSetVirtualWidth(wxCommandEvent& WXUNUSED(evt))
|
|||
|
||||
void FormMain::OnSetGridDisabled(wxCommandEvent& evt)
|
||||
{
|
||||
m_pPropGridManager->Enable(!evt.IsChecked());
|
||||
m_propGridManager->Enable(!evt.IsChecked());
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
|
||||
void FormMain::OnSetPropertyValue( wxCommandEvent& WXUNUSED(event) )
|
||||
{
|
||||
wxPropertyGrid* pg = m_pPropGridManager->GetGrid();
|
||||
wxPropertyGrid* pg = m_propGridManager->GetGrid();
|
||||
wxPGProperty* selected = pg->GetSelection();
|
||||
|
||||
if ( selected )
|
||||
|
|
@ -2976,7 +2976,7 @@ void FormMain::OnSetPropertyValue( wxCommandEvent& WXUNUSED(event) )
|
|||
|
||||
void FormMain::OnInsertChoice( wxCommandEvent& WXUNUSED(event) )
|
||||
{
|
||||
wxPropertyGrid* pg = m_pPropGridManager->GetGrid();
|
||||
wxPropertyGrid* pg = m_propGridManager->GetGrid();
|
||||
wxPGProperty* selected = pg->GetSelection();
|
||||
|
||||
if (selected)
|
||||
|
|
@ -3000,7 +3000,7 @@ void FormMain::OnInsertChoice( wxCommandEvent& WXUNUSED(event) )
|
|||
|
||||
void FormMain::OnDeleteChoice( wxCommandEvent& WXUNUSED(event) )
|
||||
{
|
||||
wxPropertyGrid* pg = m_pPropGridManager->GetGrid();
|
||||
wxPropertyGrid* pg = m_propGridManager->GetGrid();
|
||||
wxPGProperty* selected = pg->GetSelection();
|
||||
|
||||
if (selected)
|
||||
|
|
@ -3029,14 +3029,14 @@ void FormMain::OnMisc ( wxCommandEvent& event )
|
|||
int id = event.GetId();
|
||||
if ( id == ID_STATICLAYOUT )
|
||||
{
|
||||
long wsf = m_pPropGridManager->GetWindowStyleFlag();
|
||||
if ( event.IsChecked() ) m_pPropGridManager->SetWindowStyleFlag( wsf|wxPG_STATIC_LAYOUT );
|
||||
else m_pPropGridManager->SetWindowStyleFlag( wsf&~(wxPG_STATIC_LAYOUT) );
|
||||
long wsf = m_propGridManager->GetWindowStyleFlag();
|
||||
if ( event.IsChecked() ) m_propGridManager->SetWindowStyleFlag( wsf|wxPG_STATIC_LAYOUT );
|
||||
else m_propGridManager->SetWindowStyleFlag( wsf&~(wxPG_STATIC_LAYOUT) );
|
||||
}
|
||||
else if ( id == ID_COLLAPSEALL )
|
||||
{
|
||||
wxPGVIterator it;
|
||||
wxPropertyGrid* pg = m_pPropGridManager->GetGrid();
|
||||
wxPropertyGrid* pg = m_propGridManager->GetGrid();
|
||||
|
||||
for ( it = pg->GetVIterator( wxPG_ITERATE_ALL ); !it.AtEnd(); it.Next() )
|
||||
it.GetProperty()->SetExpanded( false );
|
||||
|
|
@ -3045,15 +3045,15 @@ void FormMain::OnMisc ( wxCommandEvent& event )
|
|||
}
|
||||
else if ( id == ID_GETVALUES )
|
||||
{
|
||||
m_storedValues = m_pPropGridManager->GetGrid()->GetPropertyValues("Test",
|
||||
m_pPropGridManager->GetGrid()->GetRoot(),
|
||||
m_storedValues = m_propGridManager->GetGrid()->GetPropertyValues("Test",
|
||||
m_propGridManager->GetGrid()->GetRoot(),
|
||||
wxPGPropertyValuesFlags::KeepStructure|wxPGPropertyValuesFlags::IncAttributes);
|
||||
}
|
||||
else if ( id == ID_SETVALUES )
|
||||
{
|
||||
if ( m_storedValues.IsType("list") )
|
||||
{
|
||||
m_pPropGridManager->GetGrid()->SetPropertyValues(m_storedValues);
|
||||
m_propGridManager->GetGrid()->SetPropertyValues(m_storedValues);
|
||||
}
|
||||
else
|
||||
wxMessageBox("First use Get Property Values.");
|
||||
|
|
@ -3065,23 +3065,23 @@ void FormMain::OnMisc ( wxCommandEvent& event )
|
|||
list.Append( wxVariant(1234L,"VariantLong") );
|
||||
list.Append( wxVariant(true,"VariantBool") );
|
||||
list.Append( wxVariant("Test Text","VariantString") );
|
||||
m_pPropGridManager->GetGrid()->SetPropertyValues(list);
|
||||
m_propGridManager->GetGrid()->SetPropertyValues(list);
|
||||
}
|
||||
else if ( id == ID_COLLAPSE )
|
||||
{
|
||||
// Collapses selected.
|
||||
wxPGProperty* selProp = m_pPropGridManager->GetSelection();
|
||||
wxPGProperty* selProp = m_propGridManager->GetSelection();
|
||||
if ( selProp )
|
||||
{
|
||||
m_pPropGridManager->Collapse(selProp);
|
||||
m_propGridManager->Collapse(selProp);
|
||||
}
|
||||
}
|
||||
else if ( id == ID_UNSPECIFY )
|
||||
{
|
||||
wxPGProperty* prop = m_pPropGridManager->GetSelection();
|
||||
wxPGProperty* prop = m_propGridManager->GetSelection();
|
||||
if ( prop )
|
||||
{
|
||||
m_pPropGridManager->SetPropertyValueUnspecified(prop);
|
||||
m_propGridManager->SetPropertyValueUnspecified(prop);
|
||||
prop->RefreshEditor();
|
||||
}
|
||||
}
|
||||
|
|
@ -3109,7 +3109,7 @@ void FormMain::OnPopulateClick( wxCommandEvent& event )
|
|||
|
||||
void FormMain::OnDumpList(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
wxVariant values = m_pPropGridManager->GetPropertyValues("list", wxNullProperty, wxPGPropertyValuesFlags::IncAttributes);
|
||||
wxVariant values = m_propGridManager->GetPropertyValues("list", wxNullProperty, wxPGPropertyValuesFlags::IncAttributes);
|
||||
wxString text = "This only tests that wxVariant related routines do not crash.\n";
|
||||
|
||||
wxDialog* dlg = new wxDialog(this, wxID_ANY, "wxVariant Test",
|
||||
|
|
|
|||
|
|
@ -100,7 +100,7 @@ public:
|
|||
FormMain(const wxString& title);
|
||||
~FormMain();
|
||||
|
||||
wxPropertyGridManager* m_pPropGridManager;
|
||||
wxPropertyGridManager* m_propGridManager;
|
||||
wxPropertyGrid* m_propGrid;
|
||||
|
||||
wxTextCtrl* m_tcPropLabel;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue