|
Nokia N97 SDK Example Applications Guide |
1. About this Example
2. Architecture
3. Design and Implementation
The pop-up field example application helps you to understand the following:
The following UML diagram shows key classes of the pop-up field example application.
In the example application, a pop-up field is displayed using CAknExPopFieldBaseDialog that is an inherited class of CAknForm. By implementing this code, the pop-up field can be handled as though it is a control that is displayed on a dialog.
Example 1: Resource definition of a dialog (inherited from Form class) that uses a pop-up field.
RESOURCE DIALOG r_aknexpopfield_two_text_field_dialog
{
flags = EEikDialogFlagNoDrag | EEikDialogFlagFillAppClientRect |
EEikDialogFlagNoTitleBar | EEikDialogFlagButtonsRight |
EEikDialogFlagCbaButtons | EEikDialogFlagNoBorder;
buttons = R_AVKON_SOFTKEYS_OPTIONS_BACK;
form = r_aknexpopfield_two_text_field_form;
}
Note: Unlike standard dialog definition, the form field is used to define a dialog in this example.
Example 2: Contents resource definition of a dialog (inherited from Form class) that uses a pop-up field.
RESOURCE FORM r_aknexpopfield_two_text_field_form
{
items =
{
DLG_LINE
{
type = EAknCtPopupField;
prompt = qtn_aknexpopfield_label_pop01;
id = EAknExPopFieldDlgCtrlIdPop01;
itemflags = EEikDlgItemTakesEnterKey | EEikDlgItemOfferAllHotKeys;
control = POPUP_FIELD
{
width = AKNEXPOPFIELD_TEXT_WIDTH;
other = qtn_aknexpopfield_list_other;
};
tooltip = qtn_aknexpopfield_hint_text;
},
DLG_LINE
{
type = EAknCtPopupField;
prompt = qtn_aknexpopfield_label_pop02;
id = EAknExPopFieldDlgCtrlIdPop02;
itemflags = EEikDlgItemTakesEnterKey | EEikDlgItemOfferAllHotKeys;
control = POPUP_FIELD
{
width = AKNEXPOPFIELD_TEXT_WIDTH;
other = qtn_aknexpopfield_list_other;
};
tooltip = qtn_aknexpopfield_hint_text;
}
};
}
Note: The control type EAknCtPopupField is used to handle the pop-up field.
The following shows the POPUP_FIELD resource structure:
STRUCT POPUP_FIELD
{
WORD flags=0;
WORD width=0;
LTEXT other="";
LLINK emptynote = 0;
LTEXT empty="";
}
Example 3: Instantiation of a dialog object inherited from Form that uses a pop-up field.
CAknExPopFieldAttribSetDialog* dlg = CAknExPopFieldAttribSetDialog::NewLC(); CleanupStack::Pop(); dlg->ExecuteLD( aResourceId );
In each of these functions, an array for selection items is set as follows:
CAknPopupField * popup; .... popup->SetQueryValueL();
|
© Nokia 2009 |