Input mask class.
More...
#include <ilviews/dataccess/inpmask.h>
Input mask class.
Library: dataccess
This class defines the mask that is used to enter data into an IliEntryField
. The mask is defined by a character string (see specifications syntax). The mask has two modes:
-
Display mode-If a format is not defined, the mask is used to format the data before it is displayed. This is true when the
IliEntryField
does not have the keyboard focus.
-
Edit mode-In this mode, all missing characters are replaced by the placeholder character (by default, the character is underlined). There are some predefined masks for the date and time. However, you can define your own predefined masks in the Masks section of the Application Properties panel in Rogue Wave Views Studio.
- See Also
- IliInputMaskIpl, IliPlaceHolderName
IliInputMask::IliInputMask |
( |
const char * |
definition | ) |
|
Initializes a mask according to one definition.
- Parameters
-
definition | The definition. |
Initializes an instance of IliInputMask
with another mask.
- Parameters
-
static void IliInputMask::AddAlias |
( |
const char * |
aliasName, |
|
|
const char * |
definition |
|
) |
| |
|
static |
Defines a new alias.
- Parameters
-
aliasName | The alias name. |
definition | The alias definition. |
Formats a value.
- Parameters
-
dest | The formatted string. |
src | The value. |
forEdit | If IlTrue , the missing characters are replaced by the character returned by the function GetPlaceHolderChar . |
- Returns
IlTrue
if it is successful.
void IliInputMask::formatForClipboard |
( |
IliString & |
dest, |
|
|
const char * |
src, |
|
|
IlInt |
startPos |
|
) |
| const |
Formats a character string for the clipboard.
All mandatory missing characters are replaced by the default character.
- Parameters
-
dest | The formatted string. |
src | The string. |
startPos | The position of the first character to format (position begins at 0 ). |
static const char* IliInputMask::GetAliasDefinition |
( |
IlInt |
aliasIndex | ) |
|
|
static |
Returns the alias definition.
- Parameters
-
aliasIndex | The alias index. |
- Returns
- The definition for the alias at the
aliasIndex
position.
static const char* IliInputMask::GetAliasDefinition |
( |
const char * |
aliasName | ) |
|
|
static |
Returns the alias definition.
- Parameters
-
- Returns
- The definition of the alias given by the
aliasName
parameter. Returns -1
if no such alias is found.
static IlInt IliInputMask::GetAliasesCount |
( |
| ) |
|
|
static |
Returns the count of the mask aliases.
- Returns
- The count.
static IlInt IliInputMask::GetAliasIndex |
( |
const char * |
aliasName | ) |
|
|
static |
Returns the alias index.
- Parameters
-
- Returns
- The position of the alias given by the
aliasName
parameter. Returns -1
if no such alias is found.
static const char* IliInputMask::GetAliasName |
( |
IlInt |
aliasIndex | ) |
|
|
static |
Returns the name of one alias.
- Parameters
-
aliasIndex | The alias index. |
- Returns
- The name.
Returns a constant reference to the default mask.
- Returns
- The default mask.
const char* IliInputMask::getDefinition |
( |
| ) |
const |
Returns the mask definition.
- Returns
- The definition.
static wchar_t IliInputMask::GetPlaceHolderChar |
( |
| ) |
|
|
static |
Returns the character used to represent the missing character during the edit mode.
- Returns
- The character.
Returns IlTrue
if the mask definition is null.
- Returns
IlTrue
if the mask definition is null.
Copies a mask.
- Parameters
-
msk | The mask which is copied. |
Compares two masks.
- Returns
1
if the masks are equal.
void IliInputMask::read |
( |
IL_STDPREF istream & |
input | ) |
|
Reads the mask from an input stream.
- Parameters
-
static void IliInputMask::RemoveAlias |
( |
IlInt |
aliasIndex | ) |
|
|
static |
Removes an alias.
- Parameters
-
aliasIndex | The alias index. |
static void IliInputMask::SetAliasDefinition |
( |
IlInt |
aliasIndex, |
|
|
const char * |
definition |
|
) |
| |
|
static |
Sets alias definition.
- Parameters
-
aliasIndex | The alias index. |
definition | The alias definition. |
static void IliInputMask::SetAliasName |
( |
IlInt |
aliasIndex, |
|
|
const char * |
name |
|
) |
| |
|
static |
Sets alias name.
- Parameters
-
aliasIndex | The alias index. |
name | The alias name. |
void IliInputMask::setDefinition |
( |
const char * |
definition | ) |
|
Sets the mask definition.
- Parameters
-
definition | The definition. |
static void IliInputMask::SetPlaceHolderValue |
( |
IliPlaceHolderName |
name, |
|
|
wchar_t |
value |
|
) |
| |
|
static |
Changes a place holder which is used to define a mask.
You can use this function to change the value of the placeholders. For example, you decide that the colon is the date separator for the mask definition. But, in this case, you must change the placeholder for time separator because two placeholders can not have the same value, Except, for the placeholders about set of characters. Note: If you change the value for a placeholder, the correct working of the default mask is not guaranteed.
- Parameters
-
name | The placeholder name. |
value | The new value. |
Unformats a character string.
- Parameters
-
dest | The unformatted string. |
src | The string. |
- Returns
IlTrue
if it is successful.
void IliInputMask::write |
( |
IL_STDPREF ostream & |
output | ) |
const |
Writes the mask definition to an output stream in such a way that it may be read back by the read
member function.
- Parameters
-
© Copyright 2012, Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave is a registered trademark of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.