wxSelectMapDialog

Dialog that allows map selection and Cities & Knights rules to be turned on.

Derived From

wxBaseDialog

Project

Cities3D

Include

SelectMapDialog.h

Summary
Dialog that allows map selection and Cities & Knights rules to be turned on.
The wxSelectMapDialog constructor.
Returns whether the user has turned on Cities & Knights rules.
Returns the MapDatabase index of the selected map.
The wxWidgets event table declaration.
Handles the OK button click event.
Handles a selection in the wxMapTextCtrl.
Handles a double-click in the wxMapTextCtrl.
Sorts the wxMapListCtrl by the clicked-on column.
Whether the user has turned on Cities & Knights rules.
The index in the MapDatabase of the selected map.

Public

Summary
The wxSelectMapDialog constructor.
Returns whether the user has turned on Cities & Knights rules.
Returns the MapDatabase index of the selected map.
The wxWidgets event table declaration.

Constructors

wxSelectMapDialog

wxSelectMapDialog(wxWindow *parent,
bool ck,
wxInt32 index)

The wxSelectMapDialog constructor.  If a map is currently loaded, selects the map in the wxMapTextCtrl.  Sets the Cities & Knights wxBaseCheckBox to the given value.  Disables the OK button.

Parameters

parentThe parent window.
ckWhether Cities & Knights rules are being played.
indexThe index of the current selected map.  May be -1 if no map is selected.

Functions

GetCK

bool GetCK() const

Returns whether the user has turned on Cities & Knights rules.

Returns

A bool value that is true if the user has turned on Cities & Knights rules and false if they have not.

GetIndex

wxInt32 GetIndex() const

Returns the MapDatabase index of the selected map.

Returns

The MapDatabase index of the selected map.

Variables

DECLARE_EVENT_TABLE

The wxWidgets event table declaration.

Private

Summary
Handles the OK button click event.
Handles a selection in the wxMapTextCtrl.
Handles a double-click in the wxMapTextCtrl.
Sorts the wxMapListCtrl by the clicked-on column.
Whether the user has turned on Cities & Knights rules.
The index in the MapDatabase of the selected map.

Virtual Functions

Ok

virtual void Ok()

Handles the OK button click event.  Updates the mIndex and mCK flags and then calls the base class Ok handler to exit the dialog.

Event Message Handling

OnMapSelected

void OnMapSelected(wxListEvent &event)

Handles a selection in the wxMapTextCtrl.  Enables the OK button if a map is selected, disables it if not.

Parameters

eventThe list selection event.

OnMapDoubleClick

void OnMapDoubleClick(wxListEvent &event)

Handles a double-click in the wxMapTextCtrl.  Immediately calls Ok to exit the dialog.  Shortcut instead of having to select a map and click the OK button.

Parameters

eventThe list selection event.

OnMapColumnClick

void OnMapColumnClick(wxListEvent &event)

Sorts the wxMapListCtrl by the clicked-on column.

Parameters

eventThe list selection event.

Variables

mCK

bool mCK

Whether the user has turned on Cities & Knights rules.  True if they have, false if not.

mIndex

wxInt32 mIndex

The index in the MapDatabase of the selected map.

wxSelectMapDialog(wxWindow *parent,
bool ck,
wxInt32 index)
The wxSelectMapDialog constructor.
bool GetCK() const
Returns whether the user has turned on Cities & Knights rules.
wxInt32 GetIndex() const
Returns the MapDatabase index of the selected map.
Still volatile.
virtual void Ok()
Handles the OK button click event.
void OnMapSelected(wxListEvent &event)
Handles a selection in the wxMapTextCtrl.
Displays information about the currently selected map in a text control.
void OnMapDoubleClick(wxListEvent &event)
Handles a double-click in the wxMapTextCtrl.
void OnMapColumnClick(wxListEvent &event)
Sorts the wxMapListCtrl by the clicked-on column.
A list control displaying all maps in the MapDatabase.
bool mCK
Whether the user has turned on Cities & Knights rules.
wxInt32 mIndex
The index in the MapDatabase of the selected map.
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.
A basic check box window.