dlg_box.cpp File Reference

Some basic classes from which all of ASC's dialogs are derived. More...

#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <ctype.h>
#include <cstring>
#include <iostream>
#include "typen.h"
#include "basegfx.h"
#include "newfont.h"
#include "spfst.h"
#include "loaders.h"
#include "misc.h"
#include "events.h"
#include "stack.h"
#include "dlg_box.h"
#include "paradialog.h"
#include "widgets/textrenderer.h"
#include "spfst-legacy.h"
#include "dlgraph.cpp"

Include dependency graph for dlg_box.cpp:

Go to the source code of this file.

Classes

class  tdisplaymessage
struct  tpicture
class  thelpsystem
class  tviewtextquery
class  ViewTextQuery
class  tgetid
class  ChooseString
class  StringEdit

Defines

#define ppicture   tpicture*

Typedefs

typedef char * tstringa [30]
typedef tstringapstringa

Functions

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

Variables

char strrstring [200]
void * dialogtexture = NULL
int actdisplayedmessage = 0
long int lastdisplayedmessageticker = 0xffffff
tvirtualscreenbuf virtualscreenbuf
const char * emptystring = ""
tdisplaymessagemessagebox
tdisplaymessagemessagebox = NULL


Detailed Description

Some basic classes from which all of ASC's dialogs are derived.

Definition in file dlg_box.cpp.


Define Documentation

#define ppicture   tpicture*

Definition at line 3138 of file dlg_box.cpp.

Referenced by thelpsystem::done().


Typedef Documentation

typedef tstringa* pstringa

Definition at line 1748 of file dlg_box.cpp.

typedef char* tstringa[30]

Definition at line 1747 of file dlg_box.cpp.


Function Documentation

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:
title the title of the dialog box
entries the list of strings
buttons the names of the buttons that are going to be displayed
defaultEntry the entry that is selected by default (-1 if none)
Returns:
button-number, selected index

Definition at line 3805 of file dlg_box.cpp.

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

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:
title the title of the dialog box
entries the list of strings
defaultEntry the entry that is selected by default (-1 if none)
Returns:
the selected index or -1 if nothing was selected

Definition at line 3795 of file dlg_box.cpp.

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

void displaymessage ( const ASCString text,
int  num 
)

displays a dialog box with a message

Parameters:
text the text
num 0 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().

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

displays a dialog box with a message

Parameters:
formatstring the text, which may contain the same format arguments as sprintf
num 0 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.

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

ASCString editString ( const ASCString title,
const ASCString defaultValue 
)

Definition at line 3901 of file dlg_box.cpp.

References tdialogbox::done(), StringEdit::init(), StringEdit::nt, StringEdit::onCancel, StringEdit::org, StringEdit::ReturnOriginal, StringEdit::run(), and StringEdit::text.

Referenced by FileTransfer::enterfilename(), and getbipath().

int getid ( const char *  title,
int  lval,
int  min,
int  max 
)

Definition at line 3708 of file dlg_box.cpp.

References tdialogbox::done(), tgetid::init(), tgetid::max, tgetid::mid, tgetid::min, tgetid::nt, tgetid::onCancel, tgetid::ReturnOriginal, and tgetid::run().

Referenced by UnitPropertyEditor::buttonpressed(), editInt(), execaction(), ChangeBuildingOwner::setup(), DisplayEllipse::setup(), and ChangeGameParameter::setup().

char getletter ( const char *  s  ) 

Definition at line 123 of file dlg_box.cpp.

Referenced by tdlgengine::addbutton().

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 3292 of file dlg_box.cpp.

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

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

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

Definition at line 3359 of file dlg_box.cpp.

References thelpsystem::action, thelpsystem::done(), tviewtextquery::init(), and thelpsystem::run().

Referenced by viewtextquery().

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 3054 of file dlg_box.cpp.

References actmap, displayLogMessage(), tfindfile::getnextname(), GameMap::PreferredFilenames::mapname, GameMap::preferredFileNames, tnstream::reading, tnstream::readTextString(), s1, 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 repaintdisplay ( void   ) 

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 3302 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 
)

Definition at line 3400 of file dlg_box.cpp.

References legacy_viewtextquery(), legacyEventSystemActive(), and ASC_PG_Dialog::RunModal().

Referenced by authenticateUser(), and changePassword().


Variable Documentation

int actdisplayedmessage = 0

Definition at line 97 of file dlg_box.cpp.

Referenced by infomessage().

void* dialogtexture = NULL

Definition at line 95 of file dlg_box.cpp.

Referenced by tdialogbox::paintsurface2().

const char* emptystring = ""

Definition at line 469 of file dlg_box.cpp.

Referenced by tdlgengine::addbutton().

long int lastdisplayedmessageticker = 0xffffff

Definition at line 98 of file dlg_box.cpp.

Referenced by infomessage().

tdisplaymessage* messagebox = NULL

Definition at line 3415 of file dlg_box.cpp.

Referenced by displaymessage(), and removemessage().

tdisplaymessage* messagebox

Definition at line 3415 of file dlg_box.cpp.

Referenced by displaymessage(), and removemessage().

char strrstring[200]

Definition at line 55 of file dlg_box.cpp.

Referenced by strrrd8d(), strrrd8n(), and strrrd8u().

tvirtualscreenbuf virtualscreenbuf

Definition at line 101 of file dlg_box.cpp.

Referenced by gamethread(), main(), runTester(), and tdialogbox::setvirtualframebuf().


Generated on Mon May 21 01:33:50 2012 for Advanced Strategic Command by  doxygen 1.5.1