]> git.saurik.com Git - wxWidgets.git/commitdiff
Fixed property Hide command
authorJaakko Salli <jaakko.salli@dnainternet.net>
Thu, 25 Feb 2010 14:04:25 +0000 (14:04 +0000)
committerJaakko Salli <jaakko.salli@dnainternet.net>
Thu, 25 Feb 2010 14:04:25 +0000 (14:04 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63556 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

samples/propgrid/propgrid.cpp
samples/propgrid/propgrid.h

index 37bcde4bd8a77f3b7952cf9289aa466f908ef7e3..0122b230d2bf668a14092fe1fb1bd9f912a8070d 100644 (file)
@@ -750,7 +750,7 @@ BEGIN_EVENT_TABLE(FormMain, wxFrame)
     EVT_MENU( ID_DELETEALL, FormMain::OnClearClick )
     EVT_MENU( ID_ENABLE, FormMain::OnEnableDisable )
     EVT_MENU( ID_SETREADONLY, FormMain::OnSetReadOnly )
     EVT_MENU( ID_DELETEALL, FormMain::OnClearClick )
     EVT_MENU( ID_ENABLE, FormMain::OnEnableDisable )
     EVT_MENU( ID_SETREADONLY, FormMain::OnSetReadOnly )
-    EVT_MENU( ID_HIDE, FormMain::OnHideShow )
+    EVT_MENU( ID_HIDE, FormMain::OnHide )
 
     EVT_MENU( ID_ITERATE1, FormMain::OnIterate1Click )
     EVT_MENU( ID_ITERATE2, FormMain::OnIterate2Click )
 
     EVT_MENU( ID_ITERATE1, FormMain::OnIterate1Click )
     EVT_MENU( ID_ITERATE2, FormMain::OnIterate2Click )
@@ -2289,7 +2289,7 @@ FormMain::FormMain(const wxString& title, const wxPoint& pos, const wxSize& size
     m_itemEnable = menuTools1->Append(ID_ENABLE, wxT("Enable"),
         wxT("Toggles item's enabled state.") );
     m_itemEnable->Enable( FALSE );
     m_itemEnable = menuTools1->Append(ID_ENABLE, wxT("Enable"),
         wxT("Toggles item's enabled state.") );
     m_itemEnable->Enable( FALSE );
-    menuTools1->Append(ID_HIDE, wxT("Hide"), wxT("Shows or hides a property") );
+    menuTools1->Append(ID_HIDE, "Hide", "Hides a property" );
     menuTools1->Append(ID_SETREADONLY, "Set as Read-Only",
                        "Set property as read-only" );
 
     menuTools1->Append(ID_SETREADONLY, "Set as Read-Only",
                        "Set property as read-only" );
 
@@ -2752,7 +2752,7 @@ void FormMain::OnSetReadOnly( wxCommandEvent& WXUNUSED(event) )
 
 // -----------------------------------------------------------------------
 
 
 // -----------------------------------------------------------------------
 
-void FormMain::OnHideShow( wxCommandEvent& WXUNUSED(event) )
+void FormMain::OnHide( wxCommandEvent& WXUNUSED(event) )
 {
     wxPGProperty* id = m_pPropGridManager->GetGrid()->GetSelection();
     if ( !id )
 {
     wxPGProperty* id = m_pPropGridManager->GetGrid()->GetSelection();
     if ( !id )
@@ -2761,27 +2761,7 @@ void FormMain::OnHideShow( wxCommandEvent& WXUNUSED(event) )
         return;
     }
 
         return;
     }
 
-    if ( m_pPropGridManager->IsPropertyShown( id ) )
-    {
-        m_pPropGridManager->HideProperty( id, true );
-        m_itemEnable->SetItemLabel( wxT("Show") );
-    }
-    else
-    {
-        m_pPropGridManager->HideProperty( id, false );
-        m_itemEnable->SetItemLabel( wxT("Hide") );
-    }
-
-    wxPropertyGridPage* curPage = m_pPropGridManager->GetCurrentPage();
-
-    // Check for bottomY precalculation validity
-    unsigned int byPre = curPage->GetVirtualHeight();
-    unsigned int byAct = curPage->GetActualVirtualHeight();
-
-    if ( byPre != byAct )
-    {
-        wxLogDebug(wxT("VirtualHeight is %u, should be %u"), byPre, byAct);
-    }
+    m_pPropGridManager->HideProperty( id, true );
 }
 
 // -----------------------------------------------------------------------
 }
 
 // -----------------------------------------------------------------------
index 3ffb11a7c64deb6f246ad55601c3f401c51d3c13..fb051d3978d05ff9adcf19ae43ce5e78790f4d83 100644 (file)
@@ -186,7 +186,7 @@ public:
 
     void OnEnableDisable( wxCommandEvent& event );
     void OnSetReadOnly( wxCommandEvent& event );
 
     void OnEnableDisable( wxCommandEvent& event );
     void OnSetReadOnly( wxCommandEvent& event );
-    void OnHideShow( wxCommandEvent& event );
+    void OnHide( wxCommandEvent& event );
     void OnSetBackgroundColour( wxCommandEvent& event );
     void OnClearModifyStatusClick( wxCommandEvent& event );
     void OnFreezeClick( wxCommandEvent& event );
     void OnSetBackgroundColour( wxCommandEvent& event );
     void OnClearModifyStatusClick( wxCommandEvent& event );
     void OnFreezeClick( wxCommandEvent& event );