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 » Developing U++ » U++ TheIDE and Library: Releases and ChangeLogs » Some chameleon utility functions...
Some chameleon utility functions... [message #12469] Sun, 04 November 2007 14:07
mirek is currently offline  mirek
Messages: 11830
Registered: November 2005
Ultimate Member
...add and remove margins from rectangle

void   DeflateMargins(Rect& r, const Rect& m)
{
	r = Rect(r.left + m.left, r.top + m.top, r.right - m.right, r.bottom - m.bottom);
}

void   ChDeflateMargins(Rect& r, const Value& look)
{
	return DeflateMargins(r, ChMargins(look));
}

void DeflateMargins(Size& sz, const Rect& m)
{
	sz = Size(sz.cx + m.left + m.right, sz.cy + m.top + m.bottom);
}

void ChDeflateMargins(Size& sz, const Value& look)
{
	DeflateMargins(sz, ChMargins(loook));
}

void   InflateMargins(Rect& r, const Rect& m)
{
	r = Rect(r.left - m.left, r.top - m.top, r.right + m.right, r.bottom + m.bottom);
}

void   ChInflateMargins(Rect& r, const Value& look)
{
	return InflateMargins(r, ChMargin(look));
}

void InflateMargins(Size& sz, const Rect& m)
{
	sz = Size(sz.cx + m.left + m.right, sz.cy + m.top + m.bottom);
}

void ChInflateMargin(Size& sz, const Value& look)
{
	InflateMargins(sz, ChMargin(loook));
}
Previous Topic: StaticRect enhanced to support Ch Values
Next Topic: Composite widget chameleon (e.g. SetScrollBarStyle)
Goto Forum:
  


Current Time: Mon Apr 22 00:06:21 CEST 2019

Total time taken to generate the page: 0.00706 seconds