1 class ImageToggleButton
: public Button
4 ImageToggleButton(const String
& componentName
, Image imageOff
, Image imageOn
)
5 : Button(componentName
), imageOn(imageOn
), imageOff(imageOff
)
7 frameHeight
= imageOff
.getHeight();
8 frameWidth
= imageOff
.getWidth();
10 setClickingTogglesState (true);
13 void paintButton(Graphics
& g
, bool isMouseOverButton
, bool isButtonDown
)
15 if (this->getToggleState())
17 g
.drawImage(imageOn
, 0, 0, frameWidth
, frameHeight
, 0, 0, frameWidth
, frameHeight
);
21 g
.drawImage(imageOff
, 0, 0, frameWidth
, frameHeight
, 0, 0, frameWidth
, frameHeight
);
28 int frameWidth
, frameHeight
;