Use HasExtraStyle() function to examine extra wxPG flags.
This dedicated function to check the extra flag is used instead of doing explicit check of the value returned by GetExtraStyle() function.
This commit is contained in:
@@ -1001,12 +1001,12 @@ wxPropertyGridPage* wxPropertyGridManager::InsertPage( int index,
|
||||
if ( !m_pToolbar )
|
||||
RecreateControls();
|
||||
|
||||
if ( !(GetExtraStyle()&wxPG_EX_HIDE_PAGE_BUTTONS) )
|
||||
if ( !HasExtraStyle(wxPG_EX_HIDE_PAGE_BUTTONS) )
|
||||
{
|
||||
wxASSERT( m_pToolbar );
|
||||
|
||||
// Add separator before first page.
|
||||
if ( GetPageCount() < 2 && (GetExtraStyle()&wxPG_EX_MODE_BUTTONS) &&
|
||||
if ( GetPageCount() < 2 && HasExtraStyle(wxPG_EX_MODE_BUTTONS) &&
|
||||
m_pToolbar->GetToolsCount() < 3 )
|
||||
m_pToolbar->AddSeparator();
|
||||
|
||||
@@ -1167,11 +1167,11 @@ bool wxPropertyGridManager::RemovePage( int page )
|
||||
{
|
||||
wxASSERT( m_pToolbar );
|
||||
|
||||
int toolPos = GetExtraStyle() & wxPG_EX_MODE_BUTTONS ? 3 : 0;
|
||||
int toolPos = HasExtraStyle(wxPG_EX_MODE_BUTTONS) ? 3 : 0;
|
||||
toolPos += page;
|
||||
|
||||
// Delete separator as well, for consistency
|
||||
if ( (GetExtraStyle() & wxPG_EX_MODE_BUTTONS) &&
|
||||
if ( HasExtraStyle(wxPG_EX_MODE_BUTTONS) &&
|
||||
GetPageCount() == 1 )
|
||||
m_pToolbar->DeleteToolByPos(2);
|
||||
|
||||
@@ -1313,7 +1313,7 @@ void wxPropertyGridManager::RecalculatePositions( int width, int height )
|
||||
m_pToolbar->SetSize(0, 0, width, -1);
|
||||
propgridY += m_pToolbar->GetSize().y;
|
||||
|
||||
if (GetExtraStyle() & wxPG_EX_TOOLBAR_SEPARATOR)
|
||||
if ( HasExtraStyle(wxPG_EX_TOOLBAR_SEPARATOR) )
|
||||
propgridY += 1;
|
||||
}
|
||||
#endif
|
||||
@@ -1404,7 +1404,7 @@ void wxPropertyGridManager::OnPaint( wxPaintEvent& WXUNUSED(event) )
|
||||
// Update everything inside the box
|
||||
wxRect r = GetUpdateRegion().GetBox();
|
||||
|
||||
if (GetExtraStyle() & wxPG_EX_TOOLBAR_SEPARATOR)
|
||||
if ( HasExtraStyle(wxPG_EX_TOOLBAR_SEPARATOR) )
|
||||
{
|
||||
if (m_pToolbar && m_pPropGrid)
|
||||
{
|
||||
@@ -1459,8 +1459,8 @@ void wxPropertyGridManager::RecreateControls()
|
||||
// Has toolbar.
|
||||
if ( !m_pToolbar )
|
||||
{
|
||||
long toolBarFlags = ((GetExtraStyle()&wxPG_EX_NO_FLAT_TOOLBAR)?0:wxTB_FLAT);
|
||||
if (GetExtraStyle() & wxPG_EX_NO_TOOLBAR_DIVIDER)
|
||||
long toolBarFlags = HasExtraStyle(wxPG_EX_NO_FLAT_TOOLBAR)? 0: wxTB_FLAT;
|
||||
if ( HasExtraStyle(wxPG_EX_NO_TOOLBAR_DIVIDER) )
|
||||
toolBarFlags |= wxTB_NODIVIDER;
|
||||
|
||||
m_pToolbar = new wxToolBar(this, wxID_ANY,
|
||||
@@ -1492,7 +1492,7 @@ void wxPropertyGridManager::RecreateControls()
|
||||
m_alphabeticModeToolId = -1;
|
||||
}
|
||||
|
||||
if ( (GetExtraStyle()&wxPG_EX_MODE_BUTTONS) )
|
||||
if ( HasExtraStyle(wxPG_EX_MODE_BUTTONS) )
|
||||
{
|
||||
// Add buttons if they don't already exist.
|
||||
if (m_categorizedModeToolId == -1)
|
||||
@@ -1573,7 +1573,7 @@ void wxPropertyGridManager::RecreateControls()
|
||||
m_pToolbar->Realize();
|
||||
}
|
||||
|
||||
if ( (GetExtraStyle() & wxPG_EX_MODE_BUTTONS) )
|
||||
if ( HasExtraStyle(wxPG_EX_MODE_BUTTONS) )
|
||||
{
|
||||
// Toggle correct mode button.
|
||||
// TODO: This doesn't work in wxMSW (when changing,
|
||||
|
@@ -637,7 +637,7 @@ void wxPGProperty::InitAfterAdded( wxPropertyGridPageState* pageState,
|
||||
child->InitAfterAdded(pageState, pageState->GetGrid());
|
||||
}
|
||||
|
||||
if ( propgrid && (propgrid->GetExtraStyle() & wxPG_EX_AUTO_UNSPECIFIED_VALUES) )
|
||||
if ( propgrid && propgrid->HasExtraStyle(wxPG_EX_AUTO_UNSPECIFIED_VALUES) )
|
||||
SetFlagRecursively(wxPG_PROP_AUTO_UNSPECIFIED, true);
|
||||
}
|
||||
}
|
||||
|
@@ -547,7 +547,7 @@ wxPropertyGrid::~wxPropertyGrid()
|
||||
ReleaseMouse();
|
||||
|
||||
// Call with NULL to disconnect event handling
|
||||
if ( GetExtraStyle() & wxPG_EX_ENABLE_TLP_TRACKING )
|
||||
if ( HasExtraStyle(wxPG_EX_ENABLE_TLP_TRACKING) )
|
||||
{
|
||||
OnTLPChanging(NULL);
|
||||
|
||||
@@ -715,7 +715,7 @@ bool wxPropertyGrid::DoAddToSelection( wxPGProperty* prop, int selFlags )
|
||||
{
|
||||
wxCHECK( prop, false );
|
||||
|
||||
if ( !(GetExtraStyle() & wxPG_EX_MULTIPLE_SELECTION) )
|
||||
if ( !HasExtraStyle(wxPG_EX_MULTIPLE_SELECTION) )
|
||||
return DoSelectProperty(prop, selFlags);
|
||||
|
||||
wxArrayPGProperty& selection = m_pState->m_selection;
|
||||
@@ -824,7 +824,7 @@ bool wxPropertyGrid::AddToSelectionFromInputEvent( wxPGProperty* prop,
|
||||
// Set to 2 if also add all items in between
|
||||
int addToExistingSelection = 0;
|
||||
|
||||
if ( GetExtraStyle() & wxPG_EX_MULTIPLE_SELECTION )
|
||||
if ( HasExtraStyle(wxPG_EX_MULTIPLE_SELECTION) )
|
||||
{
|
||||
if ( mouseEvent )
|
||||
{
|
||||
@@ -1858,7 +1858,7 @@ wxPGProperty* wxPropertyGrid::DoGetItemAtY( int y ) const
|
||||
void wxPropertyGrid::OnPaint( wxPaintEvent& WXUNUSED(event) )
|
||||
{
|
||||
wxDC* dcPtr = NULL;
|
||||
if ( !(GetExtraStyle() & wxPG_EX_NATIVE_DOUBLE_BUFFERING) )
|
||||
if ( !HasExtraStyle(wxPG_EX_NATIVE_DOUBLE_BUFFERING) )
|
||||
{
|
||||
if ( m_doubleBuffer )
|
||||
{
|
||||
@@ -4346,7 +4346,7 @@ bool wxPropertyGrid::DoSelectProperty( wxPGProperty* p, unsigned int flags )
|
||||
if ( p )
|
||||
pHelpString = &p->GetHelpString();
|
||||
|
||||
if ( !(GetExtraStyle() & wxPG_EX_HELP_AS_TOOLTIPS) )
|
||||
if ( !HasExtraStyle(wxPG_EX_HELP_AS_TOOLTIPS) )
|
||||
{
|
||||
#if wxUSE_STATUSBAR
|
||||
|
||||
@@ -4650,7 +4650,7 @@ void wxPropertyGrid::OnResize( wxSizeEvent& event )
|
||||
m_width = width;
|
||||
m_height = height;
|
||||
|
||||
if ( !(GetExtraStyle() & wxPG_EX_NATIVE_DOUBLE_BUFFERING) )
|
||||
if ( !HasExtraStyle(wxPG_EX_NATIVE_DOUBLE_BUFFERING) )
|
||||
{
|
||||
int dblh = (m_lineHeight*2);
|
||||
if ( !m_doubleBuffer )
|
||||
@@ -5107,7 +5107,7 @@ bool wxPropertyGrid::HandleMouseMove( int x, unsigned int y,
|
||||
if ( m_propHover && !m_propHover->IsCategory() )
|
||||
{
|
||||
|
||||
if ( GetExtraStyle() & wxPG_EX_HELP_AS_TOOLTIPS )
|
||||
if ( HasExtraStyle(wxPG_EX_HELP_AS_TOOLTIPS) )
|
||||
{
|
||||
// Show help string as a tooltip
|
||||
wxString tipString = m_propHover->GetHelpString();
|
||||
@@ -5196,7 +5196,7 @@ bool wxPropertyGrid::HandleMouseMove( int x, unsigned int y,
|
||||
//
|
||||
// Multi select by dragging
|
||||
//
|
||||
if ( (GetExtraStyle() & wxPG_EX_MULTIPLE_SELECTION) &&
|
||||
if ( HasExtraStyle(wxPG_EX_MULTIPLE_SELECTION) &&
|
||||
event.LeftIsDown() &&
|
||||
m_propHover &&
|
||||
GetSelection() &&
|
||||
@@ -5891,7 +5891,7 @@ void wxPropertyGrid::OnIdle( wxIdleEvent& WXUNUSED(event) )
|
||||
|
||||
//
|
||||
// Check if top-level parent has changed
|
||||
if ( GetExtraStyle() & wxPG_EX_ENABLE_TLP_TRACKING )
|
||||
if ( HasExtraStyle(wxPG_EX_ENABLE_TLP_TRACKING) )
|
||||
{
|
||||
wxWindow* tlp = ::wxGetTopLevelParent(this);
|
||||
if ( tlp != m_tlp )
|
||||
|
Reference in New Issue
Block a user