wxAddPlayerDialog

Dialog that allows users to add or edit players.

Derived From

wxBaseDialog

Project

Cities3D

Include

AddPlayerDialog.h

Summary
Dialog that allows users to add or edit players.
The wxAddPlayerDialog constructor.
Returns the local Player data being edited.
Handles the OK button click event.
The index in the PlayerDatabase of the player being edited.

Public

Summary
The wxAddPlayerDialog constructor.
Returns the local Player data being edited.

Constructors

wxAddPlayerDialog

wxAddPlayerDialog(wxWindow *parent, 
wxInt32 index = -1)

The wxAddPlayerDialog constructor.  Initializes the local Player information.  If the given index is nonnegative, the local Player information is initialized with the data for that index in the PlayerDatabase.  Otherwise, it is initialized to a default constructed Player.

Parameters

parentThe parent window.
indexThe index in the PlayerDatabase of the Player being edited, or -1 if it is a new Player.

Functions

GetPlayer

const Player &GetPlayer()

Returns the local Player data being edited.

Returns

A const reference to the local Player data.

Private

Summary
Handles the OK button click event.
The index in the PlayerDatabase of the player being edited.

Virtual Functions

Ok

virtual void Ok()

Handles the OK button click event.  Updates the local Player data with all information from the dialog window.  Adds the Player to the PlayerDatabase if it is a new player, or updates the existing Player in the PlayerDatabase.  Then calls the base class Ok handler to exit the dialog.

Variables

mIndex

wxInt32 mIndex

The index in the PlayerDatabase of the player being edited.  May be -1 if it is a new player.

wxAddPlayerDialog(wxWindow *parent, 
wxInt32 index = -1)
The wxAddPlayerDialog constructor.
const Player &GetPlayer()
Returns the local Player data being edited.
Still volatile.
virtual void Ok()
Handles the OK button click event.
wxInt32 mIndex
The index in the PlayerDatabase of the player being edited.
Still volatile.
A common base class for dialog boxes.
Cities3D is a cross-platform implementation of the board game Settlers of Catan with all expansions, including Seafarers, and Cities & Knights.