×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Apr 2008
    Posts
    27

    Smile Problem -> Set focus on 2'nd DLG_line in Dialog.

    Hello friends,

    I am facing problem in setting the focus in second control in my dialog.
    By default focus is set on first DLG_Line.
    I want to set focus on Second DLG_line.
    <code>
    RESOURCE DIALOG r_im_dialog
    {
    flags = EEikDialogFlagNoDrag | EEikDialogFlagFillAppClientRect | EEikDialogFlagNoTitleBar | EEikDialogFlagWait | EEikDialogFlagCbaButtons;
    buttons = r_im_cba;
    form = r_im_form;
    }

    RESOURCE FORM r_im_form
    {
    flags = EEikFormEditModeOnly | EEikFormUseDoubleSpacedFormat;
    items =
    {

    DLG_LINE
    {
    type = EEikCtEdwin;
    prompt = qtnBuddy;
    id = EIMBuddyName;
    control = EDWIN
    {
    width = 10;
    maxlength = 511;
    lines = KLines;
    default_case = EAknEditorTextCase;
    allowed_case_modes = EAknEditorAllCaseModes;
    numeric_keymap = EAknEditorStandardNumberModeKeymap;
    default_input_mode = EAknEditorTextInputMode;
    allowed_input_modes = EAknEditorAllInputModes;
    special_character_table = R_AVKON_SPECIAL_CHARACTER_TABLE_DIALOG;
    };
    },
    DLG_LINE

    {

    type = EEikCtEdwin;

    prompt = qtn_Message;

    id = EMessage;


    control = EDWIN

    {
    //height=10;
    maxlength = 511;
    lines = KLines;

    default_case = EAknEditorTextCase;
    allowed_case_modes = EAknEditorAllCaseModes;
    numeric_keymap = EAknEditorStandardNumberModeKeymap;
    default_input_mode = EAknEditorTextInputMode;
    allowed_input_modes = EAknEditorAllInputModes;
    special_character_table = R_AVKON_SPECIAL_CHARACTER_TABLE_DIALOG;

    };

    }



    };


    }

    </code>
    and in My application i am setting the focus in following way.
    <code>
    void CIMForm ::PreLayoutDynInitL()
    {
    CAknForm::PreLayoutDynInitL();

    CEikEdwin* nEditor = static_cast <CEikEdwin*> (ControlOrNull(EIMBuddyName));


    if(nEditor)
    { nEditor->SetFocus(EFalse);
    nEditor->SetReadOnly(ETrue);
    nEditor->SetFocusing(EFalse);
    }

    nEditor = static_cast <CEikEdwin*> (ControlOrNull(EMessage));

    if(nEditor)
    {
    nEditor->SetFocus(ETrue);

    }
    }
    </code>

    Please help me .
    Thanks,
    Praveen.

  2. #2
    Super Contributor
    Join Date
    Jul 2007
    Posts
    596

    Smile Re: Problem -> Set focus on 2'nd DLG_line in Dialog.

    Hi,
    praveen, here below i had done somethings just like your code.

    it was working properly for 3rd edition.

    here below i am giving some code snipet just check it if it is useful

    void CMyContainer::FocusTo( TInt aCommand )
    {
    switch( aCommand )
    {
    case EMobileDMRUserNameEditor:
    {

    iPasswordEditor->SetFocus( EFalse );
    iUserNameEditor->SetFocus( ETrue );
    }

    break;

    case EMobileDMRPasswordEditor:
    {
    iUserNameEditor->SetFocus( EFalse );
    iPasswordEditor->SetFocus( ETrue );
    }

    break;

    default:
    break;
    }

    I think you just have to call this code with proper control id
    which one you want to focus.


    Thanks

Similar Threads

  1. Problem with a dialog and EEventKeyDown
    By er_benji in forum Symbian User Interface
    Replies: 4
    Last Post: 2008-01-16, 08:35
  2. Replies: 1
    Last Post: 2007-03-28, 08:50
  3. Problem on Text Query Dialog
    By stevenhotw in forum Symbian
    Replies: 5
    Last Post: 2006-07-24, 08:18
  4. Replies: 1
    Last Post: 2006-05-29, 07:08
  5. dialog with hotkeys problem
    By miskol in forum Symbian User Interface
    Replies: 0
    Last Post: 2006-05-29, 01:54

Posting Permissions

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