How to catch DONE from DIALOG buttons

Login to reply to this topic.
Wed, 2004-11-03 16:29
Joined: 2004-09-06
Forum posts: 349
I guess this is a trivial one for many of you Symbian guys out there: If I use the predefined buttons R_AVKON_SOFTKEYS_OPTIONS_DONE as I do in the following resources - how / where do I catch the users push on the done button? (I have already tried in HandleCommandL in the view)

Code:
RESOURCE DIALOG r_contact_dialog
   {
   flags = EEikDialogFlagNoDrag | EEikDialogFlagFillAppClientRect | EEikDialogFlagWait
         | EEikDialogFlagButtonsRight | EEikDialogFlagNoTitleBar
         | EEikDialogFlagCbaButtons /*| EEikDialogFlagModeless */;
   buttons =  R_AVKON_SOFTKEYS_OPTIONS_DONE;
   form = r_contact_form;
   }

RESOURCE FORM r_contact_form
   {
   flags = EAknExScrollerInt0;
   items =
       {
       DLG_LINE
           {
           type = EEikCtEdwin;
           prompt = qtn_contact_form_phone;
           id = EAknExScrollerDlgLineEdwinPhone;
           itemflags = EEikDlgItemSeparatorAfter;
           control = EDWIN
               {
               maxlength = EAknExScrollerInt256;
               width = EAknExScrollerInt6;
               lines = EAknExScrollerInt5;
               };
           },
       DLG_LINE
           {
           type = EEikCtEdwin;
           prompt = qtn_contact_form_first_name;
           id = EAknExScrollerDlgLineEdwinFirstName;
           control = EDWIN
               {
               maxlength = EAknExScrollerInt256;
               width = EAknExScrollerInt6;
               lines = EAknExScrollerInt5;
               };
           },
       DLG_LINE
           {
           type = EEikCtEdwin;
           prompt = qtn_contact_form_last_name;
           id = EAknExScrollerDlgLineEdwinLastName;
           control = EDWIN
               {
               maxlength = EAknExScrollerInt256;
               width = EAknExScrollerInt6;
               lines = EAknExScrollerInt5;
               };
           },
       DLG_LINE
           {
           type = EEikCtEdwin;
           prompt = qtn_contact_form_address;
           id = EAknExScrollerDlgLineEdwinAddress;
           control = EDWIN
               {
               maxlength = EAknExScrollerInt256;
               width = EAknExScrollerInt6;
               lines = EAknExScrollerInt5;
               };
           },
       DLG_LINE
           {
           type = EEikCtNumberEditor;
           prompt = qtn_contact_form_postal_nr;
           id = EAknExScrollerDlgLineNumberPostnummer;
           itemflags = EEikDlgItemSeparatorAfter;
           control = NUMBER_EDITOR
               {
               min = EAknExScrollerInt0;
               max = EAknExScrollerInt10;
               };
           },
       DLG_LINE
           {
           type = EEikCtEdwin;
           prompt = qtn_contact_form_city;
           id = EAknExScrollerDlgLineEdwinCity;
           control = EDWIN
               {
               maxlength = EAknExScrollerInt256;
               width = EAknExScrollerInt6;
               lines = EAknExScrollerInt5;
               };
           }          
       };
   }


I also have this to execute the dialog:

iContactForm = CTerminalAppContactForm::NewL(contactInfo);
TInt retVal = iContactForm->ExecuteLD(R_CONTACT_DIALOG);

However, when I press "Done" nothing happens.

Wed, 2005-06-01 03:20
Joined: 2005-05-24
Forum posts: 20
Re: How to catch DONE from DIALOG buttons
use a switch after this:

iContactForm = CTerminalAppContactForm::NewL(contactInfo);
TInt retVal = iContactForm->ExecuteLD(R_CONTACT_DIALOG);
..
switch (retVal)
{
   ...
   ...
}


or you can use "if statement" directly..
  • Login to reply to this topic.