Home » Community » Newbie corner » Upp GUI size in Win and Ubuntu
|
Re: Upp GUI size in Win and Ubuntu [message #40052 is a reply to message #40050] |
Wed, 29 May 2013 11:45   |
Sender Ghost
Messages: 301 Registered: November 2008
|
Senior Member |
|
|
nlneilson wrote on Tue, 28 May 2013 20:54 | I filed a bug as each time the package is opened up it adds the 'Z's back in.
|
I think, this is not a bug. This is how it works by default - layout zooming:
Logical positions | Another issue that is related to positions is layout zooming. The problem here is that application can use font of different size or type than standard one used in layout designer when designing layout. That is why layout logical position need to be zoomed. Zoom factor is determined by ratio of text "OK Cancel Exit Retry" in runtime standard font size to Size(99, 13) - size of this text using standard font.
Zooming layout positions is done using placement methods with Z suffix (like LeftPosZ etc...).
|
Therefore, if you want to use layouts from layout designer, you have about two methods (for your specialized case):
1. Ctrl::NoLayoutZoom();
2. SetStdFont(Font font), where font must be the same (even DPI settings (for screen shots)) on different platforms to achieve the same sizes of layout widgets.
If you want to use placement methods without Z suffix, you could use them manually (as I already said):
Toggle Spoiler
#include <CtrlLib/CtrlLib.h>
using namespace Upp;
class CustomDlg : public TopWindow {
public:
typedef CustomDlg CLASSNAME;
CustomDlg();
EditField Point1, Point2, Angle1, Angle2, Distance,
Data1, count, timezone;
Label units, l1, l2, l3, l4, l5;
Button P1, P2;
};
CustomDlg::CustomDlg()
{
Title("Custom Dialog");
SetRect(Size(260, 80));
MinimizeBox();
Add(Point1.WantFocus(false).LeftPos(44, 200).TopPos(0, 16));
Point1.SetFont(StdFont(12).Bold());
Add(Point2.WantFocus(false).LeftPos(44, 200).TopPos(16, 16));
Point2.SetFont(StdFont(12).Bold());
Add(Angle1.WantFocus(false).LeftPos(44, 96).TopPos(32, 16));
Angle1.SetFont(StdFont(12).Bold());
Add(Angle2.WantFocus(false).LeftPos(149, 96).TopPos(32, 16));
Angle2.SetFont(StdFont(12).Bold());
Add(Distance.WantFocus(false).LeftPos(44, 96).TopPos(48, 16));
Distance.SetFont(StdFont(12).Bold());
Add(units.LeftPos(138, 30).TopPos(48, 16));
Add(l1.LeftPos(0, 44).VSizePos(0, 67));
l1.SetLabel(t_(" Point 1")).SetFont(StdFont(11));
Add(l2.LeftPos(0, 44).TopPos(16, 16));
l2.SetLabel(t_(" Point 2")).SetFont(StdFont(11));
Add(l3.LeftPos(0, 44).TopPos(32, 16));
l3.SetLabel(t_(" Angle 1")).SetFont(StdFont(11));
Add(l4.LeftPos(142, 8).TopPos(32, 16));
l4.SetLabel("2").SetFont(StdFont(11));
Add(l5.LeftPos(0, 44).TopPos(48, 16));
l5.SetLabel(t_(" Distance")).SetFont(StdFont(11));
Add(Data1.WantFocus(false).LeftPos(1, 259).TopPos(64, 16));
Add(P1.LeftPos(244, 16).TopPos(0, 16));
P1.SetLabel("<").SetFont(StdFont().Bold());
Add(P2.LeftPos(244, 16).TopPos(16, 16));
P2.SetLabel("<").SetFont(StdFont().Bold());
Add(count.AlignRight(true).LeftPos(208, 52).TopPos(48, 16));
count.SetFont(StdFont().Bold());
Add(timezone.AlignRight(true).WantFocus(false).LeftPos(184, 24).TopPos(48, 16));
timezone.SetFont(StdFont().Bold());
}
GUI_APP_MAIN
{
CustomDlg dlg;
dlg.Run();
}
In conclusion, what you wanted is feature, which is not implemented. This feature, like "the possibility to use zoomed and not zoomed versions of placement inside the same layout", might have own consequences.
Edit:
The feature added to Redmine: "Ide (LayDes): Zoomable and not zoomable layout items".
[Updated on: Fri, 31 May 2013 09:32] Report message to a moderator
|
|
|
|
Re: Upp GUI size in Win and Ubuntu [message #40150 is a reply to message #40052] |
Sat, 22 June 2013 22:24   |
nlneilson
Messages: 644 Registered: January 2010 Location: U.S. California. Mojave &...
|
Contributor |
|
|
Thanks Sender Ghost for the code as the first time you mentioned this I was lost.
This question is not concerning size but whether the text in a label can be changed. Label 11 is originally " Point 1" with:
l1.SetLabel(t_(" Point 1")).SetFont(StdFont(11));
Could the text be changed to " Something" in an if block with:
l1.SetLabel(t_(" Something")).SetFont(StdFont(11));
without changing the Label to EditField?
Sender Ghost wrote on Wed, 29 May 2013 02:45 |
If you want to use placement methods without Z suffix, you could use them manually (as I already said):
Label units, l1, l2, l3, l4, l5;
Add(l1.LeftPos(0, 44).VSizePos(0, 67));
l1.SetLabel(t_(" Point 1")).SetFont(StdFont(11));
Add(l2.LeftPos(0, 44).TopPos(16, 16));
l2.SetLabel(t_(" Point 2")).SetFont(StdFont(11));
|
|
|
|
|
|
Re: Upp GUI size in Win and Ubuntu [message #40155 is a reply to message #40153] |
Mon, 24 June 2013 02:33  |
Sender Ghost
Messages: 301 Registered: November 2008
|
Senior Member |
|
|
nlneilson wrote on Sun, 23 June 2013 22:34 | The link you had to the 'U++ framework' or API can that be downloaded or is there plans to have it so it can be downloaded for offline use?
|
Actually, possible to access the same topics from U++ TheIDE:
1. Assist -> Help Topics (or F1) menu bar.
2. Used packages -> CtrlLib -> Reference -> Static widgets (or just use "SetLabel" text for Search).
Also there is uppbox/uppweb package to generate html documentation.
Sorry for offtopic.
|
|
|
Goto Forum:
Current Time: Wed Apr 30 13:15:04 CEST 2025
Total time taken to generate the page: 0.03717 seconds
|