Archived:Incorrect drawing area returned by CAknView::ClientRect() in S60 2nd Edition (Known Issue)
Issue applies to out of scope platform versions.
In some situations, the drawing area returned by CAknView::ClientRect() is incorrect on the S60 2nd Edition.
Article Metadata
Compatibility
Article
Description
CAknView implements its own version of the ClientRect() function, which is normally used when setting the size of the container control(s) maintained by the view. In some cases, the height of the rectangle returned by CAknView::ClientRect() is incorrect; this happens when there are both an application-level CBA as well as a view-specific CBA defined in the resource file.
The end result is that the area occupied by the control pane is subtracted twice from the application drawing rectangle, and the height of the rectangle returned by CAknView::ClientRect() is too small.
How to reproduce
This can be easily reproduced with the 'multiviews' example application from S60 2nd Edition, FP3 SDK.
In multiviews.rss, add a CBA definition in the EIK_APP_INFO resource
RESOURCE EIK_APP_INFO {
cba = R_AVKON_SOFTKEYS_OPTIONS_BACK;
}Then recompile and run the example.
Solution
This issue can be solved by designing the view-based application so that it does not need a CBA defined in EIK_APP_INFO resource (eg., replace it with a CBA from the 'main' view).
Another option is to pass a reference to the AppUi when constructing the view(s), and replace the CAknView::ClientRect() calls with CEikAppUi::ClientRect() calls in the views' implementation.


(no comments yet)