API published in: S60 1st Ed
Link against: avkon.lib eikctl.lib eikcoctl.lib
Required Capabilities
None
#include <aknselectionlist.h>
Inherits CAknDialog, and MEikListBoxObserver.
Inherited by CAknMarkableListDialog.
Use this class to get a full screen list.
This class only works in whole main pane. Do not try to use this directly for other places.
resource definition for this class:
RESOURCE DIALOG r_res_id_for_a_dialog { flags = EAknDialogSelectionList; buttons = R_AVKON_SOFTKEYS_OPTIONS_BACK; items = { DLG_LINE { type = EAknCtSingleGraphicListBox; id = ESelectionListControl; control = LISTBOX { flags = EAknListBoxSelectionList; }; } // the next dlg line is optional. , DLG_LINE { itemflags = EEikDlgItemNonFocusing; id = EFindControl; type = EAknCtSelectionListFixedFind; } }; }
EAknCtSingleListBox (See CAknSingleStyleListBox) EAknCtSingleNumberListBox (See CAknSingleNumberStyleListBox) EAknCtSingleHeadingListBox (See CAknSingleHeadingStyleListBox) EAknCtSingleGraphicListBox (See CAknSingleGraphicStyleListBox) EAknCtSingleGraphicHeadingListBox (See CAknSingleGraphicHeadingStyleListBox) EAknCtSingleNumberHeadingListBox (See CAknSingleNumberHeadingStyleListBox) EAknCtSingleLargeListBox (See CAknSingleLargeStyleListBox) EAknCtDoubleListBox (See CAknDoubleStyleListBox) EAknCtDoubleNumberListBox (See CAknDoubleNumberStyleListBox) EAknCtDoubleTimeListBox (See CAknDoubleTimeStyleListBox) EAknCtDoubleLargeListBox (See CAknDoubleLargeStyleListBox) EAknCtDoubleGraphicListBox (See CAknDoubleGraphicStyleListBox)
EAknCtSelectionListFixedFind EAknCtSelectionListPopupFind
The menubar you give for selection list dialog should have one of the following as one of its menu panes (defined in avkon.hrh):
R_AVKON_MENUPANE_SELECTION_LIST R_AVKON_MENUPANE_SELECTION_LIST_WITH_FIND_POPUP
RESOURCE MENU_BAR r_res_id_for_a_menubar { titles = { MENU_TITLE { menu_pane = R_AVKON_MENUPANE_SELECTION_LIST; } }; };
TInt openedItem = 0; MDesCArray *array = ...; CAknSelectionListDialog *dialog = CAknSelectionListDialog::NewL(openedItem, array, R_RES_ID_FOR_A_MENUBAR); TInt result = dialog->ExecuteLD(R_RES_ID_FOR_A_DIALOG); if (result) { ...use openeditem here... } else { ...canceled... }
TInt openedItem = 0; MDesCArray *array = ...; CAknSelectionListDialog *dialog = CAknSelectionListDialog::NewL(openedItem, array, R_RES_ID_FOR_A_MENUBAR); dialog->PrepareLC(R_RES_ID_FOR_A_DIALOG); // do some operations here, for example fill icon array TInt result = dialog->RunLD(); if (result) { ... } else { ... }
Often it is also useful to derive from CAknSelectionListDialog and implement OkToExitL(), constructors and the NewL() methods. OkToExitL() implementation helps with providing navigation with other dialogs; OkToExitL() is ideal place to launch new dialogs when a list item is selected. This way when backstepping, the state of the first dialog is preserved...
Public Types |
|
enum | TFindType { ENoFind, EFixedFind, EPopupFind } |
CAknSelectionListDialog::TFindType Determines what kind of findbox should be used. More... |
|
Public Member Functions |
|
IMPORT_C void | ConstructL (TInt aMenuTitleResourceId) |
ConstructL() Second phase constructor. |
|
IMPORT_C void | SetupFind (TFindType aType) |
SetupFind(). |
|
IMPORT_C CArrayPtr< CGulIcon > * | IconArray () const |
IconArray(). |
|
IMPORT_C void | SetIconArrayL (CArrayPtr< CGulIcon > *aIcons) |
SetIconArrayL(). |
|
IMPORT_C void | HandlePointerEventL (const TPointerEvent &aPointerEvent) |
From CCoeControl. |
|
Static Public Member Functions |
|
static IMPORT_C CAknSelectionListDialog * | NewL (TInt &aOpenedItem, MDesCArray *aArray, TInt aMenuBarResourceId, MEikCommandObserver *aCommand=0) |
CAknSelectionListDialog::NewL(). |
|
static IMPORT_C CAknSelectionListDialog * | NewLC (TInt &aOpenedItem, MDesCArray *aArray, TInt aMenuBarResourceId, MEikCommandObserver *aCommand=0) |
CAknSelectionListDialog::NewLC(). |
|
Protected Member Functions |
|
IMPORT_C | CAknSelectionListDialog (TInt &aIndex, MDesCArray *aArray, MEikCommandObserver *aCommand) |
CAknSelectionListDialog() Default constructor. |
|
IMPORT_C | ~CAknSelectionListDialog () |
~CAknSelectionListDialog() Destructor. |
|
virtual IMPORT_C void | SelectionListProcessCommandL (TInt aCommand) |
SelectionListProcessCommandL() handles selection list and markable list default commands. |
|
virtual IMPORT_C TBool | IsAcceptableListBoxType (TInt aControlType, TBool &aIsFormattedCellList) const |
IsAcceptableListBoxType(): Detection of list and grid layouts. |
|
IMPORT_C void | ProcessCommandL (TInt aCommandId) |
ProcessCommandL() From CAknDialog. |
|
IMPORT_C void | PreLayoutDynInitL () |
PreLayoutDynInitL() From CAknDialog. |
|
IMPORT_C void | PostLayoutDynInitL () |
PreLayoutDynInitL() From CAknDialog. |
|
IMPORT_C void | SetSizeAndPosition (const TSize &aSize) |
SetSizeAndPosition() From CAknDialog. |
|
IMPORT_C TBool | OkToExitL (TInt aButtonId) |
OkToExitL() From CAknDialog. |
|
IMPORT_C void | HandleListBoxEventL (CEikListBox *aListBox, TListBoxEvent aEventType) |
HandleListBoxEventL() From MEikListBoxObserver Handles listbox events. |
|
IMPORT_C TInt | CountComponentControls () const |
CountComponentControls() From CCoeControl. |
|
IMPORT_C CCoeControl * | ComponentControl (TInt aIndex) const |
ComponentControl() From CCoeControl. |
|
IMPORT_C TKeyResponse | OfferKeyEventL (const TKeyEvent &aKeyEvent, TEventCode aType) |
OfferKeyEventL() From CCoeControl. |
|
IMPORT_C SEikControlInfo | CreateCustomControlL (TInt aControlType) |
CreateCustomControlL() creates own list or grid layouts. |
|
virtual IMPORT_C CEikListBox * | ListBox () const |
ListBox() accessor to listbox control. |
|
IMPORT_C CAknSearchField * | FindBox () const |
FindBox() accessor to findbox control. |
|
IMPORT_C TBool | IsFormattedCellListBox () const |
IsFormattedCellListBox() used to check whether listbox control is a CEikFormattedCellListBox or a CEikColumnListBox. |
|
IMPORT_C void | Draw (const TRect &) const |
Draw() from CCoeControl. |
|
Static Protected Member Functions |
|
static TInt | ExitViaIdle (TAny *aSelectionList) |
ExitViaIdle(). |
|
Protected Attributes |
|
TBool | iEnterKeyPressed |
iEnterKeyPressed Set as ETrue if EAknCmdOpen is handled in ProcessCommandL(). |
|
CAknSelectionListDialog::TFindType Determines what kind of findbox should be used. Note, that a fixed findbox is not available with all list types. |
|
CAknSelectionListDialog() Default constructor. |
|
~CAknSelectionListDialog() Destructor. |
|
ComponentControl() From CCoeControl. Reimplemented from CEikDialog. |
|
ConstructL() Second phase constructor.
Reimplemented from CAknDialog. Reimplemented in CAknMarkableListDialog. |
|
CountComponentControls() From CCoeControl. Reimplemented from CEikDialog. |
|
CreateCustomControlL() creates own list or grid layouts. Normal implementation of this method is: SEikControlInfo CreateCustomControlL(TInt aControlType) { CCoeControl *control = NULL; if ( aControlType == EMyCtGridLayout ) { // CMyOddStyleGrid should be derived from CAknFormattedCellListBox or CEikColumnListBox. control = new(ELeave)CMyOddStyleGrid; } SEikControlInfo info = {control,0,0}; return info; } Reimplemented from CEikDialog. |
|
Draw() from CCoeControl. Reimplemented from CAknDialog. |
|
Callback function to exit dialog after selecting something with tapping it. This prevents dialog to be destroyed before dialog page's handlepointereventl is fully completed.
|
|
FindBox() accessor to findbox control.
|
|
HandleListBoxEventL() From MEikListBoxObserver Handles listbox events.
Reimplemented in CAknMarkableListDialog. |
|
From CCoeControl. Handles pointer events
Reimplemented from CAknDialog. Reimplemented in CAknMarkableListDialog. |
|
Icons, images and thumbnails are in this array. The list items are tab separated strings with fixed format. Some of the numbers in the list item strings are indexes to this array. This array can be modified by MDesCArray::MdcaPoint() method or at construction of dialog; after PrepareLC() call.
|
|
IsAcceptableListBoxType(): Detection of list and grid layouts. The CAknSelectionList only works with certain list and grid layouts. You will get Panic() if you use your own list/grid layouts and you do not have this method implemented! If you add new list layouts, you should implement this method to publish the type of the layout using this method. This is especially the case where you use CAknSelectionGrid with your own grid layout. (as there are no predefined grid layouts, you need to do this every time you use a selection grid) The following aControlTypes are already implemented and requires no action: EAknCtSingleListBox EAknCtSingleNumberListBox EAknCtSingleHeadingListBox EAknCtSingleGraphicListBox EAknCtSingleGraphicHeadingListBox EAknCtSingleNumberHeadingListBox EAknCtSingleLargeListBox EAknCtDoubleListBox EAknCtDoubleNumberListBox EAknCtDoubleTimeListBox EAknCtDoubleLargeListBox EAknCtDoubleGraphicListBox EAknCtSettingListBox EAknCtSettingNumberListBox Any other layout requires you to inherit from CAknSelectionList and implement the following methods: TBool IsAcceptableListBoxType(TInt aControlType, TBool &aIsFormattedCellList) { if (aControlType == EMyCtGridLayout) { // CAknGrid is-a formattedcelllistbox. aIsFormattedCellList = ETrue; return ETrue; } else { return EFalse; } }
|
|
IsFormattedCellListBox() used to check whether listbox control is a CEikFormattedCellListBox or a CEikColumnListBox. If you derive from IsAcceptableListBoxType() you must take care of the aIsFormattedCellListParameter to make this method to work correctly.
|
|
ListBox() accessor to listbox control.
|
|
CAknSelectionListDialog::NewL(). Static factory constructor. Uses two phase construction and leaves nothing on the CleanupStack.
|
|
CAknSelectionListDialog::NewLC(). Static factory constructor. Uses two phase construction and leaves created object in CleanupStack.
|
|
OfferKeyEventL() From CCoeControl. Reimplemented from CAknDialog. Reimplemented in CAknMarkableListDialog. |
|
OkToExitL() From CAknDialog. This is not called if the Cancel button is activated unless the EEikDialogFlagNotifyEsc flag has been set.
Reimplemented from CAknDialog. Reimplemented in CAknMarkableListDialog. |
|
PreLayoutDynInitL() From CAknDialog. Reimplemented from CEikDialog. Reimplemented in CAknMarkableListDialog. |
|
PreLayoutDynInitL() From CAknDialog. Reimplemented from CEikDialog. Reimplemented in CAknMarkableListDialog. |
|
ProcessCommandL() From CAknDialog. Processes commands and passes commands to FindBox and ListBox as needed.
Reimplemented from CAknDialog. Reimplemented in CAknMarkableListDialog. |
|
SelectionListProcessCommandL() handles selection list and markable list default commands. For markable lists, this method handles EAknCmdMark, EAknCmdUnmark, EAknMarkAll, EAknUnmarkAll defined in options menu pane R_AVKON_MENUPANE_MARKABLE_LIST. Reimplemented in CAknMarkableListDialog. |
|
Icons, images and thumbnails are in this array. The list items are tab separated strings with fixed format. Some of the numbers in the list item strings are indexes to this array. This array can be modified by MDesCArray::MdcaPoint() method or at construction of dialog; after PrepareLC() call.
|
|
SetSizeAndPosition() From CAknDialog. Sets dialog's size to whole main pane.
Reimplemented from CEikDialog. |
|
Provides a way to enable and disable find and find popup on runtime. You still need entry with id EFindControl to resource file for the find, this is only for disabling existing find element.
|
|
iEnterKeyPressed Set as ETrue if EAknCmdOpen is handled in ProcessCommandL(). This will eventually cause OkToExitL() to be called with EAknSoftkeyOk as aButtonId. |