HoverRace  2.0
DisplaySelectScene.h
Go to the documentation of this file.
1 
2 // DisplaySelectScene.h
3 //
4 // Copyright (c) 2014, 2015 Michael Imamura.
5 //
6 // Licensed under GrokkSoft HoverRace SourceCode License v1.0(the "License");
7 // you may not use this file except in compliance with the License.
8 //
9 // A copy of the license should have been attached to the package from which
10 // you have taken this file. If you can not find the license you can not use
11 // this file.
12 //
13 //
14 // The author makes no representations about the suitability of
15 // this software for any purpose. It is provided "as is" "AS IS",
16 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
17 // implied.
18 //
19 // See the License for the specific language governing permissions
20 // and limitations under the License.
21 
22 #pragma once
23 
24 #include "../../engine/Display/PickList.h"
25 #include "../../engine/Display/RadioButton.h"
26 
27 #include "DialogScene.h"
28 
29 namespace HoverRace {
30  namespace Client {
31  class GameDirector;
32  }
33  namespace Display {
34  class Display;
35  }
36 }
37 
38 namespace HoverRace {
39 namespace Client {
40 
46 {
47  using SUPER = DialogScene;
48 
49 public:
51  const std::string &parentTitle, int monitorIdx, int xRes, int yRes,
52  int refreshRate);
53  virtual ~DisplaySelectScene() { }
54 
55 public:
56  struct Resolution
57  {
58  Resolution(int xRes, int yRes, int refreshRate) :
59  xRes(xRes), yRes(yRes), refreshRate(refreshRate) { }
60 
61  int xRes;
62  int yRes;
64 
65  bool operator==(const Resolution &o) const
66  {
67  return xRes == o.xRes &&
68  yRes == o.yRes &&
69  refreshRate == o.refreshRate;
70  }
71  };
72 
73 public:
74  class ResBucket;
75 
76 public:
77  int GetMonitorIdx() const;
78  const Resolution &GetResolution() const;
79 
80 private:
81  void FilterResGrid();
82  void UpdateResGrid();
83  void UpdateConfirmButtons();
84 
85  void OnResTest();
86  void OnResConfirm();
87 
88 public:
89  using confirmSignal_t = boost::signals2::signal<void()>;
90  confirmSignal_t &GetConfirmSignal() { return confirmSignal; }
91 
92 private:
94  std::shared_ptr<Display::PickList<int>> monitorList;
95  std::shared_ptr<Display::PickList<std::shared_ptr<ResBucket>>> bucketList;
96  std::shared_ptr<Display::PickList<Resolution>> resList;
97  std::shared_ptr<Display::Button> testBtn;
98  std::shared_ptr<Display::Button> confirmBtn;
99 
101 
102  boost::signals2::scoped_connection monitorConn;
103  boost::signals2::scoped_connection bucketConn;
104  boost::signals2::scoped_connection resConn;
105  boost::signals2::scoped_connection testConn;
106  boost::signals2::scoped_connection confirmConn;
107 };
108 
109 } // namespace Client
110 } // namespace HoverRace
Resolution(int xRes, int yRes, int refreshRate)
Definition: DisplaySelectScene.h:58
virtual ~DisplaySelectScene()
Definition: DisplaySelectScene.h:53
Resolution reqRes
Definition: DisplaySelectScene.h:93
Interface for game client shells.
Definition: GameDirector.h:57
boost::signals2::scoped_connection resConn
Definition: DisplaySelectScene.h:104
boost::signals2::scoped_connection confirmConn
Definition: DisplaySelectScene.h:106
int yRes
Definition: DisplaySelectScene.h:62
int xRes
Definition: DisplaySelectScene.h:61
int refreshRate
Definition: DisplaySelectScene.h:63
boost::signals2::scoped_connection monitorConn
Definition: DisplaySelectScene.h:102
GameDirector & director
Definition: TestLabScene.cpp:160
std::shared_ptr< Display::PickList< std::shared_ptr< ResBucket > > > bucketList
Definition: DisplaySelectScene.h:95
confirmSignal_t & GetConfirmSignal()
Definition: DisplaySelectScene.h:90
boost::signals2::scoped_connection testConn
Definition: DisplaySelectScene.h:105
boost::signals2::signal< void()> confirmSignal_t
Definition: DisplaySelectScene.h:89
Base class for scenes with a title and status area.
Definition: DialogScene.h:46
Base class for display managers.
Definition: Display.h:73
confirmSignal_t confirmSignal
Definition: DisplaySelectScene.h:100
std::shared_ptr< Display::Button > confirmBtn
Definition: DisplaySelectScene.h:98
Base class for full-scene menus and the like.
Definition: FormScene.h:48
boost::signals2::scoped_connection bucketConn
Definition: DisplaySelectScene.h:103
std::shared_ptr< Display::Button > testBtn
Definition: DisplaySelectScene.h:97
std::shared_ptr< Display::PickList< int > > monitorList
Definition: DisplaySelectScene.h:94
std::shared_ptr< Display::PickList< Resolution > > resList
Definition: DisplaySelectScene.h:96
Selector for monitor and resolution.
Definition: DisplaySelectScene.h:45
Definition: Announcement.h:24
bool operator==(const Resolution &o) const
Definition: DisplaySelectScene.h:65
Definition: DisplaySelectScene.cpp:46
Definition: DisplaySelectScene.h:56