×

Discussion Board

Results 1 to 10 of 10
  1. #1
    Regular Contributor
    Join Date
    Oct 2008
    Posts
    91

    How to deactivate view?

    Hello All,
    I have an application which contains two views.when I try to switch to the second view, a faded first view is still visible through the second view.
    How can I deactivate the first view completely?

  2. #2
    Super Contributor
    Join Date
    Jul 2007
    Posts
    596

    Re: How to deactivate view?

    Quote Originally Posted by ash_leo View Post
    Hello All,
    I have an application which contains two views.when I try to switch to the second view, a faded first view is still visible through the second view.
    How can I deactivate the first view completely?
    First follow a standard multiview aplication .Just debug it and see how things are done .

    then try to implement them for ur app. Then if u face some pb feel free to ask here with apropriate code snipet...(if possible).

    here is a nice exp for u
    http://www.forum.nokia.com/info/sw.n...ion_Views.html

    Thanks

  3. #3
    Nokia Developer Champion
    Join Date
    Jun 2008
    Location
    Noida,India
    Posts
    4,086

    Re: How to deactivate view?

    i think in draw function of ur second view u hav to call the following function:

    gc.clear()

    where gc is ;

    CWindowGc& gc = SystemGc();

  4. #4
    Regular Contributor
    Join Date
    Oct 2008
    Posts
    91

    Re: How to deactivate view?

    Thanks a lot!
    After using gc.Clear() its working now

  5. #5
    Regular Contributor
    Join Date
    Jun 2008
    Location
    Jordan
    Posts
    213

    Re: How to deactivate view?

    Quote Originally Posted by vineet.jain View Post
    i think in draw function of ur second view u hav to call the following function:

    gc.clear()

    where gc is ;

    CWindowGc& gc = SystemGc();
    No, it is not necessary to call gc.clear() to deactivate your previous view, and it is very bad style to declare Draw() in your VIEW class, as it is inherited from CAknView and you have to declare Draw() by yourself and call it everywhere to update your view.

    Instead, your Container class should be inherit CCoeControl class, then implement it's Draw(Const TRect aRect) virual function in your container class and do your stuff there and in your View class implement CAknView's DoDeactivate() virtual function and destruct your container object there, something like this:

    Code:
    void CMyFirstView::DoDeactivate()
    {
    	if (m_pControl)
    	{
    		AppUi()->RemoveFromViewStack(*this, m_pControl);
    		delete m_pControl;
    		m_pControl = NULL;
    	}
    }
    in this way, you assure that your previous view will not still there when the second view activated.


    Let me know if you need further help.
    Good luck.
    Regards,
    Leonard

  6. #6
    Nokia Developer Champion
    Join Date
    Jun 2008
    Location
    Noida,India
    Posts
    4,086

    Re: How to deactivate view?

    hey i meant that only, to call the clear in the draw function of ur container class not ur view..:)

  7. #7
    Registered User
    Join Date
    Mar 2012
    Posts
    40

    Re: How to deactivate view?

    I am having same problem but when i Activate other view application get closed.
    how to solve it ?

  8. #8
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,748

    Re: How to deactivate view?

    Check if there is an error message: http://www.developer.nokia.com/Commu...ded_panic_code

  9. #9
    Registered User
    Join Date
    Mar 2012
    Posts
    40

    Re: How to deactivate view?

    Is it possible to push a view for some time interval and then after expiry of time it will self destroyed. ??

  10. #10
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,748

    Re: How to deactivate view?

    If we are talking about CAknView views, they should not be destroyed until exiting the application. However it is possible to automatically activate another view after some time.

Similar Threads

  1. Multi View problem
    By hendrawan.ashari in forum Symbian
    Replies: 3
    Last Post: 2008-02-27, 06:02
  2. how to make the status pane of a view disappear?
    By xhsoldier in forum Symbian
    Replies: 4
    Last Post: 2007-07-24, 14:25
  3. Go back to caller view...
    By VinodRaut in forum Symbian User Interface
    Replies: 4
    Last Post: 2007-05-11, 14:22
  4. View changing
    By ckt in forum Symbian
    Replies: 7
    Last Post: 2007-02-22, 13:02
  5. Trigger event after view is Activated?
    By inc0gn1t007 in forum Symbian
    Replies: 0
    Last Post: 2006-03-29, 02:55

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×