Override Do{Freeze,Thaw}() instead of {Freeze,Thaw}() in wxPropGrid code.

{Freeze,Thaw}() themselves are not virtual any more, so overriding them
doesn't really work and it is unnecessary to reimplement the reference
counting already done by the base class anyhow, so override the DoXXX()
versions instead.

Closes #15877.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75640 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2014-01-17 18:56:13 +00:00
parent 726d6f006e
commit fb730c32b4
5 changed files with 28 additions and 59 deletions

View File

@@ -373,7 +373,6 @@ void wxPropertyGrid::Init1()
AddActionTrigger( wxPG_ACTION_PRESS_BUTTON, WXK_F4 );
m_coloursCustomized = 0;
m_frozen = 0;
m_doubleBuffer = NULL;
@@ -607,7 +606,7 @@ void wxPropertyGrid::SetWindowStyleFlag( long style )
//
// Autosort enabled
//
if ( !m_frozen )
if ( !IsFrozen() )
PrepareAfterItemsAdded();
else
m_pState->m_itemsAdded = 1;
@@ -648,24 +647,11 @@ void wxPropertyGrid::SetWindowStyleFlag( long style )
// -----------------------------------------------------------------------
void wxPropertyGrid::Freeze()
void wxPropertyGrid::DoThaw()
{
if ( !m_frozen )
if ( !IsFrozen() )
{
wxControl::Freeze();
}
m_frozen++;
}
// -----------------------------------------------------------------------
void wxPropertyGrid::Thaw()
{
m_frozen--;
if ( !m_frozen )
{
wxControl::Thaw();
wxControl::DoThaw();
RecalculateVirtualSize();
Refresh();
@@ -1920,7 +1906,7 @@ void wxPropertyGrid::DrawItems( wxDC& dc,
unsigned int bottomItemY,
const wxRect* itemsRect )
{
if ( m_frozen ||
if ( IsFrozen() ||
m_height < 1 ||
bottomItemY < topItemY ||
!m_pState )
@@ -2028,7 +2014,7 @@ int wxPropertyGrid::DoDrawItems( wxDC& dc,
if ( !lastItem )
lastItem = GetLastItem( wxPG_ITERATE_VISIBLE );
if ( m_frozen || m_height < 1 || firstItem == NULL )
if ( IsFrozen() || m_height < 1 || firstItem == NULL )
return itemsRect->y;
wxCHECK_MSG( !m_pState->m_itemsAdded, itemsRect->y,
@@ -2554,7 +2540,7 @@ wxRect wxPropertyGrid::GetPropertyRect( const wxPGProperty* p1, const wxPGProper
void wxPropertyGrid::DrawItems( const wxPGProperty* p1, const wxPGProperty* p2 )
{
if ( m_frozen )
if ( IsFrozen() )
return;
if ( m_pState->m_itemsAdded )
@@ -2592,7 +2578,7 @@ void wxPropertyGrid::RefreshProperty( wxPGProperty* p )
void wxPropertyGrid::DrawItemAndValueRelated( wxPGProperty* p )
{
if ( m_frozen )
if ( IsFrozen() )
return;
// Draw item, children, and parent too, if it is not category
@@ -2618,7 +2604,7 @@ void wxPropertyGrid::DrawItemAndChildren( wxPGProperty* p )
return;
// do not draw a single item if multiple pending
if ( m_pState->m_itemsAdded || m_frozen )
if ( m_pState->m_itemsAdded || IsFrozen() )
return;
// Update child control.
@@ -2662,7 +2648,7 @@ void wxPropertyGrid::Clear()
RecalculateVirtualSize();
// Need to clear some area at the end
if ( !m_frozen )
if ( !IsFrozen() )
RefreshRect(wxRect(0, 0, m_width, m_height));
}
@@ -2691,7 +2677,7 @@ bool wxPropertyGrid::EnableCategories( bool enable )
if ( !m_pState->EnableCategories(enable) )
return false;
if ( !m_frozen )
if ( !IsFrozen() )
{
if ( m_windowStyle & wxPG_AUTO_SORT )
{
@@ -2763,7 +2749,7 @@ void wxPropertyGrid::SwitchState( wxPropertyGridPageState* pNewState )
// This should refresh as well.
EnableCategories( orig_mode?false:true );
}
else if ( !m_frozen )
else if ( !IsFrozen() )
{
// Refresh, if not frozen.
m_pState->PrepareAfterItemsAdded();
@@ -4029,7 +4015,7 @@ bool wxPropertyGrid::DoSelectProperty( wxPGProperty* p, unsigned int flags )
wxWindow* primaryCtrl = NULL;
// If we are frozen, then just set the values.
if ( m_frozen )
if ( IsFrozen() )
{
m_iFlags &= ~(wxPG_FL_ABNORMAL_EDITOR);
m_editorFocused = 0;
@@ -4341,7 +4327,7 @@ bool wxPropertyGrid::UnfocusEditor()
{
wxPGProperty* selected = GetSelection();
if ( !selected || !m_wndEditor || m_frozen )
if ( !selected || !m_wndEditor || IsFrozen() )
return true;
if ( !CommitChangesFromEditor(0) )
@@ -4463,7 +4449,7 @@ bool wxPropertyGrid::DoExpand( wxPGProperty* p, bool sendEvents )
bool wxPropertyGrid::DoHideProperty( wxPGProperty* p, bool hide, int flags )
{
if ( m_frozen )
if ( IsFrozen() )
return m_pState->DoHideProperty(p, hide, flags);
wxArrayPGProperty selection = m_pState->m_selection; // Must use a copy
@@ -4497,7 +4483,7 @@ void wxPropertyGrid::RecalculateVirtualSize( int forceXPos )
// Don't check for !HasInternalFlag(wxPG_FL_INITIALIZED) here. Otherwise
// virtual size calculation may go wrong.
if ( HasInternalFlag(wxPG_FL_RECALCULATING_VIRTUAL_SIZE) ||
m_frozen ||
IsFrozen() ||
!m_pState )
return;
@@ -4614,7 +4600,7 @@ void wxPropertyGrid::OnResize( wxSizeEvent& event )
m_pState->OnClientWidthChange( width, event.GetSize().x - m_ncWidth, true );
m_ncWidth = event.GetSize().x;
if ( !m_frozen )
if ( !IsFrozen() )
{
if ( m_pState->m_itemsAdded )
PrepareAfterItemsAdded();
@@ -5544,7 +5530,7 @@ void wxPropertyGrid::HandleKeyEvent( wxKeyEvent &event, bool fromChild )
// Handles key event when editor control is not focused.
//
wxCHECK2(!m_frozen, return);
wxCHECK2(!IsFrozen(), return);
// Travelsal between items, collapsing/expanding, etc.
wxPGProperty* selected = GetSelection();