Home » U++ Library support » Draw, Display, Images, Bitmaps, Icons » Wy StyleNormal().Write() is global?
Re: Wy StyleNormal().Write() is global? [message #40746 is a reply to message #40709] |
Thu, 12 September 2013 18:48 |
iST1
Messages: 107 Registered: August 2013
|
Experienced Member |
|
|
It is possible to switch button's look programmatically without mouse click?
Button btn_;//in global space or in class
Button::Style styleBtn_;//in global space or in class
....
SetButtonImgStyle(btn_, styleBtn_, img0, img1, img2, img3);
btn_.Disable(); //=> img3
//btn must be enabled, but with look img3:
btn_.Enable();
btn_.State(3);//Nothing has changed
...
void SetButtonImgStyle(Button &btn, Button::Style &style,
const Image &img1, const Image &img2, const Image &img3, const Image &img4)
{
style = Button::StyleNormal();
style.look[0] = img1;
style.look[1] = img2;
style.look[2] = img3;
style.look[3] = img4;
style.pressoffset = Point(1, -1);
btn.SetStyle(style);
//size as image
Size imgSize = img2.GetSize();
Button::LogPos btnPos = btn.GetPos();
btn.LeftPos(btnPos.x.GetA(), imgSize.cx);
btn.TopPos(btnPos.y.GetA(), imgSize.cy);
}
[Updated on: Thu, 12 September 2013 18:49] Report message to a moderator
|
|
|
Goto Forum:
Current Time: Thu May 16 03:51:12 CEST 2024
Total time taken to generate the page: 0.02701 seconds
|