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 » Zooming layout in Windows
Re: Zooming layout in Windows [message #36051 is a reply to message #36049] Sat, 21 April 2012 19:56 Go to previous messageGo to previous message
Lance is currently offline  Lance
Messages: 656
Registered: March 2007
Contributor
Hi Jerson:

Not sure if you're looking for something like this, but:
#include <CtrlLib/CtrlLib.h>

using namespace Upp;

struct MyApp : public TopWindow
{
	MyApp()
	{
		lt.SetLabel("5x5");
		rt.SetLabel("5x2");
		lb.SetLabel("2x5");
		rb.SetLabel("2x2");
		
		Add(lt);
		Add(rt);
		Add(lb);
		Add(rb);
	}
	virtual void Layout()
	{
		Size sz=GetSize();
		int w1,h1;
		w1=sz.cx*5/7;
		h1=sz.cy*5/7;
		lt.LeftPos(0,w1).TopPos(0,h1);
		rt.LeftPos(w1,sz.cx-w1).TopPos(0,h1);
		lb.LeftPos(0,w1).TopPos(h1,sz.cy-h1);
		rb.LeftPos(w1, sz.cx-w1).TopPos(h1,sz.cy-h1);
	}
	
	Button lt, rt, lb, rb;
};

GUI_APP_MAIN
{
	MyApp().Sizeable().Run();
}
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: UDP connection
Next Topic: How to get pixels per millimeter for current screen?
Goto Forum:
  


Current Time: Sun Aug 24 13:26:03 CEST 2025

Total time taken to generate the page: 0.04935 seconds