Corrected tree ctrl behaviour.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@2509 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -94,9 +94,9 @@ void wxScrolledWindow::SetScrollbars (int pixelsPerUnitX, int pixelsPerUnitY,
|
|||||||
bool do_refresh =
|
bool do_refresh =
|
||||||
(
|
(
|
||||||
(noUnitsX != 0 && m_xScrollLines == 0) ||
|
(noUnitsX != 0 && m_xScrollLines == 0) ||
|
||||||
(noUnitsX < m_xScrollPosition) ||
|
(noUnitsX < m_xScrollLines) ||
|
||||||
(noUnitsY != 0 && m_yScrollLines == 0) ||
|
(noUnitsY != 0 && m_yScrollLines == 0) ||
|
||||||
(noUnitsY < m_yScrollPosition) ||
|
(noUnitsY < m_yScrollLines) ||
|
||||||
(xPos != m_xScrollPosition) ||
|
(xPos != m_xScrollPosition) ||
|
||||||
(yPos != m_yScrollPosition) ||
|
(yPos != m_yScrollPosition) ||
|
||||||
(pixelsPerUnitX != m_xScrollPixelsPerLine) ||
|
(pixelsPerUnitX != m_xScrollPixelsPerLine) ||
|
||||||
@@ -145,7 +145,8 @@ void wxScrolledWindow::SetScrollbars (int pixelsPerUnitX, int pixelsPerUnitY,
|
|||||||
|
|
||||||
AdjustScrollbars();
|
AdjustScrollbars();
|
||||||
|
|
||||||
if (do_refresh && !noRefresh) Refresh();
|
if (do_refresh && !noRefresh)
|
||||||
|
Refresh();
|
||||||
|
|
||||||
#ifdef __WXMSW__
|
#ifdef __WXMSW__
|
||||||
// Necessary?
|
// Necessary?
|
||||||
@@ -456,7 +457,7 @@ void wxScrolledWindow::Scroll( int x_pos, int y_pos )
|
|||||||
SetScrollPos( wxVERTICAL, m_yScrollPosition, TRUE );
|
SetScrollPos( wxVERTICAL, m_yScrollPosition, TRUE );
|
||||||
}
|
}
|
||||||
|
|
||||||
// BAD, BAD, can cause event loops if called from OnPaint(). (KB)
|
// BAD, BAD, can cause event loops if called from OnPaint(). KB.
|
||||||
// Refresh();
|
// Refresh();
|
||||||
|
|
||||||
#ifdef __WXMSW__
|
#ifdef __WXMSW__
|
||||||
|
@@ -950,7 +950,7 @@ void wxTreeCtrl::EnsureVisible(const wxTreeItemId& item)
|
|||||||
int x_pos = GetScrollPos( wxHORIZONTAL );
|
int x_pos = GetScrollPos( wxHORIZONTAL );
|
||||||
SetScrollbars( 10, 10, x/10, y/10, x_pos, (item_y-client_h/2)/10 );
|
SetScrollbars( 10, 10, x/10, y/10, x_pos, (item_y-client_h/2)/10 );
|
||||||
}
|
}
|
||||||
else if (item_y > start_y+client_h-16)
|
else if (item_y > start_y+client_h-20)
|
||||||
{
|
{
|
||||||
int x = 0;
|
int x = 0;
|
||||||
int y = 0;
|
int y = 0;
|
||||||
|
@@ -2858,6 +2858,14 @@ void wxWindow::ScrollWindow( int dx, int dy, const wxRect* WXUNUSED(rect) )
|
|||||||
gdk_gc_set_exposures( m_scrollGC, TRUE );
|
gdk_gc_set_exposures( m_scrollGC, TRUE );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
wxNode *node = m_children.First();
|
||||||
|
while (node)
|
||||||
|
{
|
||||||
|
wxWindow *child = (wxWindow*) node->Data();
|
||||||
|
child->Move( child->m_x + dx, child->m_y + dy );
|
||||||
|
node = node->Next();
|
||||||
|
}
|
||||||
|
|
||||||
int cw = 0;
|
int cw = 0;
|
||||||
int ch = 0;
|
int ch = 0;
|
||||||
GetClientSize( &cw, &ch );
|
GetClientSize( &cw, &ch );
|
||||||
@@ -2890,14 +2898,6 @@ void wxWindow::ScrollWindow( int dx, int dy, const wxRect* WXUNUSED(rect) )
|
|||||||
|
|
||||||
Refresh( TRUE, &rect );
|
Refresh( TRUE, &rect );
|
||||||
}
|
}
|
||||||
|
|
||||||
wxNode *node = m_children.First();
|
|
||||||
while (node)
|
|
||||||
{
|
|
||||||
wxWindow *child = (wxWindow*) node->Data();
|
|
||||||
child->Move( child->m_x + dx, child->m_y + dy );
|
|
||||||
node = node->Next();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxWindow::SetScrolling(bool scroll)
|
void wxWindow::SetScrolling(bool scroll)
|
||||||
|
@@ -2858,6 +2858,14 @@ void wxWindow::ScrollWindow( int dx, int dy, const wxRect* WXUNUSED(rect) )
|
|||||||
gdk_gc_set_exposures( m_scrollGC, TRUE );
|
gdk_gc_set_exposures( m_scrollGC, TRUE );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
wxNode *node = m_children.First();
|
||||||
|
while (node)
|
||||||
|
{
|
||||||
|
wxWindow *child = (wxWindow*) node->Data();
|
||||||
|
child->Move( child->m_x + dx, child->m_y + dy );
|
||||||
|
node = node->Next();
|
||||||
|
}
|
||||||
|
|
||||||
int cw = 0;
|
int cw = 0;
|
||||||
int ch = 0;
|
int ch = 0;
|
||||||
GetClientSize( &cw, &ch );
|
GetClientSize( &cw, &ch );
|
||||||
@@ -2890,14 +2898,6 @@ void wxWindow::ScrollWindow( int dx, int dy, const wxRect* WXUNUSED(rect) )
|
|||||||
|
|
||||||
Refresh( TRUE, &rect );
|
Refresh( TRUE, &rect );
|
||||||
}
|
}
|
||||||
|
|
||||||
wxNode *node = m_children.First();
|
|
||||||
while (node)
|
|
||||||
{
|
|
||||||
wxWindow *child = (wxWindow*) node->Data();
|
|
||||||
child->Move( child->m_x + dx, child->m_y + dy );
|
|
||||||
node = node->Next();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxWindow::SetScrolling(bool scroll)
|
void wxWindow::SetScrolling(bool scroll)
|
||||||
|
Reference in New Issue
Block a user