Home » U++ Library support » Look and Chameleon Technology » LabelBox style
|
Re: LabelBox style [message #53745 is a reply to message #53742] |
Sun, 26 April 2020 15:42 |
Didier
Messages: 697 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 );
|
|
|
Goto Forum:
Current Time: Sat Dec 14 14:35:10 CET 2024
Total time taken to generate the page: 0.01669 seconds
|