×

Discussion Board

Results 1 to 9 of 9
  1. #1
    Registered User
    Join Date
    Aug 2005
    Posts
    35

    how can we implement a sub menu in a new page

    Hi,

    I am developing an application relating images on series 60. I have an image and in the 'Options' menu i have 'Save'. when Save is selected the path for the image to be saved is to be selected by the user. I have created some folders in the C: drive and the images should be saved in one of them according to the user selection.

    All i want is when save is selected i want a fresh screen displaying the folders and when it is selected it should display another scren displaying the sub folders.. i have found a piece of code which is exactly what i wanted:

    Code:

    TFileName path = PathInfo::PhoneMemoryRootPath(); //Default
    path.Append( PathInfo::ImagesPath() );

    _LIT(KDialogTitle, "Select Path");

    TBool ret = CAknFileSelectionDialog::RunDlgLD(path,
    PathInfo::PhoneMemoryRootPath(),
    KDialogTitle, // Dialog's title
    this
    );


    I have created my sub folders in the 'Images' folder. The only problem with this is it finds for a file but i need the same apperance of the dialog and screens and search for the folder(the final last subfolder which has only images no more sub folders) and in which i want to save..

    how can we do this.. plz help me with that..

    Thanku
    Deepthi.

  2. #2
    Regular Contributor
    Join Date
    Oct 2004
    Location
    india
    Posts
    306

    Re: how can we implement a sub menu in a new page

    yes, u can do it this way.......
    using CDIR u'll find the folders names in drives say C/E

    draw folder img(to make it look as a folder) besides these folder names ..navigation can be done using offerkeyeventL
    on selecting folders if again folders exists draw same way...

    atlast when u reach files/images ...display thses files/images names

    chk CDIRS and CDIRSCAN


    bye
    N

  3. #3
    Registered User
    Join Date
    Aug 2005
    Posts
    35

    Re: how can we implement a sub menu in a new page

    Hi giridharn,

    I have gone thru CDir and tried the CDirScan

    _LIT(KOthers,"c:\\nokia\\Others\\");
    ...
    ...
    {
    CDir* dirList;

    iScan->SetScanDataL(KOthers,
    KEntryAttDir|KEntryAttMatchExclusive,
    ESortByName
    /*EScanDownTree*/);
    iScan->NextL(dirList);
    ..
    }

    In dirList i get the pointer to the array containing the entries but how do i display the directories on the new screen..
    Pls help me with the code..

    I havent understood much of drawing the folder image and using the OfferKeyEventL.. can u explain me provide with a snippet of the code..

    Thanku
    Deepthi.

  4. #4
    Regular Contributor
    Join Date
    Oct 2004
    Location
    india
    Posts
    306

    Re: how can we implement a sub menu in a new page

    hi, chk this code ..it help u in finding dirs and files within thes dirs

    RFs iFs;
    iFs.Connect();
    TFindFile aFind( iFs );
    CDir* aDir = NULL;
    CDirScan* dirscan = CDirScan::NewLC(iFs);

    _LIT(KDirText,"C:\\nokia\\");
    dirscan->SetScanDataL(
    KDirText,KEntryAttDir,ESortByName|EAscending,
    CDirScan::EScanDownTree

    );
    dirscan->NextL(aDir);
    while(1)
    {
    //here i'm listing all the available directories in region c:\\nokia
    iEikonEnv->QueryWinL(_L(""),dirscan->FullPath());

    TFileName filepath;
    filepath.Copy(dirscan->FullPath());
    //aFind.FindWildByDir(_L("*.*"), filepath, aDir);

    for(TInt i = 0; i < aDir->Count(); i++)
    {
    TEntry aEntry = (*aDir)[i];
    TBuf<100> data;
    data.Copy((*aDir)[i].iName);
    //here it lists the files within the folder...........
    iEikonEnv->AlertWin(data);
    }

    dirscan->NextL(aDir);
    if(!aDir)
    break;
    }

    CleanupStack::PopAndDestroy(dirscan);

    bye
    N

  5. #5
    Registered User
    Join Date
    Aug 2005
    Posts
    35

    Re: how can we implement a sub menu in a new page

    Hi Giridharn,

    In the code u provided, i am able to get the folders in a new screen but one at a time and it is navigating thru all the existing folders...

    But what i want is:

    I have Two folders: X Y
    Each consisting of sub folders: x1 x2 y1 y2

    so when i select 'save' options, i should have a new screen displaying both 'X','Y'. when i select 'X' i should have a new screen displaying 'x1','x2' and when i select 'x1' the image should be saved in c:\\.......\\ X \\ x1. If there r sub folders in 'x1' then it should display them in a new screen... so on.. till there r no furthur sub folders.

    how can i do this..

    Thanks for ur help
    Deepthi.

  6. #6
    Regular Contributor
    Join Date
    Oct 2004
    Location
    india
    Posts
    306

    Re: how can we implement a sub menu in a new page

    hi,

    everythng u want is in that code itself.......try to analyse and get wat u want from it.........


    bye
    N

  7. #7
    Registered User
    Join Date
    Aug 2005
    Posts
    35

    Re: how can we implement a sub menu in a new page

    hi,

    i have tried this code for displaying the directory list..

    TBuf<100> data;
    CDir* dirList;
    User::LeaveIfError(iFs.Connect());
    User::LeaveIfError( iFs.GetDir(KOthers,
    KEntryAttDir|KEntryAttMatchExclusive,
    ESortByName,
    dirList));

    for(i = 0; i < dirList->Count(); i++)
    {
    TChar aChar='\n';
    if(i==0)
    data.Copy((*dirList)[i].iName);
    else
    {
    data.Append(aChar);
    data.Append((*dirList)[i].iName);
    }
    }
    iEikonEnv->AlertWin(data);

    with this i am able to display the list in a specified dir.. but it just displays i.e i cannot make selection b/w the displayed list so how can i do it..

    In general.. if i some option say "display" in the main menu and when it is selected i want to disply some static list(same as menu) in a new screen.. how do i get it.. hey i should have the selection done in the new screen also..


    Thanku
    Deepthi.

  8. #8
    Registered User
    Join Date
    Aug 2005
    Posts
    35

    Re: how can we implement a sub menu in a new page

    any idea how to do it..

  9. #9
    Regular Contributor
    Join Date
    Oct 2004
    Location
    india
    Posts
    306

    Re: how can we implement a sub menu in a new page

    yeah,
    wat u do is simply
    using a buffer array collect all the sub directories name of ur target path say(c:\system\myimgs).
    in adraw function draw these names in a fresh screen. u can handle tthe navigation part using offerkeyeventL
    estdkeyuparrow,estdkeydownarrow..on selecting any subdirectory usig estdkeydevice3..get the directory name and parse it to view its contents ........
    is it ok..


    bye
    N

Similar Threads

  1. Replies: 2
    Last Post: 2007-11-10, 13:19
  2. CBA, menu and key events
    By joker_pl in forum Symbian User Interface
    Replies: 1
    Last Post: 2005-09-19, 10:27
  3. Replies: 0
    Last Post: 2005-02-17, 06:15
  4. Menu bar in FEP
    By kdinn in forum Symbian
    Replies: 0
    Last Post: 2004-05-27, 08:07
  5. Menu Select button using List object
    By abstractworlds in forum Mobile Java General
    Replies: 4
    Last Post: 2002-12-09, 13:08

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×