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 |
|
mirek
Messages: 13975 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 #33705 is a reply to message #33701] |
Tue, 06 September 2011 19:45 |
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 #36667 is a reply to message #33470] |
Sun, 24 June 2012 14:00 |
mdelfede
Messages: 1307 Registered: September 2007
|
Ultimate 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 |
mdelfede
Messages: 1307 Registered: September 2007
|
Ultimate 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 |
|
mirek
Messages: 13975 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
|
|
|
|
Goto Forum:
Current Time: Sun Apr 28 23:01:47 CEST 2024
Total time taken to generate the page: 0.03533 seconds
|