Use getter functions to get access to some properties of wxPropertyGrid.
Use existing GetFontHeight(), GetRowHeight(), GetCaptionFont(), GetMarginWidth(), HasFlag(), GetParent() functions instead of getting direct access to corresponding member variables.
This commit is contained in:
@@ -1260,7 +1260,7 @@ void wxPropertyGridManager::UpdateDescriptionBox( int new_splittery, int new_wid
|
||||
use_hei--;
|
||||
|
||||
// Fix help control positions.
|
||||
int cap_hei = m_pPropGrid->m_fontHeight;
|
||||
int cap_hei = m_pPropGrid->GetFontHeight();
|
||||
int cap_y = new_splittery+m_splitterHeight+5;
|
||||
int cnt_y = cap_y+cap_hei+3;
|
||||
int sub_cap_hei = cap_y+cap_hei-use_hei;
|
||||
@@ -1350,7 +1350,7 @@ void wxPropertyGridManager::RecalculatePositions( int width, int height )
|
||||
}
|
||||
|
||||
// Check if beyond minimum.
|
||||
int nspy_min = propgridY + m_pPropGrid->m_lineHeight;
|
||||
int nspy_min = propgridY + m_pPropGrid->GetRowHeight();
|
||||
if ( new_splittery < nspy_min )
|
||||
new_splittery = nspy_min;
|
||||
|
||||
@@ -1642,7 +1642,7 @@ void wxPropertyGridManager::RecreateControls()
|
||||
wxDefaultPosition,
|
||||
wxDefaultSize,
|
||||
wxALIGN_LEFT|wxST_NO_AUTORESIZE);
|
||||
m_pTxtHelpCaption->SetFont( m_pPropGrid->m_captionFont );
|
||||
m_pTxtHelpCaption->SetFont(m_pPropGrid->GetCaptionFont());
|
||||
m_pTxtHelpCaption->SetCursor( *wxSTANDARD_CURSOR );
|
||||
}
|
||||
if ( !m_pTxtHelpContent )
|
||||
@@ -1726,7 +1726,7 @@ void wxPropertyGridManager::OnToolbarClick( wxCommandEvent &event )
|
||||
if ( id == m_categorizedModeToolId )
|
||||
{
|
||||
// Categorized mode.
|
||||
if ( m_pPropGrid->m_windowStyle & wxPG_HIDE_CATEGORIES )
|
||||
if ( m_pPropGrid->HasFlag(wxPG_HIDE_CATEGORIES) )
|
||||
{
|
||||
if ( !m_pPropGrid->HasInternalFlag(wxPG_FL_CATMODE_AUTO_SORT) )
|
||||
m_pPropGrid->m_windowStyle &= ~wxPG_AUTO_SORT;
|
||||
@@ -1736,7 +1736,7 @@ void wxPropertyGridManager::OnToolbarClick( wxCommandEvent &event )
|
||||
else if ( id == m_alphabeticModeToolId )
|
||||
{
|
||||
// Alphabetic mode.
|
||||
if ( !(m_pPropGrid->m_windowStyle & wxPG_HIDE_CATEGORIES) )
|
||||
if ( !m_pPropGrid->HasFlag(wxPG_HIDE_CATEGORIES) )
|
||||
{
|
||||
if ( m_pPropGrid->HasFlag(wxPG_AUTO_SORT) )
|
||||
m_pPropGrid->SetInternalFlag(wxPG_FL_CATMODE_AUTO_SORT);
|
||||
@@ -1868,7 +1868,7 @@ void wxPropertyGridManager::SetSplitterLeft( bool subProps, bool allPages )
|
||||
for ( i=0; i<GetPageCount(); i++ )
|
||||
{
|
||||
int maxW = m_pState->GetColumnFitWidth(dc, m_arrPages[i]->m_properties, 0, subProps );
|
||||
maxW += m_pPropGrid->m_marginWidth;
|
||||
maxW += m_pPropGrid->GetMarginWidth();
|
||||
if ( maxW > highest )
|
||||
highest = maxW;
|
||||
m_pState->m_dontCenterSplitter = true;
|
||||
@@ -1895,7 +1895,7 @@ void wxPropertyGridManager::SetPageSplitterLeft(int page, bool subProps)
|
||||
dc.SetFont(m_pPropGrid->GetFont());
|
||||
|
||||
int maxW = m_pState->GetColumnFitWidth(dc, m_arrPages[page]->m_properties, 0, subProps );
|
||||
maxW += m_pPropGrid->m_marginWidth;
|
||||
maxW += m_pPropGrid->GetMarginWidth();
|
||||
SetPageSplitterPosition( page, maxW );
|
||||
|
||||
#if wxUSE_HEADERCTRL
|
||||
@@ -1965,7 +1965,7 @@ void wxPropertyGridManager::OnResize( wxSizeEvent& WXUNUSED(event) )
|
||||
|
||||
RecalculatePositions(width, height);
|
||||
|
||||
if ( m_pPropGrid && m_pPropGrid->m_parent )
|
||||
if ( m_pPropGrid && m_pPropGrid->GetParent() )
|
||||
{
|
||||
int pgWidth, pgHeight;
|
||||
m_pPropGrid->GetClientSize(&pgWidth, &pgHeight);
|
||||
@@ -2014,7 +2014,7 @@ void wxPropertyGridManager::OnMouseMove( wxMouseEvent &event )
|
||||
|
||||
// Calculate drag limits
|
||||
int bottom_limit = m_height - m_splitterHeight + 1;
|
||||
int top_limit = m_pPropGrid->m_lineHeight;
|
||||
int top_limit = m_pPropGrid->GetRowHeight();
|
||||
#if wxUSE_TOOLBAR
|
||||
if ( m_pToolbar ) top_limit += m_pToolbar->GetSize().y;
|
||||
#endif
|
||||
|
@@ -764,7 +764,7 @@ wxPGProperty* wxPropertyGridPageState::DoGetItemAtY( int y ) const
|
||||
return NULL;
|
||||
|
||||
unsigned int a = 0;
|
||||
return m_properties->GetItemAtY(y, GetGrid()->m_lineHeight, &a);
|
||||
return m_properties->GetItemAtY(y, GetGrid()->GetRowHeight(), &a);
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
@@ -849,7 +849,7 @@ int wxPropertyGridPageState::GetColumnFullWidth( wxClientDC &dc, wxPGProperty *p
|
||||
|
||||
int wxPropertyGridPageState::DoGetSplitterPosition( int splitterColumn ) const
|
||||
{
|
||||
int n = GetGrid()->m_marginWidth;
|
||||
int n = GetGrid()->GetMarginWidth();
|
||||
int i;
|
||||
for ( i=0; i<=splitterColumn; i++ )
|
||||
n += m_colWidths[i];
|
||||
@@ -961,7 +961,7 @@ void wxPropertyGridPageState::SetSplitterLeft( bool subProps )
|
||||
|
||||
if ( maxW > 0 )
|
||||
{
|
||||
maxW += pg->m_marginWidth;
|
||||
maxW += pg->GetMarginWidth();
|
||||
DoSetSplitterPosition( maxW );
|
||||
}
|
||||
|
||||
@@ -974,7 +974,7 @@ wxSize wxPropertyGridPageState::DoFitColumns( bool WXUNUSED(allowGridResize) )
|
||||
wxClientDC dc(pg);
|
||||
dc.SetFont(pg->GetFont());
|
||||
|
||||
int marginWidth = pg->m_marginWidth;
|
||||
int marginWidth = pg->GetMarginWidth();
|
||||
int accWid = marginWidth;
|
||||
int maxColWidth = 500;
|
||||
|
||||
@@ -1051,7 +1051,7 @@ void wxPropertyGridPageState::CheckColumnWidths( int widthChange )
|
||||
}
|
||||
}
|
||||
|
||||
int colsWidth = pg->m_marginWidth;
|
||||
int colsWidth = pg->GetMarginWidth();
|
||||
for ( i=0; i<m_colWidths.size(); i++ )
|
||||
colsWidth += m_colWidths[i];
|
||||
|
||||
@@ -1224,7 +1224,7 @@ void wxPropertyGridPageState::DoSetColumnProportion( unsigned int column,
|
||||
// Returns column index, -1 for margin
|
||||
int wxPropertyGridPageState::HitTestH( int x, int* pSplitterHit, int* pSplitterHitOffset ) const
|
||||
{
|
||||
int cx = GetGrid()->m_marginWidth;
|
||||
int cx = GetGrid()->GetMarginWidth();
|
||||
int col = -1;
|
||||
int prevSplitter = -1;
|
||||
|
||||
|
Reference in New Issue
Block a user