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++ Library support » Look and Chameleon Technology » LabelBox style
LabelBox style [message #53742] Sun, 26 April 2020 12:19 Go to next message
Didier is currently offline  Didier
Messages: 545
Registered: November 2008
Location: France
Contributor
Hello,

I would like to change global LabelBox style (all lable boxes in all panels) in order to be able do this:
index.php?t=getfile&id=6058&private=0

But the code uses PaintEdge() instead of ChPaint()
void PaintLabelBox(Draw& w, Size sz, Color color, int d)
{
...
   ChPaintEdge(w, r, look);
...
}


So I can't do it Sad (or at least I don't know how to do it)

I can look into making a code enhancement proposition if this enhancement is acceptable
  • Attachment: LabelBox.png
    (Size: 7.67KB, Downloaded 73 times)
Re: LabelBox style [message #53745 is a reply to message #53742] Sun, 26 April 2020 15:42 Go to previous message
Didier is currently offline  Didier
Messages: 545
Registered: November 2008
Location: France
Contributor
I finally found how to do it

It doesn't allow me to fine tweek the label, but it will do for now.
struct sChLook_LabelBox {
	Image img;
};

Value Make_ChLook_LabelBox(const Image& img)
{
	sChLook_LabelBox x;
	x.img = MakeButton(8, img, 2, Blue());
	return RawToValue(x);
}

Value ChLookFn_LabelBox(Draw& w, const Rect& r, const Value& v, int op, Color ink) {
	
	if( v.Is<sChLook_LabelBox>() )
	{
		const sChLook_LabelBox& e = v.To<sChLook_LabelBox>();
		ChPaint(w, r, e.img);
		return 1;
	}
	return Null;
}

INITBLOCK {
	ChLookFn(ChLookFn_LabelBox);
}


And at application init:
	static const Value myLabelBoxLook = Make_ChLook_LabelBox(GraphCtrl_DemoImg::CTRL_BACKGND());
	LabelBox::SetLook( myLabelBoxLook );
Previous Topic: Dark theme issues
Goto Forum:
  


Current Time: Sat Jun 06 19:33:22 CEST 2020

Total time taken to generate the page: 0.01068 seconds