SettlersView
The main game window. SettlersView houses all of the UI elements in the game, maintaining them when the size of the main window changes, or when a user initiates a total UI resize event. SettlersView is built on top of wxSettlersGLCanvas, which means that all of the UI and OpenGL display comes together in one place, cleanly separated through inheritance.
Derived From
wxSettlersGLCanvas
Project
Cities3D
Include
SettlersView.h
Summary
| |
| |
| |
| The SettlersView constructor. |
| |
| The SettlersView destructor. |
| |
| The wxWidgets event table declaration. |
| |
| |
| |
| |
| |
| |
| Initializes all UI objects. |
| Executes a total UI resize. |
| |
| |
| |
| The std::list of UI elements. |
Public
Summary
| |
| The SettlersView constructor. |
| |
| The SettlersView destructor. |
| |
| The wxWidgets event table declaration. |
SettlersView
| SettlersView( | | wxWindow | * | parent, | | | | const | wxWindowID | | id | = -1, | | | const | wxPoint | & | pos | = wxDefaultPosition, | | | const | wxSize | & | size | = wxDefaultSize, | | | | long | | style | = 0, | | | const | wxString | & | name | = wxT("SettlersView"), | | | | wxInt32 | * | attrib | = NULL | ) |
|
The SettlersView constructor. Calls the base class wxSettlersGLCanvas with all of the parameters. Adds OnInitializeUI as a receiver of the eventInitializeUI Event via the Controller. Adds OnTotalUIResize as a receiver of the eventTotalUIResize Event.
Parameters
| parent | The parent window (must not be NULL). |
| id | The id for message handling. |
| pos | The starting position. |
| size | The starting size. |
| style | The window style, using wxWindow parameters. |
| name | The name. |
| attrib | Starting OpenGL implementation attributes. |
~SettlersView
The SettlersView destructor. Removes the OnTotalUIResize receiver of the eventTotalUIResize Event.
DECLARE_EVENT_TABLE
The wxWidgets event table declaration.
Private
Summary
| |
| |
| |
| |
| |
| Initializes all UI objects. |
| Executes a total UI resize. |
| |
| |
| |
| The std::list of UI elements. |
InitializeControls
| void InitializeControls( | UI | *& | uiMessage | ) |
|
Creates the MessageUI, the ControlsUI, and the TurnUI.
Parameters
| uiMessage | A pointer that should be set to the created MessageUI. |
InitializePlayers
| void InitializePlayers( | const | GamePtr | & | game | ) |
|
Creates all of the PlayerUIs and the BankUI
Parameters
| game | The current Game object. |
InitializeBuild
| void InitializeBuild( | UI | * | uiMessage | ) |
|
Creates all of the BuildUIs by reading the BuildData provided by the loaded RuleSets.
Parameters
OnInitializeUI
| void OnInitializeUI( | GamePtr | game | ) |
|
Initializes all UI objects. Creates each of the UI objects by calling the initialize functions. Repositions them all immediately so they show up on the screen in the correct locations. Calls eventPlayerUI to have the PlayerUIs and the BankUI update themselves. Removes OnInitializeUI as a receiver of the eventInitializeUI Event. Calls OnTotalUIResize with the resize value stored in the ConfigDatabase.
Parameters
| game | The current Game object. |
OnTotalUIResize
| void OnTotalUIResize( | float | fPercent | ) |
|
Executes a total UI resize. Hides all UI elements, but records whether they were visible or not. Calls TotalUIResize on each of them with the given resize percent. Reshows all UI elements that were visible.
Parameters
| fPercent | The total ui resize percentage. Ranges from 1.0 to 2.0 inclusive. |
OnSize
| void OnSize( | wxSizeEvent | & | event | ) |
|
Resizes the window. Repositions every UI element so it is located properly on the screen.
Parameters
mUIList
The std::list of UI elements.