×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Mar 2012
    Posts
    60

    Call CAknViewAppUi from CCoeControl

    Hi,

    i have a button (mybutton_1) derived from CCoeControl which captures pointer events.
    Now i try to call HideMe() from CMyAppUi class to hide the button (mybutton_1->MakeVisible(EFalse) on a pointer event on mybutton_1.

    Maybe its too late, but i just dont get it?
    How can i call HideMe() from CCoeControl? or can i hide the button directly in CCoeControl?



    Code:
    class CMyButton: public CCoeControl 
    	{
    public:
     	void HandlePointerEventL(const TPointerEvent &aEvent);
    
    
    class CMyAppUi: public CAknViewAppUi
            {
    public: 
     	void HideMe();
            CMyButton* mybutton_1;
    Code:
    void CMyAppUi::ConstructL()
            {
    	mybutton_1=CMyButton::NewL(wg);
    	mybutton_1->MakeVisible(ETrue);
    
    
    void CMyAppUi::HideMe()
           {
           mybutton_1->MakeVisible(EFalse);
    
    
    void CMyButton::HandlePointerEventL(const TPointerEvent &aEvent)
         {	
         if(aEvent...

  2. #2
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,165

    Re: Call CAknViewAppUi from CCoeControl

    You could get pointer to your AppUI class with CCoeEnv::Static()->AppUI() then you would just need to cast it to your own type. Anyway, not certain whether it makes sense to hide it from AppUI class, then again, its your design, so you know better how it should be designed.

  3. #3
    Registered User
    Join Date
    Mar 2012
    Posts
    60

    Re: Call CAknViewAppUi from CCoeControl

    thanks! got it working! ...was definately too late...

  4. #4
    Super Contributor
    Join Date
    Oct 2007
    Location
    જુનાગઢ - India
    Posts
    3,034

    Re: Call CAknViewAppUi from CCoeControl

    Since you are using CAknViewAppUi class, you can also directly use macro iAvkonViewAppUi (Defined in AknViewAppUi.h) to access pointer to base AppUi class. Then just cast it to your own type.

Similar Threads

  1. Closing a CAknViewAppUi dialog
    By danirridescent in forum Symbian User Interface
    Replies: 5
    Last Post: 2007-09-25, 14:49
  2. [S60 3rd] CAknViewAppUi::ViewShown() problem
    By svdwal in forum Series 40 & S60 Platform Feedback Archive
    Replies: 0
    Last Post: 2006-08-04, 10:44
  3. CAknViewAppUi::AddViewL documentation
    By josefaichhorn in forum Symbian User Interface
    Replies: 3
    Last Post: 2005-12-15, 12:19
  4. Replies: 2
    Last Post: 2004-04-23, 06:53
  5. Class CAknAppUi vs CAknViewAppUi
    By NavaronSoftware in forum Symbian
    Replies: 3
    Last Post: 2004-02-08, 06:18

Posting Permissions

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