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   |
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();
}
|
|
|
 |
|
Zooming layout in Windows
By: jerson on Tue, 17 April 2012 19:49
|
 |
|
Re: Zooming layout in Windows
By: jerson on Sat, 21 April 2012 03:11
|
 |
|
Re: Zooming layout in Windows
By: Lance on Sat, 21 April 2012 15:56
|
 |
|
Re: Zooming layout in Windows
By: jerson on Sat, 21 April 2012 16:15
|
 |
|
Re: Zooming layout in Windows
By: Lance on Sat, 21 April 2012 19:56
|
 |
|
Re: Zooming layout in Windows
By: Lance on Sat, 21 April 2012 20:15
|
 |
|
Re: Zooming layout in Windows
By: jerson on Sun, 22 April 2012 02:52
|
 |
|
Re: Zooming layout in Windows
By: Lance on Sun, 22 April 2012 03:17
|
 |
|
Re: Zooming layout in Windows
By: Lance on Sun, 22 April 2012 05:12
|
 |
|
Re: Zooming layout in Windows
By: jerson on Sun, 22 April 2012 05:49
|
 |
|
Re: Zooming layout in Windows
By: Lance on Sun, 22 April 2012 14:29
|
Goto Forum:
Current Time: Sun Aug 24 21:37:41 CEST 2025
Total time taken to generate the page: 0.05232 seconds
|