Fix repositioning editors for horizontally scrolled grid

Closes #18313.
This commit is contained in:
Artur Wieczorek
2018-12-28 09:18:06 +01:00
parent 9b7c281e6b
commit 95461c566d
4 changed files with 70 additions and 10 deletions

View File

@@ -1786,6 +1786,7 @@ wxWindow* wxPropertyGrid::GetEditorControl() const
// -----------------------------------------------------------------------
#if WXWIN_COMPATIBILITY_3_0
void wxPropertyGrid::CorrectEditorWidgetSizeX()
{
int secWid = 0;
@@ -1827,6 +1828,32 @@ void wxPropertyGrid::CorrectEditorWidgetSizeX()
if ( m_wndEditor2 )
m_wndEditor2->Refresh();
}
#endif // WXWIN_COMPATIBILITY_3_0
void wxPropertyGrid::CorrectEditorWidgetSizeX(int xPosChange, int widthChange)
{
if ( m_wndEditor2 )
{
// if width change occurred, move secondary wnd by that amount
wxPoint p = m_wndEditor2->GetPosition();
p.x += xPosChange + widthChange;
m_wndEditor2->SetPosition(p);
}
if ( m_wndEditor )
{
wxRect r = m_wndEditor->GetRect();
r.x += xPosChange;
if ( !(m_iFlags & wxPG_FL_FIXED_WIDTH_EDITOR) )
r.width += widthChange;
m_wndEditor->SetSize(r);
}
if ( m_wndEditor2 )
m_wndEditor2->Refresh();
}
// -----------------------------------------------------------------------