Home » Community » Newbie corner » How to achieve dynamic layout scaling ?
How to achieve dynamic layout scaling ? [message #55939] |
Tue, 05 January 2021 16:12  |
mingodad
Messages: 53 Registered: February 2008 Location: Spain
|
Member |
|
|
I'm starting with Ultimate++ and I'm looking on how to achieve dynamic layout resizing (something like webrowser CTRL-Mouse-Wheel), I started with Gui15 project and added a CtrlSlider to change the StdFont with the size from the slider.
But the only button on the window only changes the label text but not it's size, can we have an example showing it ?
#include <CtrlLib/CtrlLib.h>
using namespace Upp;
struct MyAppWindow : TopWindow {
Button button;
SliderCtrl slider;
void Slider()
{
//Log(String().Cat() << "-> SliderCtrlAction(" << slider.GetData() << ")");
Font::SetStdFont(Arial(slider.GetData()));
button.SetLabel(String() << "Button " << slider.GetData());
Refresh();
}
typedef MyAppWindow CLASSNAME;
MyAppWindow() {
Title("My application with font-zoomed button").Sizeable();
*this << button.SetLabel("Button").LeftPosZ(10, 64).TopPosZ(10, 24);
slider.MinMax(10, 24);
slider.Step(1);
slider.SetData(14);
slider << THISFN(Slider);
*this << slider.TopPosZ(10, 64).LeftPosZ(180, 10);
}
};
GUI_APP_MAIN
{
//Font::SetDefaultFont(Arial(24));
Font::SetStdFont(Arial(18));
//StdFont(18);
MyAppWindow app;
app.Run();
}
[Updated on: Wed, 06 January 2021 15:16] Report message to a moderator
|
|
|
Goto Forum:
Current Time: Mon May 12 03:35:12 CEST 2025
Total time taken to generate the page: 0.02728 seconds
|