This page was last modified 12:52, 19 January 2008.
AVKON Common File Dialogs
From Forum Nokia Wiki
Contents |
.MMP
LIBRARY CommonDialogs.lib
.RSS
#include <CommonDialogs.hrh> // Enumerations #include <CommonDialogs.rh> // Resource structures
MEMORYSELECTIONDIALOG resource
It defines a root path and a default folder. "root_path" is the absolute path to be considered as root when browsing, e.g. "C:\Nokia\". "default_folder" is the folder where browsing is started, e.g. "Images\Pictures\". LOCATION structures must be defined for phone memory and memory card. An example memory selection resource could look like this:
RESOURCE MEMORYSELECTIONDIALOG r_memory_selection_dialog { title = "Choose memory:"; softkey_1 = "Accept"; softkey_2 = "Negative"; locations = { LOCATION { root_path = "C:\\Nokia\\"; }, LOCATION { root_path = "E:\\"; default_folder ="Images\\";} }; }
In this example, root path for phone memory is “C:\Nokia\” (remember the trailing backslash) and browsing is started from that directory if phone memory is selected. Root path for memory card is “E:\” and the browsing is started from the default folder, “E:\Images\”. You can leave any of the resource items undefined. In that case, default values are used.
FILESELECTIONDIALOG resource
RESOURCE FILESELECTIONDIALOG r_file_selection_dialog { title = "Select-a-file:"; root_path = "C:\\Nokia\\Images\\"; filters = { FILTER { filter_type = EAttributeFilter; filter_style = EExclusiveFilter; filter_data = { "SH", "R" }; // Excludes system, hidden and read-only attributes } }; }
FILENAMEPROMPTDIALOG resource
RESOURCE FILENAMEPROMPTDIALOG r_filename_prompt_dialog { filename_prompt = "Enter filename:"; default_filename = "Attachment.jpg"; path = “C:\\Nokia\\Images\\”; }
All UI components (CAknFileNamePromptDialog, CAknFileSelectionDialog, CAknMemorySelection and CAknMemorySelectionSettingPage) can be created with NewL and launched with ExecuteL. There are also easier ways to launch dialogs: single function calls (RunDlgLD). Include headers of Common Dialogs that you need in your .CPP file:
#include <AknCommonDialogs.h> // For single function calls #include <CAknMemorySelectionDialog.h> #include <CAknMemorySelectionSettingPage.h> #include <CAknFileSelectionDialog.h> #include <CAknFileNamePromptDialog.h> //Example of launching a dialog: _LIT(KDefaultFileName, "Attachment.jpg"); TFileName defaultFileName(KDefaultFileName); AknCommonDialogs::RunSaveDlgLD(defaultFileName, R_MEMORY_SELECTION_DIALOG); The resource: RESOURCE MEMORYSELECTIONDIALOG r_memory_selection_dialog { locations = { LOCATION { root_path = "C:\\Nokia\\Images\\"; }, LOCATION { root_path = "E:\\"; default_folder = "Images\\"; } }; }
| Related Discussions | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| AVKON 59 panic | heuven | Symbian User Interface | 1 | 2006-11-23 13:15 |
| 怎么不显示菜单 | qiuhuimin | Symbian | 3 | 2004-07-09 11:37 |
| File selection dialog | csavages | Symbian User Interface | 1 | 2004-08-17 04:05 |
| How to add V-icon in AVKON_CONFIRMATION_QUERY dialog? | arachidyl | Symbian User Interface | 1 | 2007-04-29 15:48 |
| CAknQueryDialog icons | miikkis | Symbian User Interface | 3 | 2008-04-29 09:53 |
