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 to achieve dynamic layout scaling ?
How to achieve dynamic layout scaling ? [message #55939] Tue, 05 January 2021 16:12 Go to previous message
mingodad is currently offline  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

 
Read Message
Read Message
Read Message
Previous Topic: SqlSchema sch(MY_SQL) compound and or unique indexes
Next Topic: Keyboard navigation doesn't work
Goto Forum:
  


Current Time: Sun Apr 28 19:47:39 CEST 2024

Total time taken to generate the page: 0.04637 seconds