diff options
author | Kohei Yoshida <kyoshida@novell.com> | 2010-12-15 17:18:17 -0500 |
---|---|---|
committer | Kohei Yoshida <kyoshida@novell.com> | 2010-12-15 17:18:17 -0500 |
commit | c28381a752a5d696dce4c7089e6efbe12b05e9e8 (patch) | |
tree | 4ec1b494846043be298de79e0a883d5d8c581841 /sc/source/ui/dbgui/fieldwnd.cxx | |
parent | 4f8d925b70e46f106b8e1348b372a362e85c5463 (diff) |
Show the scroll bars only when necessary, otherwise hide them.
Diffstat (limited to 'sc/source/ui/dbgui/fieldwnd.cxx')
-rw-r--r-- | sc/source/ui/dbgui/fieldwnd.cxx | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/sc/source/ui/dbgui/fieldwnd.cxx b/sc/source/ui/dbgui/fieldwnd.cxx index ef7adca49492..abec3dc708d8 100644 --- a/sc/source/ui/dbgui/fieldwnd.cxx +++ b/sc/source/ui/dbgui/fieldwnd.cxx @@ -721,7 +721,7 @@ ScDPHorFieldControl::ScDPHorFieldControl( { maScroll.SetScrollHdl( LINK(this, ScDPHorFieldControl, ScrollHdl) ); maScroll.SetEndScrollHdl( LINK(this, ScDPHorFieldControl, EndScrollHdl) ); - maScroll.Show(); + maScroll.Hide(); AppendPaintable(&maScroll); } @@ -931,7 +931,11 @@ void ScDPHorFieldControl::ResetScrollBar() static_cast<double>(GetFieldCount()) / static_cast<double>(mnFieldBtnRowCount)); if (nOldMax != nNewMax) + { maScroll.SetRangeMax(nNewMax); + bool bShow = mnFieldBtnColCount*mnFieldBtnRowCount < GetFieldCount(); + maScroll.Show(bShow); + } } bool ScDPHorFieldControl::GetFieldBtnPosSize(size_t nPos, Point& rPos, Size& rSize) @@ -1012,7 +1016,7 @@ ScDPRowFieldControl::ScDPRowFieldControl( { maScroll.SetScrollHdl( LINK(this, ScDPRowFieldControl, ScrollHdl) ); maScroll.SetEndScrollHdl( LINK(this, ScDPRowFieldControl, EndScrollHdl) ); - maScroll.Show(); + maScroll.Show(false); AppendPaintable(&maScroll); } @@ -1173,7 +1177,10 @@ void ScDPRowFieldControl::ResetScrollBar() long nNewMax = std::max<long>(mnColumnBtnCount, GetFieldCount()); if (nOldMax != nNewMax) + { maScroll.SetRangeMax(nNewMax); + maScroll.Show(GetFieldCount() > mnColumnBtnCount); + } } bool ScDPRowFieldControl::GetFieldBtnPosSize(size_t nPos, Point& rPos, Size& rSize) |