×

Discussion Board

Results 1 to 12 of 12

Hybrid View

  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,004

    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();
    }

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
  •  
×