summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMateusz Kaduk <mateusz.kaduk@gmail.com>2004-12-22 19:59:42 +0000
committerMateusz Kaduk <mateusz.kaduk@gmail.com>2004-12-22 19:59:42 +0000
commitde6b321862d4f0329326bdc44934614df5e411ea (patch)
treef4240950066cc57405c5252c7de2f69ee3a3152c
parente591000b3f7c24ebdaa3c46d24068951ce410dfa (diff)
downloadmana-de6b321862d4f0329326bdc44934614df5e411ea.tar.gz
mana-de6b321862d4f0329326bdc44934614df5e411ea.tar.bz2
mana-de6b321862d4f0329326bdc44934614df5e411ea.tar.xz
mana-de6b321862d4f0329326bdc44934614df5e411ea.zip
Added fullscreen mode checkbox in setup window
-rw-r--r--src/gui/setup.cpp18
-rw-r--r--src/gui/setup.h3
2 files changed, 17 insertions, 4 deletions
diff --git a/src/gui/setup.cpp b/src/gui/setup.cpp
index 1e75e82d..84c3b2be 100644
--- a/src/gui/setup.cpp
+++ b/src/gui/setup.cpp
@@ -4,12 +4,14 @@
* This module takes care of everything relating to the
* setup dialog.
*/
-
#include "setup.h"
+#include <allegro.h>
+
/*
* Metod returns the number of elements in container
*/
int ModesListModel::getNumberOfElements() {
+ //TODO after moving to SDL
return 3;
}
@@ -27,7 +29,6 @@ std::string ModesListModel::getElementAt(int i) {
{ 800,600, "800x600" },
{ 1024,768, "1024x768" }
};
-
return(modes[i].desc);
}
@@ -41,6 +42,7 @@ Setup::Setup(gcn::Container *parent)
displayLabel = new gcn::Label("Display");
modesList = new gcn::ListBox(modesListModel);
scrollArea = new gcn::ScrollArea(modesList);
+ fsCheckBox = new CheckBox("Full screen", false);
applyButton = new Button("Apply");
cancelButton = new Button("Cancel");
@@ -57,6 +59,7 @@ Setup::Setup(gcn::Container *parent)
/* Set position */
scrollArea->setPosition(10,40);
displayLabel->setPosition(10,10);
+ fsCheckBox->setPosition(100,16);
applyButton->setPosition(10,190);
cancelButton->setPosition(150,190);
@@ -67,6 +70,7 @@ Setup::Setup(gcn::Container *parent)
/* Assemble dialog */
add(scrollArea);
add(displayLabel);
+ add(fsCheckBox);
add(applyButton);
add(cancelButton);
@@ -84,6 +88,7 @@ Setup::~Setup() {
delete modesListModel;
delete modesList;
delete scrollArea;
+ delete fsCheckBox;
delete displayLabel;
delete applyButton;
delete cancelButton;
@@ -97,8 +102,13 @@ void Setup::action(const std::string& eventId)
if(eventId == "apply") {
setVisible(false);
//TODO: Save&apply setup changes
- }
- else if(eventId == "cancel") {
+ if(fsCheckBox->isMarked() == true) {
+ set_gfx_mode(GFX_AUTODETECT_FULLSCREEN,800,600,0,0);
+ } else {
+ set_gfx_mode(GFX_AUTODETECT_WINDOWED,800,600,0,0);
+ }
+
+ } else if(eventId == "cancel") {
setVisible(false);
}
}
diff --git a/src/gui/setup.h b/src/gui/setup.h
index 1cb766d0..3c43f727 100644
--- a/src/gui/setup.h
+++ b/src/gui/setup.h
@@ -7,6 +7,8 @@
#define tmw_included_setup_h
#include "gui.h"
+#include "button.h"
+#include "checkbox.h"
#include "../graphic/graphic.h"
#include <allegro.h>
#ifdef WIN32
@@ -33,6 +35,7 @@ class Setup : public Window, public gcn::ActionListener {
gcn::Label *displayLabel;
gcn::ScrollArea *scrollArea;
gcn::ListBox *modesList;
+ CheckBox *fsCheckBox;
Button *applyButton;
Button *cancelButton;