projects
/
wxWidgets.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Peaceful solution to wxCheckListBox inheritance in WinCE and wxListBox::Clear() ambig...
[wxWidgets.git]
/
src
/
generic
/
vscroll.cpp
diff --git
a/src/generic/vscroll.cpp
b/src/generic/vscroll.cpp
index bce13cb38de0d5ba24842567a79f8adef59b0fc0..59a65f856e03ac1c86b0782809873b8b938f67bb 100644
(file)
--- a/
src/generic/vscroll.cpp
+++ b/
src/generic/vscroll.cpp
@@
-24,6
+24,10
@@
#pragma hdrstop
#endif
#pragma hdrstop
#endif
+#ifndef WX_PRECOMP
+ #include "wx/sizer.h"
+#endif
+
#include "wx/vscroll.h"
// ----------------------------------------------------------------------------
#include "wx/vscroll.h"
// ----------------------------------------------------------------------------
@@
-156,6
+160,13
@@
size_t wxVScrolledWindow::FindFirstFromBottom(size_t lineLast, bool full)
return lineFirst;
}
return lineFirst;
}
+void wxVScrolledWindow::RemoveScrollbar()
+{
+ m_lineFirst = 0;
+ m_nVisible = m_lineMax;
+ SetScrollbar(wxVERTICAL, 0, 0, 0);
+}
+
void wxVScrolledWindow::UpdateScrollbar()
{
// see how many lines can we fit on screen
void wxVScrolledWindow::UpdateScrollbar()
{
// see how many lines can we fit on screen
@@
-185,8
+196,8
@@
void wxVScrolledWindow::UpdateScrollbar()
if ( hAll < hWindow )
{
// we don't need scrollbar at all
if ( hAll < hWindow )
{
// we don't need scrollbar at all
-
m_lineFirst = 0
;
-
SetScrollbar(wxVERTICAL, 0, 0, 0)
;
+
RemoveScrollbar()
;
+
return
;
}
}
}
}
@@
-218,8
+229,15
@@
void wxVScrolledWindow::SetLineCount(size_t count)
m_heightTotal = EstimateTotalHeight();
// recalculate the scrollbars parameters
m_heightTotal = EstimateTotalHeight();
// recalculate the scrollbars parameters
- m_lineFirst = 1; // make sure it is != 0
- ScrollToLine(0);
+ if ( count )
+ {
+ m_lineFirst = 1; // make sure it is != 0
+ ScrollToLine(0);
+ }
+ else // no items
+ {
+ RemoveScrollbar();
+ }
}
void wxVScrolledWindow::RefreshLine(size_t line)
}
void wxVScrolledWindow::RefreshLine(size_t line)