1. big wxScrollBar optimization: Refresh() doesn't refresh them any more

2. many fixes to refresh scrollbars when needed (as this is not done all
   the time now)
3. wxStdButtonInputHandler bug with uninit m_hasMouse fixing bug with
   moving mouse with pressed left button into button
4. wxRadioBox::SetSelection() and wxRadioButton::SetValue() clear the
   values of the other buttons in the same radio group
5. wxTextCtrl::RefreshPixelRange() calculates the end of line correctly
6. tons of wxListBox fixes
7. removed confusing "Create" button from the lbox sample, listbox is now
   recreated on the fly


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/wxUNIVERSAL@8615 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2000-10-23 01:45:21 +00:00
parent 1f720ce54b
commit d131b63b6d
16 changed files with 243 additions and 128 deletions

View File

@@ -41,6 +41,12 @@
#include "wx/univ/inphand.h"
#include "wx/univ/theme.h"
#define WXDEBUG_SCROLLBAR
#ifndef __WXDEBUG__
#undef WXDEBUG_SCROLLBAR
#endif // !__WXDEBUG__
// ----------------------------------------------------------------------------
// wxScrollBarTimer: this class is used to repeatedly scroll the scrollbar
// when the mouse is help pressed on the arrow or on the bar. It generates the
@@ -196,13 +202,23 @@ void wxScrollBar::SetScrollbar(int position, int thumbSize,
int range, int pageSize,
bool refresh)
{
// we only refresh everythign when the range changes, thumb position
// changes are handled in OnIdle
bool needsRefresh = (range != m_range) ||
(thumbSize != m_thumbSize) ||
(pageSize != m_pageSize);
// set all parameters
m_range = range;
m_thumbSize = thumbSize;
SetThumbPosition(position);
m_pageSize = pageSize;
if ( refresh )
// ignore refresh parameter unless we really need to refresh everything -
// there ir a lot of existing code which just calls SetScrollbar() without
// specifying the last parameter even though it doesn't need at all to
// refresh the window immediately
if ( refresh && needsRefresh )
{
// and update the window
Refresh();
@@ -271,6 +287,23 @@ void wxScrollBar::OnIdle(wxIdleEvent& event)
#endif // 0/1
}
#ifdef WXDEBUG_SCROLLBAR
static bool s_refreshDebug = FALSE;
if ( s_refreshDebug )
{
wxClientDC dc(this);
dc.SetBrush(*wxCYAN_BRUSH);
dc.SetPen(*wxTRANSPARENT_PEN);
dc.DrawRectangle(rect);
// under Unix we use "--sync" X option for this
#ifdef __WXMSW__
::GdiFlush();
::Sleep(200);
#endif // __WXMSW__
}
#endif // WXDEBUG_SCROLLBAR
Refresh(TRUE, &rect);
}