×

Discussion Board

Results 1 to 7 of 7
  1. #1
    Regular Contributor
    Join Date
    May 2009
    Posts
    197

    How to add radio buttons on the emulator screen

    Hi

    I have done radio buttons on the menus. Now I want to create the same radio buttons on the screen. Can anyone help me with some logic or samples.

  2. #2
    Regular Contributor
    Join Date
    May 2009
    Posts
    197

    Re: How to add radio buttons on the emulator screen

    Anyone with some help

  3. #3
    Regular Contributor
    Join Date
    May 2009
    Posts
    197

    Re: How to add radio buttons on the emulator screen

    This is quite frustating ....Is there no one who can help me out with some sample programs...I am new to symbian and still in the learning phase.

  4. #4
    Registered User
    Join Date
    Jan 2009
    Posts
    3

    Re: How to add radio buttons on the emulator screen

    Quote Originally Posted by anup007star View Post
    Hi

    I have done radio buttons on the menus. Now I want to create the same radio buttons on the screen. Can anyone help me with some logic or samples.
    You can simply use enumerated text. Use the following links to get some idea.
    http://wiki.forum.nokia.com/index.ph..._Popup_Example

  5. #5
    Registered User
    Join Date
    Jul 2009
    Posts
    48

    Re: How to add radio buttons on the emulator screen

    Quote Originally Posted by anup007star View Post
    Hi

    I have done radio buttons on the menus. Now I want to create the same radio buttons on the screen. Can anyone help me with some logic or samples.

    // Create listbox
    iListBox = new (ELeave) CAknSingleGraphicStyleListBox(); // markable
    // Construct listbox
    iListBox->ConstructL(this, EAknListBoxMultiselectionList
    | EAknListBoxLoopScrolling );
    iListBox->SetContainerWindowL(*this);
    // Set scrollbars
    iListBox->CreateScrollBarFrameL(ETrue);
    iListBox->ScrollBarFrame()->SetScrollBarVisibilityL(
    CEikScrollBarFrame::EOn, CEikScrollBarFrame::EAuto);

    // Create listbox item array
    CDesCArrayFlat* iListBoxItems = new (ELeave) CDesCArrayFlat(8);
    iListBoxItems->AppendL(_L("1\titem 1"));
    iListBoxItems->AppendL(_L("1\titem 2"));
    iListBoxItems->AppendL(_L("1\titem 3"));


    // Add items to listbox
    iListBox->Model()->SetItemTextArray(iListBoxItems);
    // Listbox deletes the item array
    iListBox->Model()->SetOwnershipType(ELbmDoesNotOwnItemArray);//ELbmDoesNotOwnItemArray,ELbmOwnsItemArray
    iListBox->HandleItemAdditionL();
    //move the text (legth is more)
    iListBox->ItemDrawer()->ColumnData()->EnableMarqueeL(ETrue);
    //Scrolling
    iListBox->SetFocus(ETrue);
    iFocusControl = iListBox;
    // Add icons to listbox
    AddCheckboxIconsL();
    // Activate Listbox
    iListBox->SetRect(Rect());
    iListBox->ActivateL();




    void AddCheckboxIconsL()
    {
    CAknIconArray* iconArray = new (ELeave) CAknIconArray(1);
    CleanupStack::PushL(iconArray);
    CFbsBitmap* checkboxOnBitmap = NULL;
    CFbsBitmap* checkboxOnBitmapMask = NULL;
    CFbsBitmap* checkboxOffBitmap = NULL;
    CFbsBitmap* checkboxOffBitmapMask = NULL;

    //CListItemDrawer is using this logical color as default for its marked icons
    TRgb defaultColor;
    defaultColor = CEikonEnv::Static()->Color(EColorControlText);

    AknsUtils::CreateColorIconLC(AknsUtils::SkinInstance(),
    KAknsIIDQgnPropCheckboxOff, KAknsIIDQsnIconColors,
    EAknsCIQsnIconColorsCG13, checkboxOnBitmap, checkboxOnBitmapMask,
    KAvkonBitmapFile, EMbmAvkonQgn_indi_radiobutt_on,
    EMbmAvkonQgn_indi_radiobutt_on_mask, defaultColor);
    CGulIcon* checkboxOnIcon = CGulIcon::NewL(checkboxOnBitmap,
    checkboxOnBitmapMask);
    CleanupStack::Pop(2); // checkboxOnBitmap, checkboxOnBitmapMask
    CleanupStack::PushL(checkboxOnIcon);
    iconArray->AppendL(checkboxOnIcon);

    AknsUtils::CreateColorIconLC(AknsUtils::SkinInstance(),
    KAknsIIDQgnPropCheckboxOff, KAknsIIDQsnIconColors,
    EAknsCIQsnIconColorsCG13, checkboxOffBitmap, checkboxOffBitmapMask,
    KAvkonBitmapFile, EMbmAvkonQgn_indi_radiobutt_off,
    EMbmAvkonQgn_indi_radiobutt_off_mask, defaultColor);

    CGulIcon* checkboxOffIcon = CGulIcon::NewL(checkboxOffBitmap,
    checkboxOffBitmapMask);
    CleanupStack::Pop(2); // checkboxOffBitmap, checkboxOffBitmapMask
    CleanupStack::PushL(checkboxOffIcon);
    iconArray->AppendL(checkboxOffIcon);

    iListBox->ItemDrawer()->ColumnData()->SetIconArray(iconArray);

    // checkboxOffIcon, checkboxOnIcon, iconArray
    CleanupStack::Pop(3);
    }

  6. #6
    Nokia Developer Moderator
    Join Date
    Jan 2008
    Location
    Moscow, Russia
    Posts
    3,347

    Re: How to add radio buttons on the emulator screen

    Also you can check this code snippet - Creating a radio button settings page
    and also check Settings Screen Example.

  7. #7
    Regular Contributor
    Join Date
    May 2009
    Posts
    197

    Re: How to add radio buttons on the emulator screen

    I have done the same way chinnu but the problem is that in radio button only one element should be on and when i should click onthe next element then the earlier one should be off and the clicked one should be on. This is not happening with this code. Is there any other way.This code works fine for check box.

Similar Threads

  1. radio buttons in form
    By frizi in forum Symbian User Interface
    Replies: 3
    Last Post: 2009-04-14, 11:42
  2. How to Add buttons....?
    By nandi1225 in forum Symbian
    Replies: 4
    Last Post: 2008-04-16, 11:57
  3. How to add buttons to form like S40?
    By adaromas in forum Mobile Java Media (Graphics & Sounds)
    Replies: 1
    Last Post: 2007-11-02, 05:50
  4. Multiple Radio Button Groups not working.
    By jonesdk in forum Browsing and Mark-ups
    Replies: 2
    Last Post: 2007-01-17, 19:07
  5. Replies: 2
    Last Post: 2006-12-13, 06:52

Posting Permissions

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