Home » U++ TheIDE » U++ TheIDE: Layout (Forms) Designer » Is the Layout Designer outdated?
Is the Layout Designer outdated? [message #57057] |
Tue, 18 May 2021 23:15  |
MeerMusik
Messages: 13 Registered: April 2021 Location: Germany, Lower Saxony, Ha...
|
Promising Member |

|
|
Hello.
I finally started to try to learn UPP. From within the Layout Editor I added a Label and a Button. The basic Layout File then contains:
LAYOUT(TryToLearnUPPGUIPartLayout, 864, 652)
ITEM(LabelBase, Label1, SetText(t_("\vI am a Label!\n")).SetAlign(ALIGN_CENTER).SetInk(Color(226, 42, 0)).LeftPosZ(340, 72).TopPosZ(64, 52))
ITEM(Upp::Button, Button1, LeftPosZ(204, 368).TopPosZ(192, 168))
END_LAYOUT
When I try to compile this, I always end up with with the Error Message
C:/Dev/GitRepos/AKKomPolToolUPP/TryToLearnUPPGUIPart/TryToLearnUPPGUIPart.lay (2): error: 'class Upp::LabelBase' has no member named 'LeftPosZ'
Same is true for TopPosZ. I also get this Error:
C:/Dev/upp/uppsrc/CtrlCore/lay0.h (59): error: 'class Upp::LabelBase' has no member named 'LayoutId'
The only thing I have changed is giving the Items an Name. What am I missing? Thanks in advance!
[Updated on: Tue, 18 May 2021 23:15] Report message to a moderator
|
|
|
Re: Is the Layout Designer outdated? [message #57058 is a reply to message #57057] |
Tue, 18 May 2021 23:44   |
Oblivion
Messages: 1206 Registered: August 2007
|
Senior Contributor |
|
|
Hello MeerMusik,
From what you describe, is it possible that you manually type "LabelBase" in the layour editor?
Because LabelBase is not itself a Ctrl. The correct ctrl should be Label or LabelBox. That's why you are getting the error.
Correct items are available under the right click (context) menu -> static submenu.
Or you can select or change them in the dropdown menu:

or you can type Upp::Label, if you prefer to edit the layout file manually.
ITEM(Upp::Label, Label1, SetLabel(t_("I am a label")).SetAlign(ALIGN_CENTER).SetInk(Color(226, 42, 0)).LeftPosZ(281, 72).TopPosZ(93, 52))
Best regards,
Oblivion
.
-
Attachment: designer.png
(Size: 26.32KB, Downloaded 414 times)
Github page: https://github.com/ismail-yilmaz
upp-components: https://github.com/ismail-yilmaz/upp-components
Bobcat the terminal emulator: https://github.com/ismail-yilmaz/Bobcat
[Updated on: Tue, 18 May 2021 23:52] Report message to a moderator
|
|
|
|
[Solved] Re: Is the Layout Designer outdated? [message #57060 is a reply to message #57059] |
Wed, 19 May 2021 00:25   |
Oblivion
Messages: 1206 Registered: August 2007
|
Senior Contributor |
|
|
Hello MeerMusik,
Quote:
Also what confused me for a while: In the C++ Header File I have to write "LabelBase Label1" but in the Layout File it is just Upp::Label - guess that is Part of the Charme of UPP.
Layout file is just a simple C++ file, there is nothing magical, no special processing, really. Only a couple of C++ macros (to simplify templating, and naming).
This:
struct MyWindow : TopWindow {
Label label1;
MyWindow()
{
Title("Window title").Sizeable().Zoomable().SetRect(0,0,640, 400);
Add(label1. SetLabel(t_("I am a label")).SetInk(Color(226, 42, 0)).LeftPosZ(13, 243).TopPosZ(20, 144));
}
};
İs not different than this:
Layout:
LAYOUT(MyWindowLayout, 640, 400)
ITEM(Upp::Label, Label1, SetLabel(t_("I am a label")).SetInk(Color(226, 42, 0)).LeftPosZ(13, 243).TopPosZ(20, 144))
END_LAYOUT
Cpp:
#define LAYOUTFILE <MyWindow/MyWindow.lay>
#include <CtrlCore/lay.h>
class MyWindow : public WithMyWindowLayout<TopWindow> {
public:
MyWindow()
{
CtrlLayout(*this, "Window title");
}
};
The layout code does the ctrl instantiating for you. That's all. While the latter may seem complex at first glance, it actually simplifies things a lot, if you build complex GUIs. Not to mention it relies on C++ templating rules so the errors will be catched by the c++ compiler on compile-time.
Best regards,
Oblivion
Github page: https://github.com/ismail-yilmaz
upp-components: https://github.com/ismail-yilmaz/upp-components
Bobcat the terminal emulator: https://github.com/ismail-yilmaz/Bobcat
[Updated on: Wed, 19 May 2021 00:51] Report message to a moderator
|
|
|
|
Goto Forum:
Current Time: Fri May 09 09:33:53 CEST 2025
Total time taken to generate the page: 0.00417 seconds
|