[Scummvm-cvs-logs] CVS: scummvm/gui dialog.cpp,1.52,1.53 dialog.h,1.33,1.34

Torbjörn Andersson eriktorbjorn at users.sourceforge.net
Wed May 18 02:22:25 CEST 2005


Update of /cvsroot/scummvm/scummvm/gui
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30434

Modified Files:
	dialog.cpp dialog.h 
Log Message:
New function: addCheckbox()


Index: dialog.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/gui/dialog.cpp,v
retrieving revision 1.52
retrieving revision 1.53
diff -u -d -r1.52 -r1.53
--- dialog.cpp	11 May 2005 19:30:30 -0000	1.52
+++ dialog.cpp	18 May 2005 09:21:03 -0000	1.53
@@ -298,6 +298,22 @@
 	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();

Index: dialog.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/gui/dialog.h,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -d -r1.33 -r1.34
--- dialog.h	11 May 2005 19:30:30 -0000	1.33
+++ dialog.h	18 May 2005 09:21:03 -0000	1.34
@@ -88,6 +88,7 @@
 	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; }





More information about the Scummvm-git-logs mailing list