31 lines
656 B
C++
31 lines
656 B
C++
#include "libs.h"
|
|
#include "gui.h"
|
|
#include "gui_image_radio_button.h"
|
|
#include "l3d.h"
|
|
|
|
namespace Gui {
|
|
|
|
ImageRadioButton::ImageRadioButton(RadioGroup* g, const char* img_normal,
|
|
const char* img_pressed) : RadioButton(g) {
|
|
m_imgNormal = new Image(img_normal);
|
|
m_imgPressed = new Image(img_pressed);
|
|
float size[2];
|
|
m_imgNormal->GetSizeRequested(size);
|
|
SetSize(size[0], size[1]);
|
|
}
|
|
|
|
void ImageRadioButton::GetSizeRequested(float size[2]) {
|
|
m_imgNormal->GetSizeRequested(size);
|
|
}
|
|
|
|
void ImageRadioButton::Draw(void) {
|
|
if(m_pressed) {
|
|
m_imgPressed->Draw();
|
|
} else {
|
|
m_imgNormal->Draw();
|
|
}
|
|
}
|
|
|
|
}
|
|
|