Join Now

Hi, I'm Paul, but you can also call me Todd and I won't get upset.

Creating a message details dialog

Paul.Todd | 29 December, 2006 13:03

A while ago someone wanted a dialog that looked and acted like the dialog for
the message details in the messaging application (see)

What they were looking for is something like this... (thanks payu.sergey  for the picture)

Unfortunately I wrote an implementation for someone else that I could not reused so I looked
at it again over Xmas to see if there was anything that could be salvaged.

Message dialog example

I realized there are two ways to do this, one with a CAknSelectionListDialog and one with
a CAknPopupList. The second one which I missed in the original implementation is much
simpler.

We are only going to cover the second one as its a little over 70 lines of code in total.

The real trick to solving this problem is realizing how to tackle it.

First, what kind of listbox you are we looking at.
In this case it is a single heading style list box.

The single means that it takes one line and the heading means that the list box
is split into two halves, the one is the caption and the other is the text. Also, the
caption will be in the normal font and the text in bold font, which kind of helps us
decide that this is indeed a listbox.

Next is what to do if  we have a very long string we need to split it into
different lines and then make sure the line with the split text goes into the correct
column.


For example
HeadingtThis is some very long text
would split into two lines
HeadingtThis is some
       tvery long text
      
Finally the only thing we need to know is how big the column is for the heading and
the the text. We are lucky in that these can be obtained from the listbox, before the
listbox is displayed, allowing us to get the width and the font to be used based on the
LAF specification so it complies with the skins API and locale etc.

So now we know how to create the listbox, its container, the font , widths and how to
split the content.

Next time we will go through the code on how it was done.

Comments

You must login to post comments. Login
 
 
Powered by LifeType
     
     RDF Facets:
     
     
     qfnZtopicQUqfnTopicZcppQ
     qfnZtopicQUqfnTopicZseriesE5f60Q
     qfnZtypeQUqfnTypeZBlogContentQ
     qfnZtypeQUqfnTypeZBlogE45ntryQ
     qfnZtypeQUqfnTypeZCommunityContentQ
     qfnZtypeQUqfnTypeZWebpageQ
     qmarsZlanguageQUxhttpE3aE2fE2fswE2enokiaE2ecomE2flanguageE2d1E2fenX