Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Library : Other (not classified elsewhere) » ScrollBarSize() - Is it (possibly) a bug?
Re: ScrollBarSize() - Is it (possibly) a bug? [message #59335 is a reply to message #58936] Sat, 17 December 2022 14:15 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 14267
Registered: November 2005
Ultimate Member
Lance wrote on Tue, 27 September 2022 01:35
I was looking for some member function in ScrollBar to retieve the scrollbar size, or expose the const Style *style
which can in turn access the barsize value, but to no avail. Until I find this function
inline int ScrollBarSize()                  { return ScrollBar::StyleDefault().barsize; }//!!


A search in the Upp src indicates many libraries make use of this function, including in HeaderCtrl
void HeaderCtrl::FrameLayout(Rect& r)
{
	LayoutFrameTop(r, this, invisible ? 0 : GetHeight());
	LayoutFrameBottom(r, &sb, sb.IsShown() ? ScrollBarSize() : 0);
}

void HeaderCtrl::FrameAddSize(Size& sz)
{
	if(!invisible)
		sz.cy += GetHeight();
	if(sb.IsVisible())
		sz.cy += ScrollBarSize();
}


Does this imply that a customized ScrollBar Style shall not disagree on barsize with the default ScrollBar Style? Is this restriction necessary? or shall we expose int ScrollBar::ScrollBarSize()const(elevate it to a public member function from a private one as it is now)?


What a nice grey corner have you sumpled upon...

Well, I would say, for now it means that if you use ScrollBar::SetStyle, you cannot expect your styled ScollBar be well integrated is some other widgets unless scrollbarsize is the same...

In practice, in over 15 years I do not remember single instance of custom Scrollbar style, so while this should be fixed, it is really low priority.
 
Read Message
Read Message
Read Message
Previous Topic: bug in the routine involving the time of the zip file
Next Topic: why there's still empty space below a ColumnList ctrl after I set RoundSize?
Goto Forum:
  


Current Time: Thu Aug 21 11:20:17 CEST 2025

Total time taken to generate the page: 0.04688 seconds