Old blogs

S60 UI Designer - working with queries and notes

UI Designer - August 30th, 2006 - Written by left_blank

In a previous post we saw that the UI Designer wizard can help you create forms, setting item lists, and custom control containers. Those are the top-level designs it supports. Within a design there’s a variety of notes and dialogs you can use.


palette_notes_dialogs.png

If you expand the Notes and Dialogs folder in the palette you’ll see the available note and dialog components. Queries are dialogs that request something of the user. Data queries ask for some type of input or selection from a list. Confirmation queries allow the user to confirm or cancel some operation. Notes are are informational dialogs that don’t require user input — they display a message briefly and then go away. The wait dialog is used to show some long running operation is taking place, but is not equivalent to a progress dialog

Working with notes and dialogs is very similar to working with menus. Since their UI is transient, they are represented by icons in the non-layout area. When you select the icon the UI overlays the editor’s design area.

dataquery1.png

Let’s look at the Single-line Data Query as an example. When you first add one it will appear above. As long as the dataQuery1 object or one of its children is selected the transient UI will remain visible. As soon as you select some other object, the transient UI disappears. To show it again click on the dataQuery1 icon in the non-layout area.

dataquery_type_property.png

The query has two main properties: the prompt and type. Changing the type property changes the data type the dialog returns as well as the associated editor. This editor is a child of the dialog. You can select it and edit its properties directly. For example, if you’ve selected the ‘date’ type you can then select the date editor to modify the minimum and maximum dates.

For all the notes and dialogs, except for the Wait Dialog, the designer generates a method to run your dialog. Since a dialog runs synchronously there’s no need to generate a data member in your class. For the data query the method looks like:

/**
* Show the popup dialog for dataQuery1
* @param aData in-out TDes data
* @param aUseDefaults TBool use designer default editor data if ETrue
* @param aOverridePrompt optional override prompt text
* @return EAknSoftkeyOk (left soft key id) or 0
*/
TInt CMyApplicationContainerView::RunDataQuery1L( TDes& aData, TBool aUseDefaults, const TDesC* aOverridePrompt )
.

The various parameters are there to allow for different usage models. You might want to specify the prompt and/or the initial value of the data at design-time or run-time. By design-time we mean the value you entered into the editor, rather than some value that varies as you run your application.

The Wait Dialog has a different usage model and therefore generates different source code. Typically you want to show the wait dialog, start your long-running process, and then remove it when you’re done. Therefore two separate methods are generated, one to show the dialog and another to remove it.


/**
* Execute the wait dialog for waitDialog1. This routine returns
* while the dialog is showing. It will be closed and destroyed when
* RemoveWaitDialog1L() or the user selects the Cancel soft key.
* @param aOverrideText optional override text. When null the text configured
* in the UI Designer is used.
*/
void CMyApplicationContainerView::ExecuteWaitDialog1LD( const TDesC* aOverrideText )

/**
* Close and dispose of the wait dialog for waitDialog1
*/
void CMyApplicationContainerView::RemoveWaitDialog1L()

Also the Wait Dialog supports a ‘canceled’ event. When you add a handler for this event you’ll receive notification if the user tries to cancel before the process completes.

About the author left_blank

  • Number of posts: 236

Comments(2)

  1. karteeka wrote

    how to write multi line text in single dataquery?

  2. karteeka wrote

    how to write multi line text in single dataquery?