OpenXcom  1.0
Open-source clone of the original X-Com
OptionsVideoState.h
1 #pragma once
2 /*
3  * Copyright 2010-2016 OpenXcom Developers.
4  *
5  * This file is part of OpenXcom.
6  *
7  * OpenXcom is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * OpenXcom is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with OpenXcom. If not, see <http://www.gnu.org/licenses/>.
19  */
20 #include "../Engine/State.h"
21 #include "OptionsBaseState.h"
22 #include <SDL.h>
23 
24 namespace OpenXcom
25 {
26 
27 class TextButton;
28 class ToggleTextButton;
29 class Text;
30 class TextEdit;
31 class ArrowButton;
32 class ComboBox;
33 class InteractiveSurface;
34 
40 {
41 private:
42  static const std::string GL_EXT, GL_FOLDER, GL_STRING;
43 
44  InteractiveSurface *_displaySurface;
45  Text *_txtDisplayResolution, *_txtDisplayX;
46  TextEdit *_txtDisplayWidth, *_txtDisplayHeight;
47  ArrowButton *_btnDisplayResolutionUp, *_btnDisplayResolutionDown;
48 
49  Text *_txtLanguage, *_txtFilter, *_txtGeoScale, *_txtBattleScale;
50  ComboBox *_cbxLanguage, *_cbxFilter, *_cbxDisplayMode, *_cbxGeoScale, *_cbxBattleScale;
51  Text *_txtMode;
52  Text *_txtOptions;
53  ToggleTextButton *_btnLetterbox, *_btnLockMouse, *_btnRootWindowedMode;
54 
55  SDL_Rect** _res;
56  int _resAmount, _resCurrent;
57  std::vector<std::string> _langs, _filters;
58 
59  std::string ucWords(std::string str);
60  void updateDisplayResolution();
61 public:
63  OptionsVideoState(OptionsOrigin origin);
67  void btnDisplayResolutionUpClick(Action *action);
71  void txtDisplayWidthChange(Action *action);
73  void txtDisplayHeightChange(Action *action);
75  void cbxLanguageChange(Action *action);
77  void cbxFilterChange(Action *action);
79  void updateDisplayMode(Action *action);
81  void btnLetterboxClick(Action *action);
83  void btnLockMouseClick(Action *action);
85  void btnRootWindowedModeClick(Action *action);
87  void updateBattlescapeScale(Action *action);
89  void updateGeoscapeScale(Action *action);
91  void resize(int &, int &);
93  void handle(Action *action);
96 };
97 
98 }
void btnLetterboxClick(Action *action)
Handler for clicking the Letterboxed button.
Definition: OptionsVideoState.cpp:547
Container for all the information associated with a given user action, like mouse clicks...
Definition: Action.h:32
void unpressRootWindowedMode()
Unpresses Root Window Pos button.
Definition: OptionsVideoState.cpp:628
Surface that the user can interact with.
Definition: InteractiveSurface.h:37
Definition: ToggleTextButton.h:27
Screen that lets the user configure various Video options.
Definition: OptionsVideoState.h:39
Text string displayed on screen.
Definition: Text.h:40
~OptionsVideoState()
Cleans up the Options state.
Definition: OptionsVideoState.cpp:326
void updateGeoscapeScale(Action *action)
Handler for updating the selected geoscape scale.
Definition: OptionsVideoState.cpp:582
void cbxLanguageChange(Action *action)
Handler for changing the Language combobox.
Definition: OptionsVideoState.cpp:463
void updateBattlescapeScale(Action *action)
Handler for updating the selected battlescape scale.
Definition: OptionsVideoState.cpp:591
void btnLockMouseClick(Action *action)
Handler for clicking the Lock Mouse button.
Definition: OptionsVideoState.cpp:556
void btnDisplayResolutionUpClick(Action *action)
Handler for clicking the Next Resolution button.
Definition: OptionsVideoState.cpp:356
void txtDisplayHeightChange(Action *action)
Handler for changing the Display Height text.
Definition: OptionsVideoState.cpp:436
Text button with a list dropdown when pressed.
Definition: ComboBox.h:36
Button with an arrow on it.
Definition: ArrowButton.h:35
void resize(int &, int &)
Update the resolution settings, we just resized the window.
Definition: OptionsVideoState.cpp:601
void updateDisplayMode(Action *action)
Handler for clicking the Display Mode combobox.
Definition: OptionsVideoState.cpp:514
void handle(Action *action)
Handles keypresses.
Definition: OptionsVideoState.cpp:616
void txtDisplayWidthChange(Action *action)
Handler for changing the Display Width text.
Definition: OptionsVideoState.cpp:409
Editable version of Text.
Definition: TextEdit.h:35
void btnRootWindowedModeClick(Action *action)
Handler for clicking the Root Window Pos button.
Definition: OptionsVideoState.cpp:566
Definition: BaseInfoState.cpp:40
Options base state for common stuff across Options windows.
Definition: OptionsBaseState.h:41
void btnDisplayResolutionDownClick(Action *action)
Handler for clicking the Previous Resolution button.
Definition: OptionsVideoState.cpp:375
void cbxFilterChange(Action *action)
Handler for changing the Filter combobox.
Definition: OptionsVideoState.cpp:472
OptionsVideoState(OptionsOrigin origin)
Creates the Options state.
Definition: OptionsVideoState.cpp:47