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 » Community » Newbie corner » Background of static frames
Background of static frames [message #31353] Thu, 24 February 2011 15:57 Go to next message
jibe is currently offline  jibe
Messages: 294
Registered: February 2007
Location: France
Experienced Member
Hi,

I try to change the background of a static frame, but I get errors at compile time...

I do that by changing the background in the layout graphic editor. It seems to work, I see the new background, and error occurs at compile time.

I tried also to do that in the .cpp file, but the assist++ doesn't show the SetBackground function...

Is it missing ? Or am I making something wrong ?
Re: Background of static frames [message #31372 is a reply to message #31353] Fri, 25 February 2011 19:47 Go to previous messageGo to next message
dolik.rce is currently offline  dolik.rce
Messages: 1789
Registered: August 2008
Location: Czech Republic
Ultimate Contributor

Hi Jibe,

What do you mean by "static frame"? Maybe piece of code would be helpful Wink Right now I can just tell you that the method to change background is usually called Background(), without the "Set-" prefix. Of course, if you are trying to use it on some ctrl that doesn't have such method, it will fail.

If it fails to compile after you specify the color in layout editor, than there might be a bug in the .usc file. In that case, please specify which ctrl exactly are you talking about, so we can fix it Wink

Best regards,
Honza
Re: Background of static frames [message #31374 is a reply to message #31353] Fri, 25 February 2011 23:23 Go to previous messageGo to next message
jibe is currently offline  jibe
Messages: 294
Registered: February 2007
Location: France
Experienced Member
Hi dolik.rce,

Thanks for your reply !

Ok, here is a small layout :

LAYOUT(Result, 376, 80)
	ITEM(Label, lblResult, SetAlign(ALIGN_CENTER).LeftPosZ(8, 360).TopPosZ(8, 23))
	ITEM(StaticFrame, frmResult, LeftPosZ(8, 360).TopPosZ(8, 24))
	ITEM(Button, cancel, SetLabel(t_("+ Details ...")).Tip(t_("Click to see the ")).LeftPosZ(296, 72).TopPosZ(36, 15))
	ITEM(Button, ok, SetLabel(t_("Ok")).LeftPosZ(156, 64).TopPosZ(48, 24))
END_LAYOUT


This is compiling and working well. Now, I want a colored frame. I make it easily with the layout graphic editor, and the layout becomes this :

LAYOUT(Result, 376, 80)
	ITEM(Label, lblResult, SetAlign(ALIGN_CENTER).LeftPosZ(8, 360).TopPosZ(8, 23))
	ITEM(StaticFrame, frmResult, SetBackground(LtGreen).LeftPosZ(8, 360).TopPosZ(8, 24))
	ITEM(Button, cancel, SetLabel(t_("+ Details ...")).Tip(t_("Click to see the ")).LeftPosZ(296, 72).TopPosZ(36, 15))
	ITEM(Button, ok, SetLabel(t_("Ok")).LeftPosZ(156, 64).TopPosZ(48, 24))
END_LAYOUT

There is only the SetBackground(LtGreen) added, I repeat that it was made automatically by the graphic editor. But when I compile, I get this error :

main.cpp
In file included from /home/joseph/upp/uppsrc/CtrlCore/lay.h:36,
                 from /home/joseph/upp/MyApps/gXTM/gXTM.h:11,
                 from /home/joseph/upp/MyApps/gXTM/main.cpp:9:
/home/joseph/upp/MyApps/gXTM/gXTM.lay: In function ‘void InitLayout(Upp::Ctrl&, L&, D&, Result__layid&) [with L = WithResult<Upp::TopWindow>, D = WithResult<
	Upp::TopWindow>]’:
/home/joseph/upp/uppsrc/CtrlCore/TopWindow.h:239:   instantiated from ‘void Upp::CtrlLayout(T&) [with T = WithResult<Upp::TopWindow>]’
/home/joseph/upp/uppsrc/CtrlCore/TopWindow.h:247:   instantiated from ‘void Upp::CtrlLayout(T&, const char*) [with T = WithResult<Upp::TopWindow>]’
/home/joseph/upp/uppsrc/CtrlCore/TopWindow.h:253:   instantiated from ‘void Upp::CtrlLayoutOK(T&, const char*) [with T = WithResult<Upp::TopWindow>]’
/home/joseph/upp/uppsrc/CtrlCore/TopWindow.h:267:   instantiated from ‘void Upp::CtrlLayoutOKCancel(T&, const char*) [with T = WithResult<Upp::TopWindow>]’

/home/joseph/upp/MyApps/gXTM/main.cpp:127:   instantiated from here
/home/joseph/upp/MyApps/gXTM/gXTM.lay:24: error: ‘class StaticFrame’ has no member named ‘SetBackground’
gXTM: 1 file(s) built in (0:02.87), 2874 msecs / file, duration = 2877 msecs, parallelization 0%


I tried also Background, but I get the same message. Same also if I try to do that in the C++ code, either with SetBackground as Background. None of those functions appear in the assist++ for StaticFrame class...

I don't think that it could be related to the use of CtrlLayoutOKCancel... Anyway, I tried also with CtrlLayout, and the "StaticFrame has no member named ..." was still there...

Re: Background of static frames [message #31375 is a reply to message #31374] Sat, 26 February 2011 00:36 Go to previous messageGo to next message
unknown user
Hello,

You're using Controls4U from bazaar, right? It seems that Koldo forgot to implement that option in code (see Controls4U.h @195) if he wanted so, or maybe he added it to layout designer by mistake. We're waiting for Koldo to answer Smile

Andrei
Re: Background of static frames [message #31381 is a reply to message #31375] Sat, 26 February 2011 18:45 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3358
Registered: August 2008
Senior Veteran
Oupps, you are right

StaticFrame has SetBackground completely implemented for layout editor (in .usc file). However it was not included in code.

Now, yes... from 3250. Thank you all Smile , and sorry jibe Rolling Eyes .


Best regards
Iñaki
Re: Background of static frames [message #31383 is a reply to message #31353] Sat, 26 February 2011 22:41 Go to previous messageGo to next message
jibe is currently offline  jibe
Messages: 294
Registered: February 2007
Location: France
Experienced Member
Hello,

Thank you to andreincx and more especially to you, koldo ! Don't worry, I just used the StaticFrame without background. I was just surprised that nobody has already seen the bug !

I'll download the last version asap and let you know, but surely it will be Ok !

Thanks to be so fast to fix this Smile Controls4U is nice and useful.

Best regards.

[Updated on: Sat, 26 February 2011 22:43]

Report message to a moderator

Re: Background of static frames [message #31399 is a reply to message #31353] Tue, 01 March 2011 09:25 Go to previous messageGo to next message
jibe is currently offline  jibe
Messages: 294
Registered: February 2007
Location: France
Experienced Member
Hello,

Bad news...

I just installed the last Nightly builds version (3252 on Ubuntu Lucid), and I still have the same problem...

It's the first time I install a Nightly build. Did I missed something ?

I installed these deb packages :
theide_3252-1~lucid0_i386.deb
upp_3252-1~lucid0_all.deb

Then, I opened TheIde, verified the version (3252 - Ok) and tried again to build my project. I was surprised that it built only main.cpp, so I did a build-all to rebuild all libraries... but the error about Static Frames is still there.

What is wrong ?

Re: Background of static frames [message #31402 is a reply to message #31399] Tue, 01 March 2011 10:04 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3358
Registered: August 2008
Senior Veteran
jibe wrote on Tue, 01 March 2011 09:25

Hello,

Bad news...

I just installed the last Nightly builds version (3252 on Ubuntu Lucid), and I still have the same problem...

It's the first time I install a Nightly build. Did I missed something ?

I installed these deb packages :
theide_3252-1~lucid0_i386.deb
upp_3252-1~lucid0_all.deb

Then, I opened TheIde, verified the version (3252 - Ok) and tried again to build my project. I was surprised that it built only main.cpp, so I did a build-all to rebuild all libraries... but the error about Static Frames is still there.

What is wrong ?



Hello Jibe

I do no understand. If you did a Rebuild All (little bomb), it would have to work.

Open file Controls4U/Controls4U.cpp, line 334. It would have to be a "StaticFrame::Paint" there.

Try with Controls4U_Demo. In static elements tab (like arrows and squares), there is a StaticFrame with green background. Is it there?


Best regards
Iñaki
Re: Background of static frames [message #31404 is a reply to message #31402] Tue, 01 March 2011 10:15 Go to previous messageGo to next message
jibe is currently offline  jibe
Messages: 294
Registered: February 2007
Location: France
Experienced Member
Thanks for your reply Smile

koldo wrote on Tue, 01 March 2011 10:04

Open file Controls4U/Controls4U.cpp, line 334. It would have to be a
"StaticFrame::Paint" there.

Surely, I did something bad installing the new version... At this line, I have :
void StaticLine::FramePaint(Draw& w, const Rect& rr) {


I'm now investigating what went wrong...
Re: Background of static frames [message #31406 is a reply to message #31404] Tue, 01 March 2011 10:26 Go to previous messageGo to next message
dolik.rce is currently offline  dolik.rce
Messages: 1789
Registered: August 2008
Location: Czech Republic
Ultimate Contributor

Hi guys,
This is known problem in the current packaging/source managment approach, see this thread for details. I am working on a fix for this for quite some time, but so far no one was really interrested because nobody really complained so far Smile

To fix the problem you simply have to manually copy the sources from /usr/share/upp to your local copy (default /home/<user>/upp) after each update...

Best regards,
Honza
Re: Background of static frames [message #31409 is a reply to message #31353] Tue, 01 March 2011 11:14 Go to previous message
jibe is currently offline  jibe
Messages: 294
Registered: February 2007
Location: France
Experienced Member
Thanks, dolik.rce, it was that !

All is working well now.

Thanks to everybody for the reactivity Smile
Previous Topic: expected template name ???
Next Topic: TIme and Idle
Goto Forum:
  


Current Time: Mon Apr 29 12:51:52 CEST 2024

Total time taken to generate the page: 0.02837 seconds