You Are Here:

Community: Wiki

This page was last modified on 4 September 2009, at 13:30.

AVKON Common File Dialogs

From Forum Nokia Wiki

Reviewer Approved   


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 Wiki Articles

No related wiki articles found

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia 
RDF Facets: qdcZidentifierQSxhttpE3aE2fE2fwikiE2eforumE2enokiaE2ecomE2findeE78E2ephpE2fJavaE5fVerifiedE5fE28PortuguE25C3E25AAsE29X qdcZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qdcZtypeQUqfntypeZCommunityContentQ qdcZtypeQUqfntypeZE52esourceQ qdcZtypeQUqfntypeZWebpageQ qdcZtypeQUqfntypeZWikiContentQ qdcZtypeQUqmarsZManagedE52esourceQ qdcZtypeQUqwebZInformationE52esourceQ qdcZtypeQUqwebZPageQ qdcZtypeQUqwebZE52esourceQ qdcZtypeQUqrdfsZE52esourceQ qfnZtypeQUqfntypeZCommunityContentQ qfnZtypeQUqfntypeZE52esourceQ qfnZtypeQUqfntypeZWebpageQ qfnZtypeQUqfntypeZWikiContentQ qmarsZlanguageQUxhttpE3aE2fE2fswE2enokiaE2ecomE2flanguageE2d1E2fenX qrdfZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qrdfZtypeQUqfntypeZCommunityContentQ qrdfZtypeQUqfntypeZE52esourceQ qrdfZtypeQUqfntypeZWebpageQ qrdfZtypeQUqfntypeZWikiContentQ qrdfZtypeQUqmarsZManagedE52esourceQ qrdfZtypeQUqwebZInformationE52esourceQ qrdfZtypeQUqwebZPageQ qrdfZtypeQUqwebZE52esourceQ qrdfZtypeQUqrdfsZE52esourceQ