Home » Community » Newbie corner » Background of static frames
|
Re: Background of static frames [message #31372 is a reply to message #31353] |
Fri, 25 February 2011 19:47   |
|
Hi Jibe,
What do you mean by "static frame"? Maybe piece of code would be helpful 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 
Best regards,
Honza
|
|
|
Re: Background of static frames [message #31374 is a reply to message #31353] |
Fri, 25 February 2011 23:23   |
 |
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   |
|
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 
Andrei
|
|
|
|
|
|
Re: Background of static frames [message #31402 is a reply to message #31399] |
Tue, 01 March 2011 10:04   |
 |
koldo
Messages: 3432 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 #31406 is a reply to message #31404] |
Tue, 01 March 2011 10:26   |
|
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
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
|
|
|
|
Goto Forum:
Current Time: Mon Apr 28 18:03:45 CEST 2025
Total time taken to generate the page: 0.00988 seconds
|