Pooka SDK API Reference
ConsoleApplication Class Reference

#include <ConsoleApplication.h>

+ Inheritance diagram for ConsoleApplication:
+ Collaboration diagram for ConsoleApplication:

Detailed Description

The base class used to create text oriented, console-like Pooka SDK® applications.

ConsoleApplication class is the base class for developers to create text oriented, console-like Pooka SDK® applications. Although not really a native console, an application based on ConsoleApplication class behaves just like a native console application, providing functions such as text printing, text input and simple graphics drawing by ASCII characters.

Remarks  Console Application's "main()" Function

The function consoleMain() is the most important function works as both entry point and terminal of the application, just like its counterpart - the int main (int argc, char *argv[]) in a native console application. Developers should put the application logic inside the consoleMain() function. Once the application control reaches the end of consoleMain(), the application is about to terminate. Alternatively, user can press "Ctrl" + "C" at any time to quit the consoel application.

void XmlTest::consoleMain()
{
// Pooka SDK console application started
// Application logic goes here ...
// Once reaches the end of consoleMain(), console application is about to terminate
}

 Note  Keep in mind that class ConsoleApplication derives from class OGApplication, therefore it actually inherit all functions and properties from OGApplication. However, ConsoleApplication is intended to be a cross-platform simulation of console application, it is highly recommended that developers should use ConsoleApplication class for the purpose of creating a console-like application.

Remarks  Stream Mode vs. Characters Mode
A Pooka SDK® console application has two different display modes, stream mode and character mode. These two modes can be switched from one to the other by function setConsoleMode(). The stream mode is the default mode.

Stream Mode Stream mode displays text like stream, text strings are printed from left to right; new text strings are always appended at the current end of the text. If end of text goes beyond the right boundary, then text line may be broken and wrapped into a new line (depends on the text-wrapping argument in constructor). If end of text goes beyond the bottom boundary, then application scrolls the text content up to have a new empty line space.

Character Mode Character mode print characters, text string, or simple character-based graphics at any position. It uses the application display area like a extreme-low-resolution raster display, with each pixel represented by a character.
Character mode can be very useful if the Pooka SDK® console application want to display very simple graph by characters.

Public Types

enum  CONSOLE_MODE { CONSOLE_STREAM_MODE = 0, CONSOLE_CHAR_MODE = 1 }
 
- Public Types inherited from Application
enum  GRAPHICS_TYPE {
  GRAPHICS_INVALID = -1, GRAPHICS_MINIAWT = 0, GRAPHICS_OMNIG = 1, GRAPHICS_OPENGL = 2,
  GRAPHICS_DIRECTX = 3, GRAPHICS_AUTO = 0x0F
}
 
enum  DESKTOP_APP_MENU_TYPE { APP_MENU_NONE = 0, APP_MENU_DEFAULT = 1, APP_MENU_CUSTOM = 2 }
 

Public Member Functions

 ConsoleApplication (wchar_t *appName, int graphicsEngineType, unsigned int textColor=MiniAWT::Graphics::Color::_POOKA_GREEN, bool wrappingText=true)
 
virtual ~ConsoleApplication ()
 
virtual void consoleMain ()
 
void setConsoleMode (int mode)
 
int getConsoleMode ()
 
void textPrint (wchar_t *message)
 
void textPrintf (wchar_t *format,...)
 
wchar_t getChar (wchar_t *message, wchar_t preSetVal=0)
 
wchar_t * getString (wchar_t *message, wchar_t *preSetVal=0, int inputCharacterLimit=-1)
 
void pause (wchar_t *message=0)
 
void setTabSize (int charNum)
 
void setPixelByChar (int x, int y, wchar_t asciiChar)
 
wchar_t getCharAtPixel (int x, int y)
 
void drawLineByChar (int x1, int y1, int x2, int y2, wchar_t asciiChar, int lineThickness=1)
 
void drawRectByChar (int x, int y, int width, int height, wchar_t asciiChar, int lineThickness=1)
 
void fillRectByChar (int x, int y, int width, int height, wchar_t asciiChar)
 
void drawEllipseByChar (int x, int y, int width, int height, wchar_t asciiChar, int lineThickness=1)
 
void fillEllipseByChar (int x, int y, int width, int height, wchar_t asciiChar)
 
void drawPolylineByChar (MiniSTL::Type::OGPoint *points, int number, wchar_t asciiChar, int lineThickness=1, bool closePolyline=true)
 
void fillPolylineByChar (MiniSTL::Type::OGPoint *points, int number, wchar_t asciiChar)
 
void drawBoxByChar (int x, int y, int width, int height, wchar_t horizontalLineChar, wchar_t verticalLineChar, wchar_t cornerChar)
 
void drawText (int x, int y, wchar_t *format,...)
 
void commit ()
 
void flush ()
 
int getCharModeWidth ()
 
int getCharModeHeight ()
 
void setTextSize (int textSize)
 
int getTextSize ()
 
void setTextFont (MiniAWT::Graphics::BitmapFont *font)
 
MiniAWT::Graphics::BitmapFontgetTextFont ()
 
void clear ()
 
GUI::OGCanvasgetCanvas ()
 
G2D::SceneSpritegetScene ()
 
GUI::Component::LWConsolegetConsoleComponent ()
 
int hasKeyClicked ()
 
bool isMouseClicked ()
 
- Public Member Functions inherited from OGApplication
 OGApplication (wchar_t *appName, int graphicsEngineType)
 
virtual ~OGApplication ()
 
int getBestGraphicsEngineType ()
 
- Public Member Functions inherited from Application
virtual void onCreate ()
 
virtual void onPaused ()
 
virtual void onResumed ()
 
virtual void onTerminate ()
 
virtual bool onTerminationRequested ()
 
virtual bool onBackButtonPressed ()
 
virtual void onFileDropped (wchar_t **fileName, int fileNum, int x, int y)
 
virtual int onPrepareAppMenu (MiniSTL::DataStructure::Tree *menuTree)
 
virtual void onAppMenuClicked (wchar_t *menuItemText)
 
- Public Member Functions inherited from Object
 Object ()
 
virtual ~Object ()
 
void addRef ()
 
void release ()
 
virtual wchar_t * toString ()
 
wchar_t * getClassName (bool keepNameSpace=false)
 
void syncBegin ()
 
void syncEnd ()
 
void wait (unsigned int timeout=0xFFFFFFFF)
 
void notify ()
 
void notifyAll ()
 

Protected Member Functions

void defaultPreCreationProc ()
 
void defaultPostCreationProc ()
 
- Protected Member Functions inherited from OGApplication
virtual void defaultPreTerminationProc ()
 
virtual void defaultPostTerminationProc ()
 
- Protected Member Functions inherited from Application
 Application (wchar_t *appName)
 
virtual ~Application ()
 
virtual void defaultActivationProc (bool active)
 
virtual void defaultHibernationProc (bool isEntering)
 

Additional Inherited Members

- Static Public Member Functions inherited from OGApplication
static void setInAppConsoleEnabled (bool enabled, int textSize=MiniAWT::Application::DEFAULT_FONT_SIZE, int textColor=MiniAWT::Graphics::Color::GREEN)
 
static void setAppTheme (G2D::SpriteTheme *spriteTheme)
 
static G2D::SpriteThemegetAppTheme ()
 
static void showToast (wchar_t *message, int textSize, int yPosition, int duration=2000, int textColor=MiniAWT::Graphics::Color::WHITE, int bkgColor=MiniAWT::Graphics::Color::DARKGRAY)
 
- Static Public Member Functions inherited from Application
static Application::ScheduledTaskpostTask (Window *ownerWindow, Schedulable *schedulable, wchar_t *taskContext, void *taskParameter, bool runOnce=true, int interIterationDelay=0, int firstIterationDelay=0, bool executeContextTasksInSequence=false)
 
static bool isPostedTaskAlive (Application::ScheduledTask *task)
 
static void cancelPostedTask (Application::ScheduledTask *task)
 
static void cancelPostedTask (wchar_t *taskContext)
 
static void cancelAllPostedTasks (Window *ownerWindow=0)
 
static Application::ScheduledTaskgetPostedTask (wchar_t *taskContext)
 
static MiniSTL::DataStructure::ArrayListgetPostedTasks ()
 
static void setPowerHungryMode (bool enable)
 
static void setHibernationEnabled (bool enable)
 
static bool isHibernating ()
 
static void enterHibernation ()
 
static void quitHibernation ()
 
static void exit ()
 
static void restart (wchar_t *commandLineArguments=L"")
 
static void update ()
 
static void repaint ()
 
static void setDragAndDropEnabled (bool enabled)
 
static void setFont (bool setMonoFont, Graphics::BitmapFont *bitmapFont)
 
static Graphics::BitmapFontgetFont (bool getMonoFont)
 
static Graphics::BitmapFontgetDefaultFont (bool getMonoFont)
 
static void sleep (int interval)
 
static void throwException (wchar_t *message)
 
static void throwWarning (wchar_t *message)
 
static void printStackTrace ()
 
static wchar_t * getApplicationName ()
 
static wchar_t * getApplicationLocalStorageDir ()
 
static wchar_t * getAssetsPath ()
 
static bool checkAssetExistence (wchar_t *docBase, wchar_t *fileName)
 
static bool checkAssetExistence (wchar_t *fullAssetPath)
 
static wchar_t * getCommandLine ()
 
static wchar_t * getCommandLineArguments ()
 
static void setHardCodedCommandArgument (wchar_t *argument)
 
static void printf (wchar_t *format,...)
 
static void print (wchar_t *lineBuf)
 
static void debugPrintf (wchar_t *format,...)
 
static void debugPrint (wchar_t *lineBuf)
 
static void setConsoleTextColor (unsigned int textCol=Graphics::Color::GRAY, unsigned int textBkg=Graphics::Color::BLACK)
 
static void clearConsole ()
 
static void setLanguageTable (wchar_t *docBase=0, wchar_t *fileName=0)
 
static wchar_t * getTextFromLanguageTable (wchar_t *LTID, wchar_t *defaultValue)
 
static bool isPaused ()
 
static long getCurrentTickCount ()
 
static void clearUserInputEvent ()
 
static void setAppWindowSize (int resolutionType)
 
static void setAppWindowSize (int windowWidth, int windowHeight)
 
static void setAppImmersiveFullScreen (bool immersiveFullScreen)
 
static bool isCurrentThreadMainThread ()
 
static bool isMainThreadUnderSync ()
 
static void syncUIThreadBegin ()
 
static void syncUIThreadEnd ()
 
static bool terminationRequested ()
 
static void setCustomSplashImage (Graphics::Bitmap *bitmap, float splashTime)
 
- Public Attributes inherited from OGApplication
bool enableKeyboardNavigation
 
Monetization::Ads::AdPane::AdPaneListeneradPaneListener
 
- Public Attributes inherited from Application
unsigned int paddingColor
 
bool startupCreateConsole
 
bool startupCreateWindowFrame
 
- Static Public Attributes inherited from Application
static const unsigned int DEFAULT_CONSOLE_TEXT_COLOR = Graphics::Color::GRAY
 
static const unsigned int DEFAULT_CONSOLE_BKG_COLOR = Graphics::Color::BLACK
 
static const int DEFAULT_FONT_SIZE = 14
 
static int graphicsType
 
static bool restartable
 
static bool exitEnabled
 
static bool ableToUpdateImmediately
 
static Applicationinstance
 
static bool allowMultipleInstance
 
static bool isFirstInstance
 
static int width
 
static int height
 
static Contentcontent
 
static int maxIdleTime
 
static float runningTime
 
static bool keepActive
 
static Audio::Speakerspeaker
 
static HibernationListenerhibernationListener
 
static ExceptionListenerexceptionListener
 
static MiniSTL::DataStructure::PropertieslanguageTable
 

Member Enumeration Documentation

§ CONSOLE_MODE

Values that represent console modes. See Stream Mode vs. Characters Mode for more details.

Enumerator
CONSOLE_STREAM_MODE 

An enum constant representing the stream mode. See Stream Mode vs. Characters Mode for more details.

CONSOLE_CHAR_MODE 

An enum constant representing the character mode. See Stream Mode vs. Characters Mode for more details.

Constructor & Destructor Documentation

§ ConsoleApplication()

ConsoleApplication ( wchar_t *  appName,
int  graphicsEngineType,
unsigned int  textColor = MiniAWT::Graphics::Color::_POOKA_GREEN,
bool  wrappingText = true 
)

Constructor.

Parameters
appNameA C string to specify the application name.
Platform For desktop applications, the application name is displayed on application window title bar. Mobile applications do not use this argument, instead, mobile application's name is usually specified by application manifest attribute, refer to platform's developer guide for more details.
graphicsEngineTypeType of the graphics engine, must be one of constants defined in MiniAWT::Application::GRAPHICS_TYPE.
 Tip  Pass in MiniAWT::Application::GRAPHICS_AUTO then Pooka SDK® will choose the best graphics engine for the target platform.
textColorThe console text color.
wrappingTextTrue to wrapping console text when it goes beyond the right boundary.

§ ~ConsoleApplication()

virtual ~ConsoleApplication ( )
virtual

Destructor.

Member Function Documentation

§ consoleMain()

virtual void consoleMain ( )
inlinevirtual

Pooka SDK® console application's main function.

This is the only function where developers put the application logic. See Console Application's "main()" Function for more details.

§ setConsoleMode()

void setConsoleMode ( int  mode)

Sets console application's display mode.

Parameters
modeThe display mode, must be one of constants defined in CONSOLE_MODE.
See Stream Mode vs. Characters Mode for more details.

§ getConsoleMode()

int getConsoleMode ( )

Gets console application's display mode.

Returns
The display mode, must be one of constants defined in CONSOLE_MODE.
See Stream Mode vs. Characters Mode for more details.

§ textPrint()

void textPrint ( wchar_t *  message)

Prints a text string.

 Note  This function is only effective under the stream mode .

Parameters
messageThe text string, specified by a C string.

§ textPrintf()

void textPrintf ( wchar_t *  format,
  ... 
)

Prints a formatted text string.

The formatted string is populated by a format string and a sequence of additional parameters, each containing a value to be used to replace a format specifier in the format string.

 Note  This function is only effective under the stream mode .

Parameters
formatThe format string with format specifier compatible with the printf()/sprintf() functions in C Standard Library.
...Variable parameters providing additional parameters, providing values to replace format specifiers in the format string.

§ getChar()

wchar_t getChar ( wchar_t *  message,
wchar_t  preSetVal = 0 
)

Gets a character from user input.

This function shows a blinking cursor and wait until user input a single character. It behaves just like getchar() function in C Standard Library.

 Note  This function is only effective under the stream mode .

Parameters
messageA text message prompted to the application user about what to input.
preSetValThe default character if user simply hit ENTER key to complete the input.
Returns
The character input by application user.

§ getString()

wchar_t* getString ( wchar_t *  message,
wchar_t *  preSetVal = 0,
int  inputCharacterLimit = -1 
)

Gets a text string from user input.

This function shows a blinking cursor and wait until user input a text single and confirm by hitting ENTER. It behaves just like * gets() function in C Standard Library.

Parameters
messageA text message prompted to the application user about what to input.
preSetValThe default text string if user simply hit ENTER key to complete the input.
inputCharacterLimitThe total number of characters that user can input.

 Note  This function is only effective under the stream mode .

Returns
The text string input by application user.

§ pause()

void pause ( wchar_t *  message = 0)

Display a text message and pauses the application's execution until user hit any key in keyboard or touch the screen.

 Note  This function is only effective under the stream mode .

Parameters
messageA text message prompted to the application user before pause the application

§ setTabSize()

void setTabSize ( int  charNum)

Sets tab size.

The tab size indicates how many space characters a single tab is equal to. The default value is 8.

 Note  This function is only effective under the stream mode .

Parameters
charNumThe tab size, measured by the number of space characters.

§ setPixelByChar()

void setPixelByChar ( int  x,
int  y,
wchar_t  asciiChar 
)

Sets a pixel by a character.

 Note  This function is only effective under the character mode .

Caution For efficiency purpose, all drawing functions are buffered in a command buffer after executed, the drawing result will not be output to the application console until the function commit() or flush() is called.

Parameters
xThe x coordinate of the pixel.
yThe y coordinate of the pixel.
asciiCharThe ASCII character used to set the pixel.

§ getCharAtPixel()

wchar_t getCharAtPixel ( int  x,
int  y 
)

Gets the ASCII character at position of the specified pixel.

 Note  This function is only effective under the character mode .

Caution For efficiency purpose, all drawing functions are buffered in a command buffer after executed, the drawing result will not be output to the application console until the function commit() or flush() is called.

Parameters
xThe x coordinate of the pixel.
yThe y coordinate of the pixel.
Returns
The ASCII character at position of the specified pixel.

§ drawLineByChar()

void drawLineByChar ( int  x1,
int  y1,
int  x2,
int  y2,
wchar_t  asciiChar,
int  lineThickness = 1 
)

Draws a line by character.

 Note  This function is only effective under the character mode .

Caution For efficiency purpose, all drawing functions are buffered in a command buffer after executed, the drawing result will not be output to the application console until the function commit() or flush() is called.

Parameters
x1The x coordinate of the first pixel.
y1The y coordinate of the first pixel.
x2The x coordinate of the second pixel.
y2The y coordinate of the second pixel.
asciiCharThe ASCII character used to draw
lineThicknessThe line thickness.

§ drawRectByChar()

void drawRectByChar ( int  x,
int  y,
int  width,
int  height,
wchar_t  asciiChar,
int  lineThickness = 1 
)

Draws a rectangle by character.

 Note  This function is only effective under the character mode .

Caution For efficiency purpose, all drawing functions are buffered in a command buffer after executed, the drawing result will not be output to the application console until the function commit() or flush() is called.

Parameters
xThe x coordinate of the rectangle.
yThe y coordinate of the rectangle.
widthThe width of the rectangle.
heightThe height of the rectangle.
asciiCharThe ASCII character used to draw
lineThicknessThe line thickness.

§ fillRectByChar()

void fillRectByChar ( int  x,
int  y,
int  width,
int  height,
wchar_t  asciiChar 
)

Fills a rectangle by character.

 Note  This function is only effective under the character mode .

Caution For efficiency purpose, all drawing functions are buffered in a command buffer after executed, the drawing result will not be output to the application console until the function commit() or flush() is called.

Parameters
xThe x coordinate of the rectangle.
yThe y coordinate of the rectangle.
widthThe width of the rectangle.
heightThe height of the rectangle.
asciiCharThe ASCII character used to fill.

§ drawEllipseByChar()

void drawEllipseByChar ( int  x,
int  y,
int  width,
int  height,
wchar_t  asciiChar,
int  lineThickness = 1 
)

Draws an ellipse by character.

 Note  This function is only effective under the character mode .

Caution For efficiency purpose, all drawing functions are buffered in a command buffer after executed, the drawing result will not be output to the application console until the function commit() or flush() is called.

Parameters
xThe x coordinate of the ellipse.
yThe y coordinate of the ellipse.
widthThe width of the ellipse.
heightThe height of the ellipse.
asciiCharThe ASCII character used to draw
lineThicknessThe line thickness.

§ fillEllipseByChar()

void fillEllipseByChar ( int  x,
int  y,
int  width,
int  height,
wchar_t  asciiChar 
)

Fills a ellipse by character.

 Note  This function is only effective under the character mode .

Caution For efficiency purpose, all drawing functions are buffered in a command buffer after executed, the drawing result will not be output to the application console until the function commit() or flush() is called.

Parameters
xThe x coordinate of the ellipse.
yThe y coordinate of the ellipse.
widthThe width of the ellipse.
heightThe height of the ellipse.
asciiCharThe ASCII character used to fill.

§ drawPolylineByChar()

void drawPolylineByChar ( MiniSTL::Type::OGPoint points,
int  number,
wchar_t  asciiChar,
int  lineThickness = 1,
bool  closePolyline = true 
)

Draws a poly-line by character.

 Note  This function is only effective under the character mode .

Caution For efficiency purpose, all drawing functions are buffered in a command buffer after executed, the drawing result will not be output to the application console until the function commit() or flush() is called.

Parameters
pointsThe array of points that compose the poly-line.
numberThe number of points
asciiCharThe ASCII character used to draw.
lineThicknessThe line thickness.
closePolylineTrue indicates to close poly-line to make it a polygon.

§ fillPolylineByChar()

void fillPolylineByChar ( MiniSTL::Type::OGPoint points,
int  number,
wchar_t  asciiChar 
)

Fills poly-line (treat it as a polygon) by character.

 Note  This function is only effective under the character mode .

Caution For efficiency purpose, all drawing functions are buffered in a command buffer after executed, the drawing result will not be output to the application console until the function commit() or flush() is called.

Parameters
pointsThe array of points that compose the poly-line.
numberThe number of points
asciiCharThe ASCII character used to fill.

§ drawBoxByChar()

void drawBoxByChar ( int  x,
int  y,
int  width,
int  height,
wchar_t  horizontalLineChar,
wchar_t  verticalLineChar,
wchar_t  cornerChar 
)

Draw a box by character.

 Note  this function is different from drawRectByChar() because it can specify different characters used for drawing horizontal line, vertical line and box's corner.

 Note  This function is only effective under the character mode .

Caution For efficiency purpose, all drawing functions are buffered in a command buffer after executed, the drawing result will not be output to the application console until the function commit() or flush() is called.

Parameters
xThe x coordinate of the rectangle.
yThe y coordinate of the rectangle.
widthThe width of the rectangle.
heightThe height of the rectangle.
horizontalLineCharThe ASCII character used to draw box's horizontal lines.
verticalLineCharThe ASCII character used to draw box's vertical lines.
cornerCharThe ASCII character used to draw box's corners.

§ drawText()

void drawText ( int  x,
int  y,
wchar_t *  format,
  ... 
)

Draw a text string.

 Note  This function is only effective under the character mode .

Caution For efficiency purpose, all drawing functions are buffered in a command buffer after executed, the drawing result will not be output to the application console until the function commit() or flush() is called.

Parameters
xThe x coordinate of the text string's first character.
yThe y coordinate of the text string's first character.
formatThe format string with format specifier compatible with the printf()/sprintf() functions in C Standard Library.
...Variable parameters providing additional parameters, providing values to replace format specifiers in the format string.

§ commit()

void commit ( )

Commits all drawing commands in commands buffer and output their result to the application console.

 Note  This function is only effective under the character mode .

See also
flush

§ flush()

void flush ( )

Commits all drawing commands in commands buffer and output their result to the application console, then clean up the command buffers.

 Note  The flush() function also clean up the command buffer after commit all drawing commands, as the result, the following drawing functions called after flush() start drawing in an empty console.

 Note  This function is only effective under the character mode .

See also
commit

§ getCharModeWidth()

int getCharModeWidth ( )

Gets the X-resolution (the column number) of the character mode.

Returns
The X-resolution of the character mode.

§ getCharModeHeight()

int getCharModeHeight ( )

Gets the Y-resolution (the row number) of the character mode.

Returns
The Y-resolution of the character mode.

§ setTextSize()

void setTextSize ( int  textSize)

Sets console application's text size.

 Note  This function should be called inside function consoleMain() to take effect.

Parameters
textSizeThe desired size of the text in pixels.

§ getTextSize()

int getTextSize ( )

Gets console application's text size.

Returns
The text size in pixels.

§ setTextFont()

void setTextFont ( MiniAWT::Graphics::BitmapFont font)

Sets the font of this console application.

 Note  This function should be called inside function consoleMain() to take effect.

Parameters
fontThe desired font used by this console application.

§ getTextFont()

Gets the current font of this console application.

Returns
The current font of this console application.

§ clear()

void clear ( )

Clears the whole console of this console application.

§ getCanvas()

GUI::OGCanvas* getCanvas ( )

Gets the GUI::OGCanvas that actually hosts the console.

Returns
The GUI::OGCanvas that actually hosts the console.

§ getScene()

G2D::SceneSprite* getScene ( )

Gets the G2D::SceneSprite that actually hosts the console.

Returns
The G2D::SceneSprite that actually hosts the console.

§ getConsoleComponent()

GUI::Component::LWConsole* getConsoleComponent ( )

Gets the GUI::Component::LWComponent that actually hosts the console.

Returns
The GUI::Component::LWComponent that actually hosts the console.

§ hasKeyClicked()

int hasKeyClicked ( )

Checks whether the application user clicks any key except ENTER key on keyboard. If true, then returns the virtual key code of the key just clicked.

 Tip  This function provides a simple way to allow application user to interact with the console application. For example, application can interrupt a ongoing task if detect a key is clicked.

while(!Application::terminationRequested())
{
if(this->hasKeyClicked()!=0)
break;
else
{
... //The task ...
}
}

 Note  This function excludes ENTER key since it is used to complete user input and may cause confusion.

Returns
The virtual key code of the key just clicked.
See also
isMouseClicked

§ isMouseClicked()

bool isMouseClicked ( )

Checks whether the application user clicks the pointing device (mouse, touch-screen, track-pad, etc.).

 Tip  This function provides a simple way to allow application user to interact with the console application. For example, application can interrupt a ongoing task if detect pointing device is clicked.

while(!Application::terminationRequested())
{
if(this->isMouseClicked())
break;
else
{
... //The task ...
}
}
Returns
True if application user clicks the pointing device (mouse, touch-screen, track-pad, etc.).
See also
hasKeyClicked

§ defaultPreCreationProc()

void defaultPreCreationProc ( )
protectedvirtual

The overridden function of MiniAWT::Application::defaultPreCreationProc() defined in class MiniAWT::Application.

Caution If a sub-class of OGApplication overrides this function, then this function must be called at the beginning of the overridden function.

Reimplemented from OGApplication.

§ defaultPostCreationProc()

void defaultPostCreationProc ( )
protectedvirtual

The overridden function of MiniAWT::Application::defaultPostCreationProc() defined in class MiniAWT::Application.

Caution If a sub-class of OGApplication overrides this function, then this function must be called at the beginning of the overridden function.

Reimplemented from Application.