Advanced Strategic Command
Classes | Macros | Typedefs | Functions | Variables
dlg_box.h File Reference

Interface for some basic classes from which all of ASC's dialogs are derived. More...

#include "newfont.h"
#include "events.h"
#include "basegfx.h"
Include dependency graph for dlg_box.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  tdlgengine
 
struct  tdlgengine::tbutton
 
struct  tdlgengine::ttaborder
 
class  tdialogbox
 
class  tviewtext
 
struct  tviewtext::tstartpoint
 
class  tviewtextwithscrolling
 
class  tvirtualscreenbuf
 
class  tstringselect
 

Macros

#define dlg_wintitle   1
 
#define dlg_in3d   2
 
#define dlg_notitle   4
 
#define dlg_3dtitle   8
 
#define linesshown   13
 

Typedefs

typedef class tdialogboxpdialogbox
 

Functions

void displaymessage (const char *formatstring, int num,...)
 displays a dialog box with a message More...
 
void displaymessage (const ASCString &text, int num)
 displays a dialog box with a message More...
 
void removemessage (void)
 closes a message dialog box that has been opened by displaymessage() More...
 
void help (int id)
 displays a dialogbog with the given help topic More...
 
void viewtext2 (int id)
 displays a dialogbog with the given message More...
 
int viewtextquery (int id, const char *title, const char *s1, const char *s2)
 
int getplayercolor (int i)
 
void strrd8u (int l, char *s)
 
void strrd8d (int l, char *s)
 
void strrd8n (int l, char *s)
 
char * strrrd8u (int l)
 
char * strrrd8d (int l)
 
char * strrrd8n (int l)
 
ASCString readtextmessage (int id)
 returns the message with the given ID from the message system. More...
 
int getid (const char *title, int lval, int min, int max)
 
ASCString editString (const ASCString &title, const ASCString &defaultValue="")
 
int chooseString (const ASCString &title, const vector< ASCString > &entries, int defaultEntry=-1)
 displays a dialogbox which lets you choose one of a number of strings. More...
 
pair< int, int > chooseString (const ASCString &title, const vector< ASCString > &entries, const vector< ASCString > &buttons, int defaultEntry=-1)
 displays a dialogbox which lets you choose one of a number of strings. More...
 

Variables

int actdisplayedmessage
 
long lastdisplayedmessageticker
 
tvirtualscreenbuf virtualscreenbuf
 

Detailed Description

Interface for some basic classes from which all of ASC's dialogs are derived.

Definition in file dlg_box.h.

Macro Definition Documentation

#define dlg_3dtitle   8

Definition at line 35 of file dlg_box.h.

Referenced by tdialogbox::init(), and tdialogbox::redraw().

#define dlg_in3d   2
#define dlg_notitle   4
#define dlg_wintitle   1

Definition at line 32 of file dlg_box.h.

Referenced by tdialogbox::buildgraphics(), and tdialogbox::redraw().

#define linesshown   13

Definition at line 386 of file dlg_box.h.

Referenced by thelpsystem::buildgraphics(), and tviewanytext::redraw().

Typedef Documentation

typedef class tdialogbox* pdialogbox

Definition at line 152 of file dlg_box.h.

Function Documentation

int chooseString ( const ASCString title,
const vector< ASCString > &  entries,
int  defaultEntry = -1 
)

displays a dialogbox which lets you choose one of a number of strings.

Parameters
titlethe title of the dialog box
entriesthe list of strings
defaultEntrythe entry that is selected by default (-1 if none)
Returns
the selected index or -1 if nothing was selected

Definition at line 3788 of file dlg_box.cpp.

References chooseString().

Referenced by chooseString(), chooseWeather(), editResearch(), editResearchPoints(), editTechAdapter(), CargoGuiFunctions::TransferUnitControl::execute(), generateTechTree(), selectPlayer(), FieldAddressing::setup(), EventTriggered::setup(), ChangeDiplomaticStatus::setup(), SetViewSharing::setup(), Reinforcements::setup(), and ChangePlayerState::setup().

pair<int,int> chooseString ( const ASCString title,
const vector< ASCString > &  entries,
const vector< ASCString > &  buttons,
int  defaultEntry = -1 
)

displays a dialogbox which lets you choose one of a number of strings.

Parameters
titlethe title of the dialog box
entriesthe list of strings
buttonsthe names of the buttons that are going to be displayed
defaultEntrythe entry that is selected by default (-1 if none)
Returns
button-number, selected index

Definition at line 3798 of file dlg_box.cpp.

References tstringselect::action, tstringselect::done(), tstringselect::init(), legacyEventSystemActive(), new_chooseString(), tstringselect::redline, and ChooseString::run().

void displaymessage ( const char *  formatstring,
int  num,
  ... 
)

displays a dialog box with a message

Parameters
formatstringthe text, which may contain the same format arguments as sprintf
num0 normal text, the dialog box will stay visible until removemessage() is called 1 red text for error message 2 fatal error, the program will be closed 3 normal text

Definition at line 1849 of file dlg_box.cpp.

References displaymessage().

Referenced by tdlgengine::addbutton(), tdlgengine::addDropDown(), tdlgengine::addscrollbar(), BuildingConquered::arm(), BuildingLost::arm(), BuildingSeen::arm(), PlayListSelector::buttonpressed(), tgiveunitawaydlg::buttonpressed(), GetResource::checkbuilding(), PutResource::checkbuilding(), tparagraph::checkcursor(), checkforvictory(), ResizeMap::checkvalue(), displaymessage(), trunreplay::error(), execaction(), trunreplay::execnextreplaymove(), LoseMap::execute(), Reinforcements::execute(), executeUserAction(), generatemap(), getbipath(), BuildingConquered::getState(), BuildingDestroyed::getState(), BuildingSeen::getState(), GameMap::getUnit(), tdialogbox::intedit(), CargoItemFactory::itemSelected(), iterateToNextPlayer(), k_loadmap(), legacy_choice_dlg(), loadreplay(), loadStartupMap(), main(), mapeditorMainThread(), mapLoadingExceptionChecker(), MapNetwork::MapNetwork(), movebuilding(), ClipBoardBase::place(), tspfldloaders::readfields(), readOldEvent(), readOldEventLists(), resourceComparison(), trunreplay::run(), AI::run(), ResizeMap::run(), UnitTypeTransformation::run(), savegame(), savemap(), savereplay(), selectunitsetfilter(), ChangeGameParameter::setup(), showbdtbits(), PolygonEditor::showFieldMarking(), statisticDialog(), transformMap(), UnitInfoDialog::UnitInfoDialog(), tspfldloaders::writefields(), and tspfldloaders::writemap().

void displaymessage ( const ASCString text,
int  num 
)

displays a dialog box with a message

Parameters
textthe text
num0 normal text, the dialog box will stay visible until removemessage() is called 1 red text for error message 2 fatal error, the program will be closed 3 normal text

Definition at line 1866 of file dlg_box.cpp.

References tdialogbox::boxstatus, displayLogMessage(), tdialogbox::done(), tdisplaymessage::init(), legacyEventSystemActive(), messagebox, and tdisplaymessage::run().

ASCString editString ( const ASCString title,
const ASCString defaultValue = "" 
)
int getid ( const char *  title,
int  lval,
int  min,
int  max 
)
int getplayercolor ( int  i)

Definition at line 303 of file dlg_box.cpp.

References actmap.

Referenced by tdialogbox::init().

void help ( int  id)

displays a dialogbog with the given help topic

See Also
viewtext2(int)

Definition at line 3286 of file dlg_box.cpp.

References readtextmessage(), and ASC_PG_Dialog::RunModal().

Referenced by execaction_pg(), executeUserAction(), MailOptionsDialog::MailOptionsDialog(), tmapgenerator::run(), and tplayerchange::run().

ASCString readtextmessage ( int  id)

returns the message with the given ID from the message system.

This system spans the helpfiles and the message files associated with the maps

Definition at line 3048 of file dlg_box.cpp.

References actmap, displayLogMessage(), tfindfile::getnextname(), GameMap::PreferredFilenames::mapname, GameMap::preferredFileNames, tnstream::reading, and strrr().

Referenced by execaction(), help(), helpAbout(), thelpsystem::init(), MailOptionsDialog::MailOptionsDialog(), viewtext2(), and ViewTextQuery::ViewTextQuery().

void removemessage ( void  )

closes a message dialog box that has been opened by displaymessage()

Definition at line 1976 of file dlg_box.cpp.

References tdialogbox::boxstatus, tdialogbox::done(), and messagebox.

void strrd8d ( int  l,
char *  s 
)

Definition at line 57 of file dlg_box.cpp.

References itoa(), and minmalq.

void strrd8n ( int  l,
char *  s 
)

Definition at line 67 of file dlg_box.cpp.

References itoa(), and minmalq.

void strrd8u ( int  l,
char *  s 
)

Definition at line 62 of file dlg_box.cpp.

References itoa(), and minmalq.

char* strrrd8d ( int  l)

Definition at line 73 of file dlg_box.cpp.

References itoa(), minmalq, and strrstring.

Referenced by displaywindspeed().

char* strrrd8n ( int  l)

Definition at line 87 of file dlg_box.cpp.

References itoa(), minmalq, and strrstring.

char* strrrd8u ( int  l)

Definition at line 80 of file dlg_box.cpp.

References itoa(), minmalq, and strrstring.

void viewtext2 ( int  id)

displays a dialogbog with the given message

See Also
help(int)

Definition at line 3296 of file dlg_box.cpp.

References readtextmessage(), and ASC_PG_Dialog::RunModal().

Referenced by NextTurnStrategy_AskUser::continueWhenLastPlayer(), and gamethread().

int viewtextquery ( int  id,
const char *  title,
const char *  s1,
const char *  s2 
)

Variable Documentation

int actdisplayedmessage

Definition at line 97 of file dlg_box.cpp.

Referenced by infomessage().

long lastdisplayedmessageticker

Definition at line 98 of file dlg_box.cpp.

Referenced by infomessage().

tvirtualscreenbuf virtualscreenbuf

Definition at line 101 of file dlg_box.cpp.

Referenced by gamethread(), main(), and runTester().