diff -r 000000000000 -r 89d6a7a84779 Symbian3/SDK/Source/GUID-FC63E2D1-697C-4890-9B70-0DC0AAE7597C.dita --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Symbian3/SDK/Source/GUID-FC63E2D1-697C-4890-9B70-0DC0AAE7597C.dita Thu Jan 21 18:18:20 2010 +0000 @@ -0,0 +1,35 @@ + + + + + +Switching +views in traditional architecture +

If the application contains multiple views and they need to be switched, +it can be done in various ways. One of the common ways is to delete the current +view, create a new view, and add the new one to the control stack. Here, CMyAppUi has +a custom method to change a view. Often a more generic approach should be +favored, but for simplicity the basic idea could be as follows:

+void CMyAppUi::ChangeToView2L() + { + CCoeControl* newView = CMyAppView2::NewL(ClientRect()); + if(iCurrentView) + { + RemoveFromStack(iCurrentView); + delete iCurrentView; + } + iCurrentView = newView; + AddToStackL(iCurrentView); + } + +

Although this architecture provides the most flexible way of manipulating +different views, the view +architecture should be considered. Among other things, it provides +a ready framework for doing the essentials in view switching.

+
\ No newline at end of file