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 » Community » Newbie corner » How do I get a window decoration/element size
Re: How do I get a window decoration/element size [message #44423 is a reply to message #43394] Tue, 10 March 2015 10:42 Go to previous message
slashupp is currently offline  slashupp
Messages: 231
Registered: July 2009
Experienced Member
Here's a (ugly) workaround that will give you some values:

...
int WFrameWidth, TitleBarHeight;

void Get_WFW_TBH()
{
	TopWindow w,w1;
	w.SetRect(10,10,10,10); 
	w.OpenMain();
	w1.SetRect(w.GetRect());
	w1.OpenMain();
	Rect rw=w.GetRect();
	Rect rw1=w1.GetRect();
	WFrameWidth=rw1.left-rw.left; //left-frame thickness
	TitleBarHeight=rw1.top-rw.top;
	w.Close();
	w1.Close();
}


I use it on Linux to get retain exact positioning of topwindows between sessions.
There's a quick flash of the two windows (easily not noticed Wink
Don't know how portable (should be OK)
(MSWindows has built-in functions to get those values, I think, but the code should work even there)
 
Read Message
Read Message
Read Message
Previous Topic: Raspberry PI
Next Topic: ERROR: INVALID UTP-8 SEQUENCE: n Ya que el equpo d
Goto Forum:
  


Current Time: Sun May 05 05:24:21 CEST 2024

Total time taken to generate the page: 0.01930 seconds