×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Regular Contributor
    Join Date
    Nov 2006
    Location
    Mumbai, India
    Posts
    93

    How to display dialog box with menu item..??

    Hello!!!

    actually i want to display dialog box with menu bar and the dialog will contain only text say 5-6 lines without any control....

    anybody have idea then plz tell me how to write Resource file for it and which class will be appropriate for such dialog box....


    Regards
    Sumit

  2. #2
    Registered User
    Join Date
    Jul 2005
    Location
    Bengaluru, India
    Posts
    747

    Re: How to display dialog box with menu item..??

    You may use this resource:

    Code:
    RESOURCE DIALOG r_message_query_dialog
    	{
    	flags = EGeneralQueryFlags | EEikDialogFlagNoBorder | EEikDialogFlagNoShadow;
    	buttons = R_AVKON_SOFTKEYS_OK_CANCEL;
    	items=
    		{
    		DLG_LINE 
    			{
    			type = EAknCtPopupHeadingPane;
    			id = EAknMessageQueryHeaderId;
    			itemflags = EEikDlgItemNonFocusing;
    			control = AVKON_HEADING
    				{
    				};
    			},
    		DLG_LINE
    			{
    			type = EAknCtMessageQuery;
    			id = EAknMessageQueryContentId;
    			control = AVKON_MESSAGE_QUERY
    				{
    				};
    			}
    		};
    	}
    
    RESOURCE TBUF r_heading_text 
    	{ 
    	buf = qtn_heading_text; 
    	}
    
    RESOURCE TBUF r_message_text
    	{
    	buf = qtn_message_text;
    	}
    Code:
    Code:
    void CYourClass::ShowInfoDialog(TInt aHeadingId, TInt aTitleResId)
    	{
    	HBufC *aInfoTxt = iEikonEnv->AllocReadResourceLC(aHeadingId);
    	HBufC *aTitle = iEikonEnv->AllocReadResourceLC(aTitleResId); 
    
    	CAknMessageQueryDialog* dlg = new (ELeave)CAknMessageQueryDialog(); 
    	
    	dlg->PrepareLC(R_MESSAGE_QUERY_DIALOG);
    	dlg->SetMessageTextL(aInfoTxt->Des());
    	dlg->QueryHeading()->SetTextL(aTitle->Des()); 
    	dlg->RunLD(); 
    
    	CleanupStack::PopAndDestroy(aTitle); 
    	CleanupStack::PopAndDestroy(aInfoTxt); 	
    	}
    Now you can call like this: ShowInfoDialog(R_HEADING_TEXT, R_MESSAGE_TEXT);. You have to include aknmessagequerydialog.h header and link against avkon.lib.

    NB: The above code will display a dialog with a header and message part with OK and Cancel CBA.

  3. #3
    Regular Contributor
    Join Date
    Nov 2006
    Location
    Mumbai, India
    Posts
    93

    Re: How to display dialog box with menu item..??

    Hello friend...!!


    Thanks for ur help it works for me.....i exactly wanted that same thing....


    Regards
    Sumit

  4. #4
    Registered User
    Join Date
    Sep 2008
    Posts
    11

    Smile Re: How to display dialog box with menu item..??

    hi, i want to read a file's contents and display them in a dialog box.The file is created dynamically and after writing some contents to the file , i want to read the contents and display them in a dialog box.Please provide me code solution for that.Thanks in adv

Similar Threads

  1. how to updated the list box on dialog box before it is displaying it.
    By manjunaths in forum Symbian User Interface
    Replies: 3
    Last Post: 2008-03-20, 10:37
  2. how to move other item on the dialog box
    By manjunaths in forum Symbian User Interface
    Replies: 0
    Last Post: 2006-12-07, 12:46
  3. how to get the position of a cascaded item in a menu?
    By GeKI in forum Symbian User Interface
    Replies: 1
    Last Post: 2006-05-18, 15:47
  4. Incoming Call and Dialog Box Display..
    By SymPC in forum Symbian Media (Closed)
    Replies: 1
    Last Post: 2005-12-06, 03:40
  5. Display menu for Dialog
    By parula in forum Symbian
    Replies: 1
    Last Post: 2004-08-11, 11: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
  •