New function: addCheckbox()
svn-id: r18159
This commit is contained in:
parent
9e0c72868b
commit
f0e43fb2a6
2 changed files with 17 additions and 0 deletions
|
@ -298,6 +298,22 @@ ButtonWidget *Dialog::addButton(int x, int y, const Common::String &label, uint3
|
|||
return new ButtonWidget(this, x, y, w, h, label, cmd, hotkey, ws);
|
||||
}
|
||||
|
||||
CheckboxWidget *Dialog::addCheckbox(int x, int y, const Common::String &label, uint32 cmd, char hotkey, WidgetSize ws) {
|
||||
const Graphics::Font *font;
|
||||
int w, h;
|
||||
|
||||
if (ws == kBigWidgetSize) {
|
||||
font = FontMan.getFontByUsage(Graphics::FontManager::kBigGUIFont);
|
||||
h = kBigButtonHeight;
|
||||
} else {
|
||||
font = FontMan.getFontByUsage(Graphics::FontManager::kGUIFont);
|
||||
h = kButtonHeight;
|
||||
}
|
||||
|
||||
w = font->getFontHeight() + 10 + font->getStringWidth(label);
|
||||
|
||||
return new CheckboxWidget(this, x, y, w, h, label, cmd, hotkey, ws);
|
||||
}
|
||||
|
||||
uint32 GuiObject::getMillis() {
|
||||
return g_system->getMillis();
|
||||
|
|
|
@ -88,6 +88,7 @@ protected:
|
|||
Widget *findWidget(int x, int y); // Find the widget at pos x,y if any
|
||||
|
||||
ButtonWidget *addButton(int x, int y, const Common::String &label, uint32 cmd, char hotkey, WidgetSize ws = kDefaultWidgetSize);
|
||||
CheckboxWidget *addCheckbox(int x, int y, const Common::String &label, uint32 cmd, char hotkey, WidgetSize ws = kDefaultWidgetSize);
|
||||
|
||||
void setResult(int result) { _result = result; }
|
||||
int getResult() const { return _result; }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue