Fixed and refactored wxPropertyGridManager decsription text box painting
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58705 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -722,11 +722,10 @@ protected:
|
|||||||
|
|
||||||
void UpdateDescriptionBox( int new_splittery, int new_width, int new_height );
|
void UpdateDescriptionBox( int new_splittery, int new_width, int new_height );
|
||||||
|
|
||||||
void RepaintSplitter( wxDC& dc,
|
void RepaintDescBoxDecorations( wxDC& dc,
|
||||||
int new_splittery,
|
int newSplitterY,
|
||||||
int new_width,
|
int newWidth,
|
||||||
int new_height,
|
int newHeight );
|
||||||
bool desc_too );
|
|
||||||
|
|
||||||
void SetDescribedProperty( wxPGProperty* p );
|
void SetDescribedProperty( wxPGProperty* p );
|
||||||
|
|
||||||
|
@@ -981,26 +981,24 @@ bool wxPropertyGridManager::ProcessEvent( wxEvent& event )
|
|||||||
|
|
||||||
// -----------------------------------------------------------------------
|
// -----------------------------------------------------------------------
|
||||||
|
|
||||||
void wxPropertyGridManager::RepaintSplitter( wxDC& dc, int new_splittery, int new_width,
|
void wxPropertyGridManager::RepaintDescBoxDecorations( wxDC& dc,
|
||||||
int new_height, bool desc_too )
|
int newSplitterY,
|
||||||
|
int newWidth,
|
||||||
|
int newHeight )
|
||||||
{
|
{
|
||||||
int use_hei = new_height;
|
|
||||||
|
|
||||||
// Draw background
|
// Draw background
|
||||||
wxColour bgcol = GetBackgroundColour();
|
wxColour bgcol = GetBackgroundColour();
|
||||||
dc.SetBrush( bgcol );
|
dc.SetBrush(bgcol);
|
||||||
dc.SetPen( bgcol );
|
dc.SetPen(bgcol);
|
||||||
int rect_hei = use_hei-new_splittery;
|
int rectHeight = m_splitterHeight;
|
||||||
if ( !desc_too )
|
dc.DrawRectangle(0, newSplitterY, newWidth, rectHeight);
|
||||||
rect_hei = m_splitterHeight;
|
dc.SetPen( wxSystemSettings::GetColour(wxSYS_COLOUR_3DDKSHADOW) );
|
||||||
dc.DrawRectangle(0,new_splittery,new_width,rect_hei);
|
int splitterBottom = newSplitterY + m_splitterHeight - 1;
|
||||||
dc.SetPen ( wxSystemSettings::GetColour ( wxSYS_COLOUR_3DDKSHADOW ) );
|
int boxHeight = newHeight - splitterBottom;
|
||||||
int splitter_bottom = new_splittery+m_splitterHeight - 1;
|
if ( boxHeight > 1 )
|
||||||
int box_height = use_hei-splitter_bottom;
|
dc.DrawRectangle(0, splitterBottom, newWidth, boxHeight);
|
||||||
if ( box_height > 1 )
|
|
||||||
dc.DrawRectangle(0,splitter_bottom,new_width,box_height);
|
|
||||||
else
|
else
|
||||||
dc.DrawLine(0,splitter_bottom,new_width,splitter_bottom);
|
dc.DrawLine(0, splitterBottom, newWidth, splitterBottom);
|
||||||
}
|
}
|
||||||
|
|
||||||
// -----------------------------------------------------------------------
|
// -----------------------------------------------------------------------
|
||||||
@@ -1143,11 +1141,9 @@ void wxPropertyGridManager::OnPaint( wxPaintEvent& WXUNUSED(event) )
|
|||||||
// Update everything inside the box
|
// Update everything inside the box
|
||||||
wxRect r = GetUpdateRegion().GetBox();
|
wxRect r = GetUpdateRegion().GetBox();
|
||||||
|
|
||||||
// Repaint splitter?
|
// Repaint splitter and any other description box decorations
|
||||||
int r_bottom = r.y + r.height;
|
if ( (r.y + r.height) >= m_splitterY )
|
||||||
int splitter_bottom = m_splitterY + m_splitterHeight;
|
RepaintDescBoxDecorations( dc, m_splitterY, m_width, m_height );
|
||||||
if ( r.y < splitter_bottom && r_bottom >= m_splitterY )
|
|
||||||
RepaintSplitter( dc, m_splitterY, m_width, m_height, false );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// -----------------------------------------------------------------------
|
// -----------------------------------------------------------------------
|
||||||
|
Reference in New Issue
Block a user