Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members

CUIScreen Class Reference

Represents an application screen (window). More...

#include <CUIScreen.h>

Inheritance diagram for CUIScreen:

CUIWidgetGroup MUIWidget List of all members.

Public Types

typedef int EMessageBoxOptions
enum  EEditOptions {
  KDisableNumeric = 0x0001, KOnlyUpperCase = 0x0002, KOnlyLowerCase = 0x0004, KOnlyNumeric = 0x0008,
  KDisableLocale = 0x0010, KDisableSpaces = 0x0020, KAutoLetterCase = 0x0040, KTransparentDraw = 0x0080,
  KTransparentTitle = 0x0200, KDefaultOptions = KAutoLetterCase | KTransparentDraw | KTransparentTitle
}
 Options for editing keyboard. More...

enum  { KMaxEditLen = 20 }
enum  EMessageBoxOption {
  KBlueLabyrinth = 0x01, KGreenLabyrinth = 0x02, KRedLabyrinth = 0x04, KYesButton = 0x08,
  KNoButton = 0x10, KOKButton = 0x20, KCancelButton = 0x40, KContinueButton = 0x80,
  KNoModal = 0x0100
}
 Enumeration options for message boxes. More...


Public Member Functions

 CUIScreen (MColorScheme::EDefaultColorScheme aColorScheme)
 Constructs the CUIScreen object.

virtual void Draw ()
 Draws this widget on the virtual screen.

virtual void RestoreBackground (CUIRect &aRect)
 Redraws the background in given rectangle.

virtual void SetBackground (CDesktop::TColor aColor, MImage *aImage)
 Sets the background color or the background image of this screen.

virtual void SetColorSchemeType (MColorScheme::EDefaultColorScheme aType)
 Sets the default color scheme type for this screen.

virtual int DoModal ()
 Sets this screen temporarily as default for application loop.

virtual void EndModal ()
 Finishes the modaleness of this screen.


Static Public Member Functions

bool EditString (char *aString, unsigned int aMaxLen, EEditOptions aOptions)
 Performs the input of a string.

int MessageBox (const char *aTitle, const char *aText, EMessageBoxOptions aOptions=KOKButton|KBlueLabyrinth, MColorScheme::EDefaultColorScheme aColorScheme=MColorScheme::KSchemeInfo, CDesktop::TColor aTitleColor=0, MImage *aBackground=NULL)
 Shows a massage box screen and returns the value corresponding to the pressed button.


Public Attributes

CDesktop::TColor iBackgroundColor
const MImageiBackgroundImage
int iModalResult
MColorScheme::EDefaultColorScheme iColorScheme

Protected Member Functions

MImageGetImage () const
 Returns the MImage interface pointer of background image this screen should be drawn with.


Detailed Description

Represents an application screen (window).

Screen is a CUIWidgetGroup that receives events from CUIEventLoop

Screen always occupies all available screen

Every screen is associated with an default color scheme that is used to draw its controls

CUIScreen contains a number of static service methods for message box dispaly, editing, etc.


Member Typedef Documentation

typedef int CUIScreen::EMessageBoxOptions
 

Message box options


Member Enumeration Documentation

enum CUIScreen::EEditOptions
 

Options for editing keyboard.

Enumeration values:
KDisableNumeric  Disables numeric keyboard input
KOnlyUpperCase  Allows only upper case characters input
KOnlyLowerCase  Allows only lower case characters input
KOnlyNumeric  Allows only numeric input
KDisableLocale  Disables localization and code page switching. Not implemented yet
KDisableSpaces  Disables the input of spaces
KAutoLetterCase  Tries to automatically guess the case of each character user inputs
KTransparentDraw  Draws the keyboard transparently over the background of current color scheme
KTransparentTitle  Draws the title transparently over the background of current color scheme

enum CUIScreen::EMessageBoxOption
 

Enumeration options for message boxes.

Enumeration values:
KBlueLabyrinth  Shows blue labyrinth as background
KGreenLabyrinth  Shows blue labyrinth as background
KRedLabyrinth  Shows blue labyrinth as background
KYesButton  Shows Yes button
KNoButton  Shows No button
KOKButton  Shows OK button
KCancelButton  Shows Cancel button
KContinueButton  Shows Continue button
Note:
Continue button is shown only alone or in combination with Cancel button
KNoModal  Displays a message and does not wait for user input
Note:
In case of modaleness message, the application has to restore the screen image itself when previous screen has to take the control again by setting the CUIEventLoop::iForceFullRedraw to true

In case of modaleness message, the aColorScheme parameter of CUIScreen::MessageBox() is ignored and the color scheme from current screen is used


Member Function Documentation

virtual int CUIScreen::DoModal  )  [virtual]
 

Sets this screen temporarily as default for application loop.

Returns the value stored in iModalResult prior to EndModal() method call

virtual void CUIScreen::Draw  )  [virtual]
 

Draws this widget on the virtual screen.

The library does not provide any clipping mechanism, so the widget is completely responsible for drawing in its iRectangle. If the widget should be drawn fully or partially transparently over its iParent, it should call iParent->RestoreBackground() for every transparent region

Reimplemented from CUIWidgetGroup.

bool CUIScreen::EditString char *  aString,
unsigned int  aMaxLen,
EEditOptions  aOptions
[static]
 

Performs the input of a string.

Activates the keyboard screen and inputs the given string. Returns true in case of success

Parameters:
aString Pointer to string to edit. It should contain enough space to accumulate aMaxLen + 1 characters
aMaxLen Maximum length of the input string. Can not be larger than KMaxEditLen
aOptions Edit options

virtual void CUIScreen::EndModal  )  [virtual]
 

Finishes the modaleness of this screen.

After the exit, the previous screen is set as active in the application event loop and it is redrawn

int CUIScreen::MessageBox const char *  aTitle,
const char *  aText,
EMessageBoxOptions  aOptions = KOKButton|KBlueLabyrinth,
MColorScheme::EDefaultColorScheme  aColorScheme = MColorScheme::KSchemeInfo,
CDesktop::TColor  aTitleColor = 0,
MImage aBackground = NULL
[static]
 

Shows a massage box screen and returns the value corresponding to the pressed button.

Parameters:
aTitle Title of the message. Can be NULL
aText Body of the message. Can not be NULL
aOptions Options
aColorScheme Color scheme
aTitleColor Color for message title. If 0, active control color from selected color scheme is used
aBackground Image to show in the background
if aBackground is not NULL, it's shown as a background. Otherwise a default background image is shown depending on aOptions. If none of background images constants is specified, the solid background from given color scheme is used Note that the background images that correspond to the same indexes could differ for different skins

Supplied in aBackground parameter custom background image is not deleted automatically when the method finishes

virtual void CUIScreen::RestoreBackground CUIRect aRect  )  [virtual]
 

Redraws the background in given rectangle.

This method is used by transparent children that need to redraw itself. Full screen redraw is very expensive and much oftet it's only needed to redraw a small screen part

Parameters:
aRect CUIRect to redraw

Implements CUIWidgetGroup.

virtual void CUIScreen::SetBackground CDesktop::TColor  aColor,
MImage aImage
[virtual]
 

Sets the background color or the background image of this screen.

Parameters:
aColor New background color. If zero, background color from current color scheme is used
aImage New background image. If NULL, background image from current color scheme is used If previous iBackgroundImage was not NULL, it is deleted automatically
The set iBackgroundImage is not detelted automatically when the screen is destroyed


Member Data Documentation

CDesktop::TColor CUIScreen::iBackgroundColor
 

Background color. If zero, background color from current color scheme is used

const MImage* CUIScreen::iBackgroundImage
 

Background image. If NULL background image from current color scheme is used

MColorScheme::EDefaultColorScheme CUIScreen::iColorScheme
 

Color scheme type of this screen

Reimplemented from MUIWidget.

int CUIScreen::iModalResult
 

Result of modal execution of this screen


The documentation for this class was generated from the following file:
Generated on Fri Jul 15 16:46:44 2005 for TomTom GO User Interface library by doxygen 1.3.5