×

Discussion Board

Results 1 to 12 of 12
  1. #1
    Registered User
    Join Date
    Jun 2008
    Location
    Vantaa, Finland
    Posts
    14

    Question Calling for a dialog

    Hey, could you help me out. I can't find out how to get a dialog open. I try to open the dialog but nothing happens.

    This is on my AppUi.cpp:

    case AddEntry: {
    CAknMessageQueryDialog* dlg = new(ELeave)CAknMessageQueryDialog();
    dlg->ExecuteLD(R_ADDENTRY_DIALOG);
    } break;

    This is on my .rss:

    RESOURCE DIALOG r_addentry_dialog
    {
    flags = EGeneralQueryFlags | EEikDialogFlagNoBorder | EEikDialogFlagNoShadow;
    buttons = R_AVKON_SOFTKEYS_OK_CANCEL;
    items=
    {
    DLG_LINE
    {
    type = EAknCtMultilineQuery;
    id = EMultilineFirstLine;
    control = AVKON_DATA_QUERY { label="Title"; };
    }
    //Ask for a due date
    //Ask for an interval in days (0 for no repeating)
    };
    }

  2. #2
    Nokia Developer Champion
    Join Date
    Mar 2006
    Location
    Helsinki, Finland
    Posts
    8,344

    Re: Calling for a dialog

    Have a look into Wiki article: http://wiki.forum.nokia.com/index.ph...e_About_dialog

    Kiran.
    Nokia Developer Wiki Moderation team

  3. #3
    Registered User
    Join Date
    Jun 2008
    Location
    Vantaa, Finland
    Posts
    14

    Question Re: Calling for a dialog

    Thanks. It seems there's something wrong with my switch. My case doesn't get executed when I select "Add" from my menu.

    .hrh:

    enum TToDoRepeatMobileIds
    {
    AddEntry,
    EAbout
    };

    .rss:
    RESOURCE MENU_PANE r_menu
    {
    items =
    {
    // added the new Options menu command here

    MENU_ITEM
    {
    command = AddEntry;
    txt = "Add";
    }
    ,
    MENU_ITEM
    {
    command = EAbout;
    txt = qtn_about;
    },
    MENU_ITEM
    {
    command = EAknSoftkeyExit;
    txt = qtn_exit;
    }
    };
    }

    AppUi.cpp:
    switch (aCommand)
    {
    case EEikCmdExit:
    case EAknSoftkeyExit:
    Exit();
    break;

    // Add To-Do entry
    case AddEntry: {
    _LIT(KtxAbbout, "My application and its version \n\n" \
    "Copyright me 1999-2007, All right" \
    "reserved.\n\nemail:\nme@mymail.com\n" \
    "Homepage:\nwww.myhome.com");
    _LIT(KtxApplicationName ,"My Application");


    HBufC* Abbout = KtxAbbout().AllocLC();
    CAknMessageQueryDialog* dlg = CAknMessageQueryDialog::NewL(*Abbout);
    dlg->PrepareLC(R_ABOUT_HEADING_PANE);
    dlg->SetHeaderTextL(KtxApplicationName);
    dlg->RunLD();

    CleanupStack::PopAndDestroy(Abbout);
    } break;

  4. #4
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,684

    Re: Calling for a dialog

    Can you exit from your application?

  5. #5
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,684

    Re: Calling for a dialog

    Forget it. The problem is that menu command 0 is reserved for simply closing the menu. Start you enumeration from 1.

  6. #6
    Registered User
    Join Date
    Jun 2008
    Location
    Vantaa, Finland
    Posts
    14

    Re: Calling for a dialog

    Hey. I can exit with my right exit button and through options on left button. This "About" option in options menu works, but "Add" doesn't.

    It seems strange, this AddEntry looks same as EAbout. Still only EAbout works.

  7. #7
    Registered User
    Join Date
    Jun 2008
    Location
    Vantaa, Finland
    Posts
    14

    Re: Calling for a dialog

    I get it now, thank you.

    I put it like this:

    enum TToDoRepeatMobileIds
    {
    Exit = 0x6001, // menu command 0 is reserved for simply closing the menu
    AddEntry,
    EAbout
    };

  8. #8
    Registered User
    Join Date
    Jun 2008
    Location
    Vantaa, Finland
    Posts
    14

    Re: Calling for a dialog

    I have one more problem. The application compiles fine but crashes when I try to open the dialog. It worked when I had only first DLG_LINE.

    .cpp:
    case AddEntry: {
    CAknDialog* dlg = new (ELeave) CAknDialog();
    dlg->ExecuteLD( R_ADDENTRY_DIALOG );
    } break;

    .rss:
    RESOURCE DIALOG r_addentry_dialog
    {
    flags=EEikDialogFlagWait;
    buttons = R_AVKON_SOFTKEYS_OK_CANCEL;
    items =
    {
    DLG_LINE
    {
    type = EAknCtQuery;
    id = EGeneralQuery;
    control = AVKON_DATA_QUERY
    {
    layout = EDataLayout;
    label = "Title";
    control = EDWIN
    {
    width = 5;
    lines = 1;
    maxlength = 15;
    };
    };
    },
    DLG_LINE
    {
    type = EAknCtQuery;
    id = EGeneralQuery;
    control = AVKON_DATA_QUERY
    {
    layout = EDateLayout;
    label = qtn_aknexquery_date_label_text;
    control = DATE_EDITOR { };
    };
    },
    DLG_LINE
    {
    type = EAknCtQuery;
    id = EGeneralQuery;
    control= AVKON_DATA_QUERY
    {
    layout = ENumberLayout;
    label = "Interval";
    control = AVKON_INTEGER_EDWIN {
    min = 0;
    max = 36500;
    };
    };
    }
    };
    }

  9. #9
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,684

    Re: Calling for a dialog

    Check if http://wiki.forum.nokia.com/index.ph...ded_panic_code reveals something.
    And make friends with [CODE ] and [/CODE ] tags.

  10. #10
    Registered User
    Join Date
    Jun 2008
    Location
    Vantaa, Finland
    Posts
    14

    Re: Calling for a dialog

    Like this?
    Code:
    		case AddEntry: {
    			CAknDialog* dlg = new (ELeave) CAknDialog();
    			dlg->ExecuteLD( R_ADDENTRY_DIALOG );
    		} break;
    I got panic: 3,USER.

    The first DLG_LINE works, but others don't (I commented them out and it works):
    Code:
    RESOURCE DIALOG r_addentry_dialog
    	{
    	flags=EEikDialogFlagWait;
    	buttons = R_AVKON_SOFTKEYS_OK_CANCEL;
    	items =
    		{
    		DLG_LINE
    			{
    			type = EAknCtQuery;
    			id = EGeneralQuery;
    			control = AVKON_DATA_QUERY
    				{
    				layout = EDataLayout;
    				label = "Title";
    				control = EDWIN
    					{
    					width = 5;
    					lines = 1;
    					maxlength = 15;
    					};
    				};
    			}/*,
    		DLG_LINE
    			{
    			type = EAknCtQuery;
    			id = EGeneralQuery;
    			control = AVKON_DATA_QUERY
    				{
    				layout = EDateLayout;
    				label = qtn_aknexquery_date_label_text;
    				control = DATE_EDITOR { };
    				};
    			},
    		DLG_LINE
    			{
    			type = EAknCtQuery;
    			id = EGeneralQuery;
    			control= AVKON_DATA_QUERY
    				{
    				layout = ENumberLayout;
    				label = "Interval";
    				control = AVKON_INTEGER_EDWIN {
    					min = 0;
    					max = 36500;
    					};
    				};
    			}*/
    		};
    Last edited by tubelius; 2008-07-04 at 14:46. Reason: adding more information

  11. #11
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,684

    Re: Calling for a dialog

    Then search for USER 3 in the SDK Help.
    Id fields should be unique, that is why they can identify something. EGeneralQuery is specifically used by CAkn...QueryDialog-s, but you can use any number.
    It would be advisable to test the controls one by one, so if the first one is OK, simply comment it out, and fix the second one, etc.

  12. #12
    Registered User
    Join Date
    Jun 2008
    Location
    Vantaa, Finland
    Posts
    14

    Re: Calling for a dialog

    Thanks again. However, I am stuck with another problem now. I get the dialog open now, but the date field is invisible until I enter it. When I have entered the date field, I cannot get out of the field. I haven't found help page specific enough.

    Code:
    		case AddEntry: {
    			CAknDialog* dlg = new (ELeave) CAknDialog();
    			dlg->ExecuteLD( R_ADDENTRY_DIALOG );
    		} break;
    Code:
    RESOURCE DIALOG r_addentry_dialog
    	{
    	flags=EEikDialogFlagWait|EEikDialogFlagFillScreen;
    	buttons = R_AVKON_SOFTKEYS_OK_CANCEL;
    	items =
    		{
    		DLG_LINE
    			{
    			type = EAknCtQuery;
    			id = 0;
    			control = AVKON_DATA_QUERY
    				{
    				layout = EDataLayout;
    				label = "Title";
    				control = EDWIN
    					{
    					width = 5;
    					lines = 1;
    					maxlength = 15;
    					};
    				};
    			},
    		DLG_LINE
    			{
    			type = EAknCtQuery;
    			id = 1;
    			control = AVKON_DATA_QUERY
    				{
    				layout = EDateLayout;
    				label = "Due Date";
    				control = DATE_EDITOR 
    					{ 
    					minDate = DATE
    						{
    						year = 2008;
    						month = 1;
    						day = 1;
    						};
    					maxDate = DATE
    						{
    						year = 2200;
    						month = 1;
    						day = 1;
    						};
    					flags = 0;
    					};
    				};
    			},
    		DLG_LINE
    			{
    			type = EAknCtQuery;
    			id = 2;
    			control= AVKON_DATA_QUERY
    				{
    				layout = ENumberLayout;
    				label = "Interval";
    				control = AVKON_INTEGER_EDWIN {
    					min = 0;
    					max = 36500;
    					};
    				};
    			}
    		};
    	}

Similar Threads

  1. PIM-Api Problem: Suppressing Dialog after calling Commit()
    By mehrlich in forum Mobile Java General
    Replies: 8
    Last Post: 2010-03-01, 15:55
  2. Launching a dialog when the application starts
    By Uriah Eisenstein in forum Symbian User Interface
    Replies: 10
    Last Post: 2009-03-31, 09:06
  3. creating calling dialog
    By arumilli in forum Symbian
    Replies: 0
    Last Post: 2008-05-21, 06:19
  4. [announce] wait dialog wrapper 0.2
    By lfd in forum Symbian
    Replies: 10
    Last Post: 2008-03-21, 11:03
  5. CAknWaitDialog dialog not seem when calling SetDefaultViewL??
    By mayur_24 in forum Symbian User Interface
    Replies: 2
    Last Post: 2006-11-29, 06:52

Posting Permissions

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