×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    May 2003
    Posts
    8

    Create dialog like control with softkeys

    Hello
    I'm trying to construct a dialog like control but with somewhat different characteristics. I want the CoeControl to show up without having to put it in it's own view. The problem I have is that I can't make the Sofkkeys to show up. If I draw something it shows up, but not the softkeys. As I understand it, these should be created with CEikButtonGroupContainer. This is what I do in the ConstructL of my CoeControl.

    void
    CIncomingCallContainer::ConstructL()
    {
    CEikAppUi* appUi = iEikonEnv->EikAppUi();

    CreateWindowL();

    iButtonBar =
    CEikButtonGroupContainer::NewL(CEikButtonGroupContainer::EDialog,
    CEikButtonGroupContainer::EHorizontal,
    this, 0, *this);

    iButtonBar->SetCommandSetL(R_A_CBA); // cba resource
    iButtonBar->MakeVisible(ETrue);

    appUi->AddToStackL(iButtonBar, ECoeStackPriorityDialog);

    SetRect(appUi->ClientRect());
    ActivateL();
    }

    I also have CountComponentControls , ComponentControl and a SizeChanged functions. I have tried many different variations. CEikButtonGroupContainer also has a NewL that takes a WindowGroup as an argument instead of a CoeControl for example. If anyone has used CEikButtonGroupContainer (that is has created and used it) and could give a short explanation, I would very much appreciate it. Maybe the problem isn't with the buttons but has something to do with the relationship between views and coecontrols that I haven't understood.

    Best regards
    Robert Andersson

  2. #2
    Regular Contributor
    Join Date
    Apr 2003
    Posts
    58

    Using controls without views.

    You've asked a number of questions here, I'll try to answer a few of them. First, there's no problem with using CCoeControl objects without using views. That is one of several architecture 'styles' that can be used, and it's been working well for me for the past few weeks.

    If you've implemented CountComponentControls(), ComponentControl() and SizeChanged() then I think you should be fine. I've also called SetContainerWindowL() on the component controls but I think I read that that is redundent if the component controls are returned from the ComponentControl() method.

    As for setting your CBA, I had some trouble there as well. Try using the following statements instead:

    CEikButtonGroupContainer* cba = CEikButtonGroupContainer::Current();
    cba->SetCommandSetL( R_YOUR_CBA );
    cba->DrawDeferred();

    Hope that helps.

    -c

  3. #3
    Registered User
    Join Date
    May 2003
    Posts
    8

    It works but...

    Thanks for the answer.

    It works much better now with CEikButtonGroupContainer::Current(), but this interferes with the buttons in the current view. I want this container to interfere as little as possible with the rest of the program.

    It should be possible to create a new CEikButtonGroupContainer, but this seems harder than expected. There must be something in the initialization that is missing or plain wrong. The EikDialog class contains a CEikButtonGroupContainer. I guess that what I want to do is something similar to what this class do.

    Best regards
    Robert Andersson

  4. #4
    Regular Contributor
    Join Date
    Apr 2003
    Posts
    58
    What do you mean by "interferes with the buttons in the current view"?

  5. #5
    Registered User
    Join Date
    May 2003
    Posts
    8

    what I mean...

    The rest of my application uses the AvkonView framework. If I change the current cba in the popup dialog by changing CEikButtonGroupContainer::Current, the cba of the the current view is affected. That is, when I delete the popup, the soft buttons from the popup remains.

    What I wan't to do is popup the dialog and then delete it. When I delete it, the cba of the other views should be unaffected.

    An alternative is of course to restore the commandset to what it was before I called SetCommandSetL, but I haven't found a way to get the cba from a CEikButtonGroupContainer and store it. There seems to be no GetCommandSet() function.

    Best regards
    Robert Andersson

Posting Permissions

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