Displays game-related messages to the user. The MessageUI is the box that sits in the upper-right corner of the UI and posts game-related information and messages to the user, telling them what is going on at that time. MessageUI is updated by transmitting a DataObject to the eventMessageUI Event via the Controller. The transmitted DataObject must have a wxString as its first parameter and the current Game object as its second. The MessageUI sets its output text to the wxString and updates the color of text based on the color of the current player, determined through the Game object.
MessageUI.h
Displays game-related messages to the user. | |
The MessageUI constructor. | |
The MessageUI destructor. | |
Initializes the MessageUI. | |
Paints the MessageUI. | |
Provides the TraitsUI object for the MessageUI. | |
Resizes the MessageUI. | |
Updates the text in the MessageUI. | |
The output <wxStaticText> control. |
|
The MessageUI constructor. Makes the MessageUI visible and adds OnUpdate as a receiver of the eventMessageUI Event.
| parent | The parent window. Must not be NULL. |
| ~MessageUI() |
The MessageUI destructor. Removes OnUpdate as a receiver of the eventMessageUI Event.
|
Initializes the MessageUI. Creates the wxBaseStaticText control that displays message text, then creates the TraitsUI object with default sizes and calls ResizeUI to set the size of the UI properly.
| game | The current Game. |
Paints the MessageUI. | |
Provides the TraitsUI object for the MessageUI. | |
Resizes the MessageUI. | |
Updates the text in the MessageUI. | |
The output <wxStaticText> control. |
| virtual void ResizeUI() |
Resizes the MessageUI. Uses the internal TraitsUI object to set the width and height for the entire UI. Resizes the wxBaseStaticText control to fill the new dimensions. Recalculates the maximum font size that can fit three lines of text inside the wxBaseStaticText control.
|
Updates the text in the MessageUI. Triggered by the eventMessageUI Event. The given DataObject must have a wxString as its first parameter and the current Game as its second. The wxBaseStaticText control is set to the wxString text and changes its color to the color of the current player (or white if none).
| object | The DataObject containing the update information. Must have a wxString as its first parameter and a Game object as its second. |
|
| ~MessageUI() |
|
|
| virtual const TraitsUIPtr &GetTraitsUI() |
| virtual void ResizeUI() |
|
| boost::shared_ptr<wxStaticText> mText |