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++ TheIDE » U++ TheIDE: Layout (Forms) Designer » Is the Layout Designer outdated?
Is the Layout Designer outdated? [message #57057] Tue, 18 May 2021 23:15 Go to next message
MeerMusik is currently offline  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 Go to previous messageGo to next message
Oblivion is currently offline  Oblivion
Messages: 1096
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:

index.php?t=getfile&id=6453&private=0

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 315 times)


[Updated on: Tue, 18 May 2021 23:52]

Report message to a moderator

[Solved] Re: Is the Layout Designer outdated? [message #57059 is a reply to message #57058] Wed, 19 May 2021 00:03 Go to previous messageGo to next message
MeerMusik is currently offline  MeerMusik
Messages: 13
Registered: April 2021
Location: Germany, Lower Saxony, Ha...
Promising Member

No I did not typed that. I did a right click and added it from the Context Menu. No Idea what went wrong. I fixed it now. 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. And here I thought Qt was doing some weird mixed things. Seems UPP is doing even more things to achieve that "Less Lines of Code Concept" Smile

Thank you anyway!
[Solved] Re: Is the Layout Designer outdated? [message #57060 is a reply to message #57059] Wed, 19 May 2021 00:25 Go to previous messageGo to next message
Oblivion is currently offline  Oblivion
Messages: 1096
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


[Updated on: Wed, 19 May 2021 00:51]

Report message to a moderator

Re: [Solved] Re: Is the Layout Designer outdated? [message #57061 is a reply to message #57060] Wed, 19 May 2021 01:04 Go to previous message
MeerMusik is currently offline  MeerMusik
Messages: 13
Registered: April 2021
Location: Germany, Lower Saxony, Ha...
Promising Member

Thanks for the Detailed Explanation! Thumbs Up
Previous Topic: Layout designer distorts .lay files
Next Topic: How to plot a PIE chart in Form?
Goto Forum:
  


Current Time: Sun Jun 23 17:00:46 CEST 2024

Total time taken to generate the page: 0.01934 seconds