// headers
// ----------------------------------------------------------------------------
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
+#pragma implementation "vscroll.h"
+#endif
+
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
+#ifdef __BORLANDC__
+#pragma hdrstop
+#endif
+
#include "wx/vscroll.h"
// ----------------------------------------------------------------------------
// implementation
// ============================================================================
+IMPLEMENT_ABSTRACT_CLASS(wxVScrolledWindow, wxPanel)
+
// ----------------------------------------------------------------------------
// initialization
// ----------------------------------------------------------------------------
// use the height of the lines we looked as the average
heightTotal = (wxCoord)
- (((float)m_heightTotal / (3*NUM_LINES_TO_SAMPLE)) * m_lineMax);
+ (((float)heightTotal / (3*NUM_LINES_TO_SAMPLE)) * m_lineMax);
}
return heightTotal;
size_t lineFirstNew;
const wxEventType evtType = event.GetEventType();
+
if ( evtType == wxEVT_SCROLLWIN_TOP )
{
lineFirstNew = 0;
{
lineFirstNew = GetLastVisibleLine();
}
+ else if ( evtType == wxEVT_SCROLLWIN_THUMBRELEASE )
+ {
+ lineFirstNew = event.GetPosition();
+ }
+ else if ( evtType == wxEVT_SCROLLWIN_THUMBTRACK )
+ {
+ lineFirstNew = event.GetPosition();
+ }
+
else // unknown scroll event?
{
- if ( evtType == wxEVT_SCROLLWIN_THUMBRELEASE )
- {
- lineFirstNew = event.GetPosition();
- }
- else
- {
- wxASSERT_MSG( evtType == wxEVT_SCROLLWIN_THUMBTRACK,
- _T("unknown scroll event type?") );
-
- // don't do anything, otherwise dragging the thumb around would
- // be too slow
- return;
- }
+ wxFAIL_MSG( _T("unknown scroll event type?") );
+ return;
}
ScrollToLine(lineFirstNew);