×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    Aug 2003
    Posts
    15

    Changing default FORM options - Simulator Dies

    I am trying to change the default form options by overriding the DynInitMenuPaneL function of CAknForm. However when in

    CAddressForm::DynInitMenuPaneL(TInt aResourceId, CEikMenuPane *aMenuPane) I try to call CAknForm:DynInitMenuPaneL(TInt aResourceId, CEikMenuPane *aMenuPane) the symbian simulator just dissappears. This happens when I press OPTIONS key on my form. The forms get displayed correctly.

    Here is the code that I am using
    CAddressForm::DynInitMenuPaneL(TInt aResourceId, CEikMenuPane *aMenuPane)
    {
    CAknForm:DynInitMenuPaneL(aResourceId,aMenuPane);
    if (aResourceId == R_AVKON_FORM_MENUPANE)
    {
    aMenuPane->SetItemDimmed(EAknFormCmdEdit, ETrue);
    aMenuPane->SetItemDimmed(EAknFormCmdLabel, ETrue);
    aMenuPane->SetItemDimmed(EAknFormCmdAdd, ETrue);
    aMenuPane->SetItemDimmed(EAknFormCmdDelete, ETrue);
    aMenuPane->SetItemDimmed(EAknFormCmdSave, ETrue);
    }
    }

    This is place from where I am creating the form

    CAddressForm* form = CAddressForm::NewL(R_FORM_MENUBAR);
    form->ExecuteLD(R_AKNEXFORM_TEXT_FIELD_DIALOG);

    Constructor:

    CAddressForm* CAddressForm::NewL()
    {
    CAddressForm* self =
    new (ELeave) CAddressForm();
    CleanupStack::PushL(self);
    self->ConstructL();
    CleanupStack::Pop();
    return self;
    }

    CAddressForm* CAddressForm::NewL(TInt aMenuBarId)
    {
    CAddressForm* self =
    new (ELeave) CAddressForm();
    CleanupStack::PushL(self);
    self->ConstructL(aMenuBarId);
    CleanupStack::Pop();
    return self;
    }

    ProcessCommand Function of CAddressForm:

    void CAddressForm::ProcessCommandL(TInt aCommandId)
    {
    switch(aCommandId)
    {
    case EDirectionsCmdGetMap:
    CAddressForm::ProcessCommandL(aCommandId);
    // Handle the command
    break;
    default :
    break;
    }
    }



    This is the menu resource that I am using:

    RESOURCE MENU_BAR r_form_menubar
    {
    titles =
    {
    MENU_TITLE {menu_pane = r_directions_map_menu;}
    };
    }

    RESOURCE MENU_PANE r_directions_map_menu
    {
    items=
    {

    MENU_ITEM { command=EDirectionsCmdGetMap; txt="Find Map"; },
    MENU_ITEM { command=EAknCmdExit; txt="Exit"; }
    };
    }


    Form resource:

    RESOURCE DIALOG r_aknexform_text_field_dialog
    {
    flags = EEikDialogFlagNoDrag | EEikDialogFlagFillAppClientRect |
    EEikDialogFlagNoTitleBar | EEikDialogFlagNoBorder |
    EEikDialogFlagCbaButtons;
    buttons = R_AVKON_SOFTKEYS_OPTIONS_BACK;
    form = r_aknexform_text_field_form;
    }

    RESOURCE FORM r_aknexform_text_field_form
    {
    items =
    {
    DLG_LINE
    {
    type = EEikCtEdwin;
    prompt = qtn_aknexform_form_label_ed1;
    id = EAknExFormDlgCtrlIdEdwin01;
    // itemflags = EEikDlgItemTakesEnterKey | EEikDlgItemOfferAllHotKeys;
    control = EDWIN
    {
    flags = EEikEdwinNoHorizScrolling | EEikEdwinResizable;
    width = 20;
    lines = 1;
    maxlength = 30;
    // added to limit expanding in forms.
    // If you want full screen use 5 here
    //max_view_height_in_lines = 5;
    // if you have the line above, you must have this.
    // It's calculable from LAF
    //base_line_delta = 21;
    };
    },
    DLG_LINE
    {
    type = EEikCtEdwin;
    prompt = qtn_aknexform_form_label_ed2;
    id = EAknExFormDlgCtrlIdEdwin02;
    // itemflags = EEikDlgItemTakesEnterKey | EEikDlgItemOfferAllHotKeys;
    control = EDWIN
    {
    flags = EEikEdwinNoHorizScrolling | EEikEdwinResizable;
    width = 20;
    lines = 1;
    maxlength = 30;
    // added to limit expanding in forms.
    // If you want full screen use 5 here
    //max_view_height_in_lines = 5;
    // if you have the line above, you must have this.
    // It's calculable from LAF
    //base_line_delta = 21;
    };
    },
    DLG_LINE
    {
    type = EEikCtEdwin;
    prompt = qtn_aknexform_form_label_ed3;
    id = EAknExFormDlgCtrlIdEdwin03;
    //itemflags = EEikDlgItemTakesEnterKey | EEikDlgItemOfferAllHotKeys;
    control = EDWIN
    {
    flags = EEikEdwinNoHorizScrolling | EEikEdwinResizable;
    width = 20;
    lines = 1;
    maxlength = 30;
    // added to limit expanding in forms.
    // If you want full screen use 5 here
    //max_view_height_in_lines = 5;
    // if you have the line above, you must have this.
    // It's calculable from LAF
    //base_line_delta = 21;
    };
    }
    };
    }

    Any help is appreciated

  2. #2
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,166
    Hi

    Could you tell a bit more what happens to your emulator. Does it exit, so the emulator is not running at all after it disappears, or does it continue runnning, but not re-fressing the screen ?

    And are there any messages shown in the screen ? and if there are please write them here as well.

    yucca

  3. #3
    Registered User
    Join Date
    Aug 2003
    Posts
    15
    Thanks for replying

    When I press Option key my emulator disappears or I can say exits. And I have to restart the EPOC. There are no messages shown on the screen. It just disappears.

    And if I dont call CAknFormynInitMenuPaneL(aResourceId,aMenuPane);

    It works well and also disables default form options. But then it doesnt show the option that I need.

    Any help is appreciated.

    regards

    Sunil

  4. #4
    Registered User
    Join Date
    Aug 2003
    Posts
    15
    Does anybody has any answer why my emulator dies when I call CAknFormynInitMenuPaneL(aResourceId,aMenuPane);

    thanks

    Sunil

  5. #5
    Registered User
    Join Date
    Mar 2003
    Posts
    17

    DynInitMenuPane

    Hi,

    I think your emulator is getting caught in an endless loop. You are calling a function which has just performed a call to you. Put a break point in this function and check if it gets hit multiple times. Good luck.

    Zlatko

Posting Permissions

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