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 » can't use SetLabel and Tip for Option (only one or the other)
can't use SetLabel and Tip for Option (only one or the other) [message #9703] Fri, 25 May 2007 20:48 Go to next message
obijohn is currently offline  obijohn
Messages: 11
Registered: May 2007
Promising Member
If a Tip is set in the Layout Designer for an Option control, and a label is set also in the designer (in the SetLabel section), there is a compile error generated:
C:/MyApps/test.lay:2: error: 'class Upp::Ctrl' has no member named 'SetLabel'


Removing either the tip or label from the designer (and manually setting it in code) fixes the compile issue.

I've attached a simple test case.
  • Attachment: test.zip
    (Size: 0.92KB, Downloaded 443 times)
Re: can't use SetLabel and Tip for Option (only one or the other) [message #9705 is a reply to message #9703] Fri, 25 May 2007 21:32 Go to previous messageGo to next message
obijohn is currently offline  obijohn
Messages: 11
Registered: May 2007
Promising Member
I've looked at the .lay file, and for my test case (attached above) this is what it looks like:
LAYOUT(testLayout, 232, 148)
	ITEM(Option, optCheck, Tip(t_("Remove this tip from the layout to compile")).SetLabel(t_("Check Me")).LeftPosZ(72, 84).TopPosZ(64, 20))
END_LAYOUT


Now, if I swap the order of Tip and SetLable to this:
LAYOUT(testLayout, 232, 148)
	ITEM(Option, optCheck, SetLabel(t_("Check Me")).Tip(t_("Remove this tip from the layout to compile")).LeftPosZ(72, 84).TopPosZ(64, 20))
END_LAYOUT


it compiles without error and works as expected. I have no experience with the upp source, so I'm not even sure where to begin looking to fix this.
Re: can't use SetLabel and Tip for Option (only one or the other) [message #9944 is a reply to message #9705] Sun, 10 June 2007 17:07 Go to previous messageGo to next message
obijohn is currently offline  obijohn
Messages: 11
Registered: May 2007
Promising Member
I've looked into the source some and I still can't figure out where the problem lies. On the one hand, it seems like it should be easy just to fix the order in which SetLabel and Tip are written in the .lay file. On the other hand, I can't find where this order is determined at all!

If someone could point me to the proper place(s) in the source(s), I could try to fix this myself. Any help here?
Re: can't use SetLabel and Tip for Option (only one or the other) [message #9985 is a reply to message #9944] Tue, 12 June 2007 16:33 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13986
Registered: November 2005
Ultimate Member
Quick fix:

ctrl Option {
	group "Push";

	Text   SetLabel @1 ? "Option text";
	Font   SetFont = StdFont() @1;
	Frame  SetFrame @2;
	bool   BlackEdge;
	bool   SwitchImage;
	bool   SetEditable = true @1 ? "Editable";
	bool   ThreeState;
	bool   NotNull;
	Text   Tip @2;


("@2" does the trick -> means put this 2 inheritance levels deeper).
Re: can't use SetLabel and Tip for Option (only one or the other) [message #9990 is a reply to message #9985] Tue, 12 June 2007 22:18 Go to previous message
obijohn is currently offline  obijohn
Messages: 11
Registered: May 2007
Promising Member
Thanks, that did the trick. It took me a while to locate this in the source, so I'll mention it here in case anyone else needs to find it. It's located in the uppsrc/CtrlLib/CtrlLib.usc file, starting at about line 328.

Since this is an ESC macro, the upp (and ide) source doesn't need to be recompiled after making the change.
Previous Topic: "Visual Inheritance" possible?
Next Topic: Wrong behaviour when switching from text to graphical mode [BUG]
Goto Forum:
  


Current Time: Sun Jun 23 15:48:54 CEST 2024

Total time taken to generate the page: 0.02279 seconds