×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Regular Contributor
    Join Date
    Jul 2008
    Posts
    120

    Change dialog icon

    Hi,

    I would like to use CAknDialog (or CEikDialog) directly, instead of using its derivatives (CAknConfirmationNote, CAknQueryDialog, etc.).

    Reason for that: I want to derive all my dialogs (queries, confirmations, queries. etc.) from my custom dialog base class, which inherits CEikDialog and implements some of its methods.

    Problem is that I don't know how to control the icon that appears (?, X, !, etc.).

    Manually defining the dialog, it always causes the dialog to present the "?" icon.

    Below is the code I'm using.

    Any way to change the icon?

    Dialog header:
    Code:
    class CMyDialog :
    	public CAknDialog
    {
    	...
    
    protected:
    	// Override CEikDialog
    	virtual TBool
    	OkToExitL(
    		TInt aButtonId );
    	
    	// Override CEikDialog
    	virtual void
    	PostLayoutDynInitL();
    
    public:
    	CMyDialog(
    		MMyDialogObserver & aObserver,
    		TInt                aResourceId );
    
    	TInt
    	ExecuteLD();
    
    protected:
    	MMyDialogObserver & iObserver;
    	TInt                iResourceId;
    };
    Usage:
    Code:
    	iDialog = new (ELeave) CMyDialog( *this, R_MY_NOTE ); 
    	iDialog->ExecuteLD();
    Resource:
    Code:
    RESOURCE DIALOG r_my_note
    {
    flags = EAknDialogGenericNoteFlags;
    buttons = R_AVKON_SOFTKEYS_OK_EMPTY;
    items =
    	{
    	DLG_LINE
    		{
    		type = EAknCtQuery;
    		id = EMyNote;
    		control = AVKON_CONFIRMATION_QUERY
    			{
    			layout = EConfirmationQueryLayout;
    			label = STR_MyNote;
    			};
    		}
    	};
    }

    Thanks,
    Nadav

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

    Re: Change dialog icon

    I guess "?" mark comes as u r using a
    control = AVKON_CONFIRMATION_QUERY. U can follow ur aproach but u have to use diff resources for diff dialogtype(AFAIK). otherwise u can use system dialogs.

    Thanks

  3. #3
    Regular Contributor
    Join Date
    Jul 2008
    Posts
    120

    Re: Change dialog icon

    Hi Kishore84,

    Thanks a lot for your response.

    Following your advice, I've looked in the SDK headers, and finally came up with the code below. The result was an empty dialog.

    Any ideas?

    Resource:
    Code:
    RESOURCE DIALOG r_my_note_dialog
    {
    flags = EAknInformationNoteFlags;
    buttons = R_AVKON_SOFTKEYS_OK_EMPTY;
    items =
    	{
    	DLG_LINE
    		{
    		type = EAknCtNote;
    		id = EMyNoteId;
    		control = AVKON_NOTE
    			{
    			layout = EGeneralLayout;
    			singular_label = "My message";
    			};
    		}
    	};
    }
    Code:
    Code:
    CAknDialog * dialog = new (ELeave)CAknDialog;
    return dialog->ExecuteLD( R_MY_NOTE_DIALOG );
    Thanks,
    Nadav

  4. #4
    Super Contributor
    Join Date
    Jul 2006
    Location
    Oulu, Finland.
    Posts
    1,174

    Re: Change dialog icon

    Resource looks ok, what is the problem, Do you want to have your own Icon?

  5. #5
    Registered User
    Join Date
    Dec 2005
    Posts
    1,236

    Re: Change dialog icon

    Hi,

    for that you should try custom control in dialog you could have your own icon there try this link http://wiki.forum.nokia.com/index.ph...rol:_In_dialog
    Regards,
    Sriky

Similar Threads

  1. creating a note dialog with a custom icon
    By qt_chenchen in forum Symbian
    Replies: 1
    Last Post: 2008-08-15, 09:47
  2. how to change the application icon of Console Application?
    By s_mehdi76 in forum Symbian User Interface
    Replies: 4
    Last Post: 2008-06-14, 06:23
  3. how can i change icon of project?
    By hst_little in forum Mobile Java General
    Replies: 2
    Last Post: 2008-01-22, 00:22

Posting Permissions

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