×
Namespaces

Variants
Actions

Folder selection dialog

From Nokia Developer Wiki
Jump to: navigation, search
Article Metadata
Article
Created: Igor Pchelko (12 Nov 2007)
Last edited: hamishwillee (30 May 2013)

Here is an example on how to implement a Select folder dialog for Symbian 3rd edition, with common dialog classes.

Header Required:

#include <caknmemoryselectiondialog.h>

Library needed:

LIBRARY commondialogs.lib

Source code

 
TFileName folder;
 
// Create select memory dialog
CAknMemorySelectionDialog* memDlg =
CAknMemorySelectionDialog::NewL(ECFDDialogTypeCopy, ETrue);
CAknMemorySelectionDialog::TMemory memory =
CAknMemorySelectionDialog::EPhoneMemory;
 
// Create select folder dialog
CAknFileSelectionDialog* dlg =
CAknFileSelectionDialog::NewL(ECFDDialogTypeCopy);
 
// some dialog customizations:
dlg->SetTitleL(_L("Select folder"));
dlg->SetRightSoftkeyRootFolderL(_L("Back")); // for root folder
 
TBool result = EFalse;
 
for (;;)
{
if ( memDlg->ExecuteL(memory) == CAknFileSelectionDialog::ERightSoftkey )
{
// cancel selection
break;
}
 
if (memory==CAknMemorySelectionDialog::EMemoryCard)
{
folder = PathInfo::MemoryCardRootPath();
}
else
{
folder = PathInfo::PhoneMemoryRootPath();
}
 
if (dlg->ExecuteL(folder))
{
// we got our folder and finish loop
result = ETrue;
break;
}
 
}
 
delete memDlg;
delete dlg;
This page was last modified on 30 May 2013, at 07:37.
42 page views in the last 30 days.