×
Namespaces

Variants
Actions

Using the PIN query dialog on S60 5th Edition touch devices

From Nokia Developer Wiki
Jump to: navigation, search
Article Metadata
Tested with
Devices(s): Tested on Nokia 5800 XpressMusic
Compatibility
Platform(s): S60 5th Edition
S60 5th Edition
Article
Keywords: EPinLayout, CAknQueryDialog
Created: User:Symbian expert 0 (18 Sep 2009)
Last edited: hamishwillee (01 Aug 2012)

Description

A dialog similar to the PIN query can be implemented with the CAknQuery class and a layout of type EPinLayout for the dialog resource.

Solution

The following code sample demonstrates how to define dialog resources with the PIN query layout:

.rss file

  #define KMaxPasswordLength 10
 
// EMultiData Layout can be used for password confirmation query
 
RESOURCE DIALOG r_dialog_password_and_confirmation_query
{
flags = EGeneralQueryFlags;
 
buttons = R_AVKON_SOFTKEYS_OK_CANCEL;
items =
{
DLG_LINE
{
type = EAknCtMultilineQuery;
id = EMultilineFirstLine;
control = AVKON_DATA_QUERY
{
layout = EMultiDataFirstSecEd;
label = "Enter Password:";
control = SECRETED
{
num_letters = KMaxPasswordLength;
};
};
},
DLG_LINE
{
type = EAknCtMultilineQuery;
id = EMultilineSecondLine;
control = AVKON_DATA_QUERY
{
layout = EMultiDataSecondSecEd;
label = "Confirm Password:";
control = SECRETED
{
num_letters = KMaxPasswordLength;
};
};
}
};
}
 
// EPinLayout or ECodeLayout can be used for lock screen similar
// to device lock screen in S60 5th Edition touch devices.
 
RESOURCE DIALOG r_dialog_password_query
{
flags = EAknGeneralQueryFlags | EGeneralQueryFlags
| EEikDialogFlagVirtualInput | EEikDialogFlagNotifyEsc;
buttons = R_AVKON_SOFTKEYS_OK_CANCEL;
items =
{
DLG_LINE
{
type = EAknCtQuery;
id = EGeneralQuery;
control = AVKON_DATA_QUERY
{
layout = EPinLayout;
label = "Enter Password:";
control = SECRETED
{
num_letters = KMaxPasswordLength;
};
};
}
};
}

Constructing and displaying the dialog

  TBuf<KMaxPasswordLength> password;		    
CAknQueryDialog* dlg = new (ELeave)
CAknQueryDialog( password, CAknQueryDialog::ENoTone );
dlg->ExecuteLD( R_DIALOG_PASSWORD_QUERY );

This page was last modified on 1 August 2012, at 07:41.
30 page views in the last 30 days.
×