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 » U++ Library support » U++ Widgets - General questions or Mixed problems » Zooming layouts and different behaviour windows/linux
Re: Zooming layouts and different behaviour windows/linux [message #33592 is a reply to message #33591] Sun, 28 August 2011 09:00 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 12519
Registered: November 2005
Ultimate Member
Sender Ghost wrote on Sat, 27 August 2011 04:53


As I already said, the differences are minor (about 2-3%) in this case. I just suggested to apply font changes "at once", when needed, instead of current approach (in constructor, for each Ctrl). This is "semi automatic" method with its (dis)advantages (compared to current "automatic" method), but implementation could be different.



Well, before completely dismissing this issue, one possibility would be to place SyncCh somewhere else than Ctrl constructor.

The only problem is that I do not know where.. Promissing place might be TopWindow constructor, but that still is not really complete solution...
Re: Zooming layouts and different behaviour windows/linux [message #33638 is a reply to message #33592] Fri, 02 September 2011 15:26 Go to previous messageGo to next message
mdelfede is currently offline  mdelfede
Messages: 1264
Registered: September 2007
Senior Contributor
mhhhh.... what about putting it inside SetStdFont() ? Smile

Max
Re: Zooming layouts and different behaviour windows/linux [message #33639 is a reply to message #33638] Fri, 02 September 2011 17:51 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 12519
Registered: November 2005
Ultimate Member
mdelfede wrote on Fri, 02 September 2011 09:26

mhhhh.... what about putting it inside SetStdFont() ? Smile

Max



SetStdFont knows nothing about CtrlCore. And, besides, you might want to alter more parameters than standard font, would not be nice if each of them issued ChSync (or maybe it would, I guess I have to check that, I mean to check how difficult ChSync is..).

Mirek
Re: Zooming layouts and different behaviour windows/linux [message #33701 is a reply to message #33591] Tue, 06 September 2011 14:09 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 12519
Registered: November 2005
Ultimate Member
Sender Ghost wrote on Sat, 27 August 2011 04:53

I have tried your code with RTIMING on Windows XP with different compilers (TDM GCC v4.5.2 and C/C++ compiler from Microsoft Visual Studio 2008 (MSC9)) for Optimal build mode, with following results (for 5 invocations, 1



I have optimized it a bit, would you find some time to measure again, it would be helpful...

Mirek
Re: Zooming layouts and different behaviour windows/linux [message #33705 is a reply to message #33701] Tue, 06 September 2011 19:45 Go to previous messageGo to next message
Sender Ghost is currently offline  Sender Ghost
Messages: 301
Registered: November 2008
Senior Member
mirek wrote on Tue, 06 September 2011 14:09


I have optimized it a bit, would you find some time to measure again, it would be helpful...


Following results for 3762 and 3829 revisions:

TDM GCC v4.5.2:
after changes:
TIMING chsync         :  4.47 s  -  4.47 s  ( 4.47 s  / 1 ), min:  4.47 s , max:  4.47 s , nesting: 1 - 1
TIMING chsync         :  4.49 s  -  4.49 s  ( 4.49 s  / 1 ), min:  4.49 s , max:  4.49 s , nesting: 1 - 1
TIMING chsync         :  4.47 s  -  4.47 s  ( 4.47 s  / 1 ), min:  4.47 s , max:  4.47 s , nesting: 1 - 1
TIMING chsync         :  4.47 s  -  4.47 s  ( 4.47 s  / 1 ), min:  4.47 s , max:  4.47 s , nesting: 1 - 1
TIMING chsync         :  4.47 s  -  4.47 s  ( 4.47 s  / 1 ), min:  4.47 s , max:  4.47 s , nesting: 1 - 1

before changes:
TIMING chsync         :  4.43 s  -  4.43 s  ( 4.43 s  / 1 ), min:  4.43 s , max:  4.43 s , nesting: 1 - 1
TIMING chsync         :  4.45 s  -  4.45 s  ( 4.45 s  / 1 ), min:  4.45 s , max:  4.45 s , nesting: 1 - 1
TIMING chsync         :  4.44 s  -  4.44 s  ( 4.44 s  / 1 ), min:  4.44 s , max:  4.44 s , nesting: 1 - 1
TIMING chsync         :  4.43 s  -  4.43 s  ( 4.43 s  / 1 ), min:  4.43 s , max:  4.43 s , nesting: 1 - 1
TIMING chsync         :  4.43 s  -  4.43 s  ( 4.43 s  / 1 ), min:  4.43 s , max:  4.43 s , nesting: 1 - 1

MSC9:
after changes:
TIMING chsync         :  2.96 s  -  2.96 s  ( 2.96 s  / 1 ), min:  2.96 s , max:  2.96 s , nesting: 1 - 1
TIMING chsync         :  2.95 s  -  2.95 s  ( 2.95 s  / 1 ), min:  2.95 s , max:  2.95 s , nesting: 1 - 1
TIMING chsync         :  2.95 s  -  2.95 s  ( 2.95 s  / 1 ), min:  2.95 s , max:  2.95 s , nesting: 1 - 1
TIMING chsync         :  2.95 s  -  2.95 s  ( 2.95 s  / 1 ), min:  2.95 s , max:  2.95 s , nesting: 1 - 1
TIMING chsync         :  2.96 s  -  2.96 s  ( 2.96 s  / 1 ), min:  2.96 s , max:  2.96 s , nesting: 1 - 1

before changes:
TIMING chsync         :  2.92 s  -  2.92 s  ( 2.92 s  / 1 ), min:  2.92 s , max:  2.92 s , nesting: 1 - 1
TIMING chsync         :  2.90 s  -  2.90 s  ( 2.90 s  / 1 ), min:  2.90 s , max:  2.90 s , nesting: 1 - 1
TIMING chsync         :  2.91 s  -  2.91 s  ( 2.91 s  / 1 ), min:  2.91 s , max:  2.91 s , nesting: 1 - 1
TIMING chsync         :  2.89 s  -  2.89 s  ( 2.89 s  / 1 ), min:  2.89 s , max:  2.89 s , nesting: 1 - 1
TIMING chsync         :  2.90 s  -  2.90 s  ( 2.90 s  / 1 ), min:  2.90 s , max:  2.90 s , nesting: 1 - 1
Re: Zooming layouts and different behaviour windows/linux [message #33722 is a reply to message #33705] Thu, 08 September 2011 09:56 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 12519
Registered: November 2005
Ultimate Member
Thanks. Looks better now; I guess I can live with this...
Re: Zooming layouts and different behaviour windows/linux [message #36660 is a reply to message #33470] Sun, 24 June 2012 12:46 Go to previous messageGo to next message
mdelfede is currently offline  mdelfede
Messages: 1264
Registered: September 2007
Senior Contributor
Well... I hate this, but I must revive this thread Sad

I have this in my code :

	SetStdFont(StdFont(globalSettings().GetGraphicSettings().guiCharSize));
	InitRichTextZoom();


which reads the gui std font size from a global variable and sets it. I can't do it on very beginning of GUI_APP_MAIN, but I do it indeed BEFORE creating the application main window.
But... the code does nothing. The gui font size don't change at all.

Any hint ? I'd really need a configurable gui font size, many customers asked for it.

Ciao

Max
Re: Zooming layouts and different behaviour windows/linux [message #36663 is a reply to message #36660] Sun, 24 June 2012 13:04 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 12519
Registered: November 2005
Ultimate Member
I have just tried this:

GUI_APP_MAIN
{
	SetStdFont(StdFont(30));
	PromptOK("OK");
}


- works as expected... To dig deeper, I would need some more detailed testcase, I am afraid...
Re: Zooming layouts and different behaviour windows/linux [message #36666 is a reply to message #36663] Sun, 24 June 2012 13:31 Go to previous messageGo to next message
mdelfede is currently offline  mdelfede
Messages: 1264
Registered: September 2007
Senior Contributor
That's weird... on a simple test case, it works.
I'll look at it deeper...

Max
Re: Zooming layouts and different behaviour windows/linux [message #36667 is a reply to message #33470] Sun, 24 June 2012 14:00 Go to previous messageGo to next message
mdelfede is currently offline  mdelfede
Messages: 1264
Registered: September 2007
Senior Contributor
Well.... I'm really out of ideas on WHY, but it started working, at least partially... Maybe it was an old config file which I deleted somewhere.

Well, the 'almost' is because I'd like to do it in real time (I mean, application running), and the layout are not resynced.... Texts change size, but objects positions and sizes don't change up to next app restart.
Is there some function to force layouting ?
I mean, globally.... something like

GetTopWindow()->ReLayout();


Max

[Updated on: Sun, 24 June 2012 14:01]

Report message to a moderator

Re: Zooming layouts and different behaviour windows/linux [message #36668 is a reply to message #36667] Sun, 24 June 2012 14:36 Go to previous messageGo to next message
mdelfede is currently offline  mdelfede
Messages: 1264
Registered: September 2007
Senior Contributor
Well... here a simple testcase which shows a couple of interesting things :

TestLayoutZoom.lay :
LAYOUT(TestLayoutZoomLayout, 200, 100)
	ITEM(EditString, test2, LeftPosZ(112, 64).TopPosZ(40, 19))
	ITEM(EditIntSpin, charSize, LeftPosZ(112, 64).TopPosZ(16, 19))
	ITEM(Label, dv___2, SetLabel(t_("Label2 :")).LeftPosZ(4, 104).TopPosZ(44, 16))
	ITEM(Label, dv___3, SetLabel(t_("Label1 :")).LeftPosZ(4, 104).TopPosZ(20, 16))
END_LAYOUT


main.cpp :
#include <CtrlLib/CtrlLib.h>

using namespace Upp;

#define LAYOUTFILE <TestLayoutZoom/TestLayoutZoom.lay>
#include <CtrlCore/lay.h>

class TestLayoutZoom : public WithTestLayoutZoomLayout<TopWindow>
{
	void sizeEditCb(void);
	public:
		typedef TestLayoutZoom CLASSNAME;

		TestLayoutZoom();
};

void TestLayoutZoom::sizeEditCb(void)
{
	SetStdFont(StdFont(~charSize));
}

TestLayoutZoom::TestLayoutZoom()
{
	CtrlLayout(*this, "Window title");
	charSize <<= 15;
	charSize <<= THISBACK(sizeEditCb);
}

GUI_APP_MAIN
{
	TestLayoutZoom().Run();
}


On FIRST editspin change, I see just the label sizes which change; on next editspin changes, nothing more happens.
The layout is unchanged anyways.

Expected behaviour : layout and its elements should follow edispin value.

Besides of layoyut don't being updated, it seems that calls to SetStdFont() following first one are ignored.

Max

[Updated on: Sun, 24 June 2012 14:38]

Report message to a moderator

Re: Zooming layouts and different behaviour windows/linux [message #36669 is a reply to message #36667] Sun, 24 June 2012 15:09 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 12519
Registered: November 2005
Ultimate Member
mdelfede wrote on Sun, 24 June 2012 08:00

Well.... I'm really out of ideas on WHY, but it started working, at least partially... Maybe it was an old config file which I deleted somewhere.

Well, the 'almost' is because I'd like to do it in real time (I mean, application running), and the layout are not resynced.... Texts change size, but objects positions and sizes don't change up to next app restart.
Is there some function to force layouting ?



No. Standard font is, first of all, considered to be system setting that does not change during the application run. This is similiar to skin changes of host OS.

I am afraid that the only practical way is to somehow restart the application.

Mirek
Re: Zooming layouts and different behaviour windows/linux [message #36670 is a reply to message #36669] Sun, 24 June 2012 15:13 Go to previous message
mdelfede is currently offline  mdelfede
Messages: 1264
Registered: September 2007
Senior Contributor
Well... it's a pity, but I guess I can live with it.

I found the reason of former problem, I was calling SetStdFont on app startup once, and it was ignoring following calls.
So, I guess I've to do it just once on app startup.

Thank you for answering

Max
Previous Topic: PushButton with text in the bottom
Next Topic: What is best way to obtain button info via callback?
Goto Forum:
  


Current Time: Thu Jun 04 06:49:49 CEST 2020

Total time taken to generate the page: 0.01438 seconds