Symbian
Symbian OS Library

FAQ-0779 How does the Notes editor in the 9200 Series Contacts app resize itself?

[Index][spacer] [Previous] [Next]



 

Classification: C++ Category: UIKON
Created: 03/25/2002 Modified: 04/09/2002
Number: FAQ-0779
Platform: Symbian OS v6.0

Question:
When new lines are added to (or subtracted from) the Notes field in the edit window of the Contacts app on a Nokia 9200 series communicator, the window allows the Notes field to extend itself (or contract). How does it do this? And what classes and methods are involved?

Answer:
The edit window of the Contacts app is a CEikScrollableForm which implements inter alia the MEikEdwinSizeObserver interface. This is in turn embedded together with a CEikScrollBar in a CEikScrollableFormContainer.

    The Notes field is a CEikCaptionedControl containing a CEikEdwin. The trick is, when it needs to expand, it must notify the containing form. To do this it must previously have added the form as an observer, with its SetEdwinSizeObserver(MEikEdwinSizeObserver) method. The resizing in response is done in the HandleEdwinSizeEventL(...) method which the form implements. This method performs the following tasks:
      1. Resize the height of the form to accommodate an edwin with the newly requested size.
      2. Call ResetMinimumSizes() on the captioned control containing the edwin, resize the edwin with SetSize(), then reposition any other captioned controls whose position is below the edwin.
      3. Deal with any scrolling which is needed to display the form with the resized edwin appropriately.
      4. Calculate the invalid rectangle that will need to be redrawn client side.
      5. Invalidate the window and redraw the invalid on-screen rectangle by calling HandleRedrawEvent(TRect) on it.
      6. Call ReportEventL(EEventStateChanged) to inform any CCoeControl observers of the resize event.
      7. Return ETrue if the size changed, EFalse if it didn't.