×

Discussion Board

Results 1 to 12 of 12
  1. #1
    Nokia Developer Champion
    Join Date
    Dec 2008
    Posts
    2,356

    Hide/ Un-Hide CBA Button

    Hi,
    I am trying to hide and un-hide the cba button during run time.
    The code below helps me to hide the cba button
    Code:
      CEikButtonGroupContainer*  cba = CEikButtonGroupContainer::Current();
         cba->MakeVisible( EFalse );
    But if I use
    Code:
      CEikButtonGroupContainer*  cba = CEikButtonGroupContainer::Current();
        cba->MakeVisible( ETrue );
    I am not able to unhide the cba button


    Please suggest me.

  2. #2
    Nokia Developer Champion
    Join Date
    Jun 2008
    Location
    Noida,India
    Posts
    4,033

    Re: Hide/ Un-Hide CBA Button

    may be you need to use :

    cba->MakeVisible( ETrue );
    cba->DrawDeferred or cba->DrawNow

  3. #3
    Nokia Developer Champion
    Join Date
    Dec 2008
    Posts
    2,356

    Re: Hide/ Un-Hide CBA Button

    Quote Originally Posted by vineet.jain View Post
    may be you need to use :

    cba->MakeVisible( ETrue );
    cba->DrawDeferred or cba->DrawNow
    I tried that and getting Kern_exec 3
    Code:
      CEikButtonGroupContainer* myCba = CEikButtonGroupContainer::Current();
    
        CleanupStack::PushL( myCba );
    
        myCba->SetCommandSetL( R_CUSTOM_CBA1  );
    
        myCba->MakeVisible( ETrue );
    
        myCba->DrawDeferred();
    
        CleanupStack::Pop();  // myCba

  4. #4
    Registered User
    Join Date
    Apr 2009
    Posts
    14

    Re: Hide/ Un-Hide CBA Button

    One way is to get CBA buttons through the CAknAppUi::Cba() function and then call CEikButtonGroupContainer's MakeVisible() .

    Another way is to create a full-screen application, like described here http://wiki.forum.nokia.com/index.ph...ymbian_C%2B%2B and here http://wiki.forum.nokia.com/index.ph...de_on_touch_UI And change from full-screen mode to a windowed one when you need it.

  5. #5
    Nokia Developer Champion
    Join Date
    Dec 2008
    Posts
    2,356

    Re: Hide/ Un-Hide CBA Button

    Quote Originally Posted by axsm View Post
    One way is to get CBA buttons through the CAknAppUi::Cba() function and then call CEikButtonGroupContainer's MakeVisible() .

    Another way is to create a full-screen application, like described here http://wiki.forum.nokia.com/index.ph...ymbian_C%2B%2B and here http://wiki.forum.nokia.com/index.ph...de_on_touch_UI And change from full-screen mode to a windowed one when you need it.
    I am trying to hide the softkey while loading the app, and it worked perfect
    I did this way
    appui.cpp
    Code:
    ConstructL()
    {
    ...
    Cba()->MakeVisible(EFalse); 
    ...
    When I try to display the softkey in run time , i called the function , but nothing happens. I can't see the softkey, no responce at all.
    appui.cpp
    Code:
    ChangeOrientation()
    	  {
    	  Cba()->MakeVisible(ETrue);
    }
    could you please help me to enable the hidden softkey?

    Please suggest me.
    Last edited by somnathbanik; 2011-02-18 at 09:08. Reason: added

  6. #6
    Registered User
    Join Date
    Apr 2009
    Posts
    14

    Re: Hide/ Un-Hide CBA Button

    Well, if you still prefer a CBA-based solution, try the following:

    #include <avkon.rsg> // include this to use R_AVKON_SOFTKEYS_EMPTY
    #include <eikbtgpc.h>

    ...

    // Disable CBA buttons
    CEikButtonGroupContainer* cba = CEikButtonGroupContainer::Current(); // or CAknAppUi::Cba()

    if ( cba != NULL )
    {
    cba->SetCommandSetL( R_AVKON_SOFTKEYS_EMPTY );
    cba->DrawNow();
    }

  7. #7
    Nokia Developer Champion
    Join Date
    Dec 2008
    Posts
    2,356

    Re: Hide/ Un-Hide CBA Button

    Quote Originally Posted by axsm View Post
    Well, if you still prefer a CBA-based solution, try the following:

    #include <avkon.rsg> // include this to use R_AVKON_SOFTKEYS_EMPTY
    #include <eikbtgpc.h>

    ...

    // Disable CBA buttons
    CEikButtonGroupContainer* cba = CEikButtonGroupContainer::Current(); // or CAknAppUi::Cba()

    if ( cba != NULL )
    {
    cba->SetCommandSetL( R_AVKON_SOFTKEYS_EMPTY );
    cba->DrawNow();
    }
    I can disable teh cba button but after disabling if I want to enable its not working, I need to enable the disabled cba button

  8. #8
    Registered User
    Join Date
    Apr 2009
    Posts
    14

    Re: Hide/ Un-Hide CBA Button

    Quote Originally Posted by somnathbanik View Post
    I can disable teh cba button but after disabling if I want to enable its not working, I need to enable the disabled cba button
    I guess in this case the sequence of steps will be just the same, except that you'll be using your own softkey resource:

    if ( enableButtons )
    {
    cba->SetCommandSetL( R_YOUR_APPLICATION_CBA_BUTTONS_SET );
    cba->DrawNow();
    }
    else
    {
    cba->SetCommandSetL( R_AVKON_SOFTKEYS_EMPTY );
    cba->DrawNow();
    }

  9. #9
    Nokia Developer Champion
    Join Date
    Dec 2008
    Posts
    2,356

    Re: Hide/ Un-Hide CBA Button

    Quote Originally Posted by axsm View Post
    I guess in this case the sequence of steps will be just the same, except that you'll be using your own softkey resource:

    if ( enableButtons )
    {
    cba->SetCommandSetL( R_YOUR_APPLICATION_CBA_BUTTONS_SET );
    cba->DrawNow();
    }
    else
    {
    cba->SetCommandSetL( R_AVKON_SOFTKEYS_EMPTY );
    cba->DrawNow();
    }
    I tried this way
    Appui.cpp
    Code:
    Constl()
    {
    ...
      CEikButtonGroupContainer* cba =  CAknAppUi::Cba();
        if ( cba != NULL )
        {
        cba->SetCommandSetL( R_AVKON_SOFTKEYS_EMPTY );
        cba->MakeVisible( EFalse );
         cba->DrawNow();
        }
        
    ...
    the above code helps me to display the app in full screen when it starts. Now at a sertain point of time when the app is running I want to display the menu bar. do I did in this way
    Code:
    void CMusicalAlarmAppUi::ShowMenuBar()
    	{
    	
    CEikButtonGroupContainer* cba =  CAknAppUi::Cba();
    
    	    if ( cba != NULL )
    	    {
    	    cba->SetCommandSetL( R_AVKON_SOFTKEYS_OPTIONS_EXIT );
    	    cba->MakeVisible( ETrue );
    	     cba->DrawNow();
    	    }
    
    	
    	
    				   	}
    but not able to display the menu bar.
    Any one please suggest me. I am trying this for a long time.
    Last edited by somnathbanik; 2011-03-22 at 09:12. Reason: added

  10. #10
    Nokia Developer Champion
    Join Date
    Jun 2008
    Location
    Noida,India
    Posts
    4,033

    Re: Hide/ Un-Hide CBA Button

    May be you might have to put the code for a particular view to hide/un-hide its cba keys, try like this:


    CEikButtonGroupContainer* cba = CEikButtonGroupContainer::Current();
    if (cba != NULL) {
    cba->SetCommandSetL( R_AVKON_SOFTKEYS_OPTIONS_EXIT );
    cba->MakeVisible( ETrue );
    cba->DrawDeferred();
    }

    put the above code in some function in the view class in which you want to un-hide the cba keys.

  11. #11
    Nokia Developer Champion
    Join Date
    Dec 2008
    Posts
    2,356

    Re: Hide/ Un-Hide CBA Button

    Quote Originally Posted by vineet.jain View Post
    May be you might have to put the code for a particular view to hide/un-hide its cba keys, try like this:


    CEikButtonGroupContainer* cba = CEikButtonGroupContainer::Current();
    if (cba != NULL) {
    cba->SetCommandSetL( R_AVKON_SOFTKEYS_OPTIONS_EXIT );
    cba->MakeVisible( ETrue );
    cba->DrawDeferred();
    }

    put the above code in some function in the view class in which you want to un-hide the cba keys.

    I don't know why its not working for me. even I create a function in my view class and paste the code there. Any way i did rather differently
    First i set SetExtentToWholeScreen(); to make the full screen and at a particular point I call this function below
    Code:
    void CMusicalAlarmContainer::SetWindow()
    	{
    	TRect aRect;
    	SetRect(TRect(TPoint(0,0),TPoint(360,580)));
    	   // SetRect(aRect);
    	    ActivateL();
    	}

    This way i could make it done. I would like to know is this a write process , I am targeting 5th edition and S^3 device

  12. #12
    Registered User
    Join Date
    Feb 2011
    Posts
    338

    Re: Hide/ Un-Hide CBA Button

    use
    /*
    Make it visible at first as others suggested
    */
    cba->drawableWindow()->setOrdinalPosition(0);
    cba->drawnow();

Similar Threads

  1. Replies: 2
    Last Post: 2010-02-10, 06:08
  2. Hide/Show CBA
    By m4a127 in forum Symbian User Interface
    Replies: 0
    Last Post: 2008-12-04, 10:47
  3. How to hide the CBA?? StatusPane can be hide, how about CBA???
    By Nokia_Archive in forum Mobile Java General
    Replies: 1
    Last Post: 2002-05-24, 13:13

Posting Permissions

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