U++ Forum - RDF feed
https://www.ultimatepp.org/forums/
Drawing Backgroud
https://www.ultimatepp.org/forums/index.php?t=rview&goto=7314&th=1822#msg_7314
2)Than, I paintd the GUI as White.
3)But now I want to insert an image as a Background of the
GUI that is already displaing the tree menu.
4)Thats is possible.
5) Why the stand code to Display an image do not show any image.
6) If I take the lines that insert the Tree in the GUI the image
appears.
Any Sugestion?
Check the Code
--------------------------------
xadrez::xadrez()
{
Progress pi;
CtrlLayout(*this, "Xadrez Postal 1.0");
estadoxadrezpostal = "Bem vindo ao Xadrez Postal !";
AddFrame(menu);
menu.Add("Ajuda", THISBACK(ajuda));
menu.Add("Sobre Xadrez Postal", THISBACK(sobre));
menu.Add("Sair",THISBACK(sair));
AddFrame(estadoxadrezpostal);
horizontal.Add(arvoredeescolha);
Add(horizontal.Horz().SizePos());
arvoredeescolha.MultiSelect();
arvoredeescolha.WhenOpen = THISBACK(OpenDir);
arvoredeescolha.WhenClose = THISBACK(CloseDir);
arvoredeescolha.WhenCursor = THISBACK(ShowPath);
arvoredeescolha.WhenLeftDouble = THISBACK(TratarOpcoesDeArvore);
arvoredeescolha.SetRoot(CtrlImg::Dir(), "Entrada");
pi.AlignText(ALIGN_LEFT);
LoadTree(0, "Entrada", pi);
BackPaint();
}
And
void Paint(Draw& w)
{
Size sz = GetSize();
w.DrawRect(sz, SWhite);
Size isz = vacat().GetSize();
w.DrawImage((sz.cx - isz.cx) / 2, (sz.cy - isz.cy) / 2, vacat());
}
----------------------------------------------------------
Best Regards ]]>AngelPortal2006-12-21T15:24:06-00:00Re: Drawing Backgroud
https://www.ultimatepp.org/forums/index.php?t=rview&goto=7317&th=1822#msg_7317
Other than that, code is way to incomplete to give better advice.
Please post something compilable.
(And yes, it is possible).
Mirek]]>mirek2006-12-21T20:47:54-00:00Re: Drawing Backgroud
https://www.ultimatepp.org/forums/index.php?t=rview&goto=7330&th=1822#msg_7330
It is a beginning of a software.
The main Idea it is to use a Tree
as a menu, but I also want to insert
an background image instead of White.
Angel Portal
Just go inside of you MyApps and expand this file.
Open TheIDE and select xadrez package.]]>AngelPortal2006-12-22T14:57:00-00:00Re: Drawing Backgroud
https://www.ultimatepp.org/forums/index.php?t=rview&goto=7331&th=1822#msg_7331
Angel Portal]]>AngelPortal2006-12-22T15:17:00-00:00Re: Drawing Backgroud
https://www.ultimatepp.org/forums/index.php?t=rview&goto=7334&th=1822#msg_7334
The trouble is that you cannot simply override the background of opaque widget. The Paint you have overriden works, but is hidden "behind" the TreeCtrl.
Mirek]]>mirek2006-12-22T17:51:36-00:00Re: Drawing Backgroud
https://www.ultimatepp.org/forums/index.php?t=rview&goto=7336&th=1822#msg_7336
AngelPortal2006-12-22T18:55:48-00:00Re: Drawing Backgroud
https://www.ultimatepp.org/forums/index.php?t=rview&goto=7343&th=1822#msg_7343
Or we will have to alter the U++ library code. Just let me a while to chew this request, it is quite unusual.
....(20 minutes later)
OK, TreeCtrl now has "NoBackground" method. Combine with "Transparent".
I will add NoBackground to all "view" widgets.
Mirek]]>mirek2006-12-23T08:27:46-00:00Re: Drawing Backgroud
https://www.ultimatepp.org/forums/index.php?t=rview&goto=7387&th=1822#msg_7387
NoBackground method,is that what you sad?