U++ framework
Do not panic. Ask here before giving up.

Home » U++ Library support » Menus&Toolbars » Toolbar and gray color in layout
Re: Toolbar and gray color in layout [message #9951 is a reply to message #9948] Mon, 11 June 2007 00:35 Go to previous message
forlano is currently offline  forlano
Messages: 1244
Registered: March 2006
Location: Italy
Senior Contributor
luzr wrote on Sun, 10 June 2007 19:36

Another bug, fixed...

Quick patch:

CtrlLib/Bar.cpp 436:
void BarCtrl::AddCtrl(Ctrl *ctrl, Size sz)
{
	SizeCtrl& m = sizer.DoIndex(zii++);
	m.Transparent(IsTransparent());
	LogPos p = ctrl->GetPos();
	if(p.x.IsEmpty())
		if(sz.cx == INT_MAX)
			ctrl->HSizePos();
		else
			ctrl->HCenterPos(sz.cx ? sz.cx : MINSIZE);
	if(p.y.IsEmpty())
		if(sz.cy == INT_MAX)
			ctrl->VSizePos();
		else
			ctrl->VCenterPos(sz.cy ? sz.cy : MINSIZE);
	LLOG("AddCtrl Ctrl::GetSize: " << ctrl->GetSize());
	m.SetSize(sz);
	m.AddChild(ctrl);
	AddNC(m);
	LLOG("AddCtrl2 Ctrl::GetSize: " << ctrl->GetSize());
}

void BarCtrl::SizeCtrl::Paint(Draw& w)
{
	if(!IsTransparent())
		StaticRect::Paint(w);
}


(and add Paint declaration to SizeCtrl..)


Thanks, it works Very Happy

Just a note. At first my code with the above fix did not work because I had in my constructor
    ...
    toolbar.Set(THISBACK(MainBar));
    toolbar.Transparent();
    ...

instead of the correct order
    ...
    toolbar.Transparent();
    toolbar.Set(THISBACK(MainBar));
    ...

This is because MainBar must know in advance the transparency state of the toolbar.

Luigi
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: MenuBar does not show slahses
Next Topic: CtrlImg::new_doc()
Goto Forum:
  


Current Time: Sat Sep 12 11:37:39 GMT+2 2026

Total time taken to generate the page: 0.00723 seconds