zoukankan      html  css  js  c++  java
  • symbian 列表查询对话框

    前段时间做东西用到的,截图是UC桌面的,实现之后效果和他的一样

    系统的列表查询对话框

    code:

    CAknSinglePopupMenuStyleListBox* list = new(ELeave) CAknSinglePopupMenuStyleListBox;
    CleanupStack::PushL(list); // Create popup list and PUSH it. 创建弹出列表和推。
    CAknPopupList* popupList = CAknPopupList::NewL(list, R_AVKON_SOFTKEYS_OK_BACK, AknPopupLayouts::EMenuWindow);
    CleanupStack::PushL(popupList); // initialize listbox.
    list->ConstructL(popupList, CEikListBox::ELeftDownInViewRect);
    //创建滚动条
    list->CreateScrollBarFrameL(ETrue);
    list->ScrollBarFrame()->SetScrollBarVisibilityL(CEikScrollBarFrame::EOff, CEikScrollBarFrame::EAuto);
    //显示列表项
    _LIT(KListItemFormat, "%S"); _LIT(KFirstItem, "First item");
    _LIT(KNextItem, "This is a very long string used for the next item");
    _LIT(KLastItem, "Last item"); // construct listbox item array
    CDesCArray *itemList = new (ELeave) CDesCArrayFlat(3);
    TBuf<100> item; // first listbox item
    item.Format(KListItemFormat, &KFirstItem());
    itemList->AppendL(item); // next listbox item
    item.Format(KListItemFormat, &KNextItem());
    itemList->AppendL(item); // last listbox item
    item.Format(KListItemFormat, &KLastItem());
    itemList->AppendL(item); // set items and ownership
    list->Model()->SetItemTextArray(itemList);
    list->Model()->SetOwnershipType(ELbmOwnsItemArray);
    // enable marquee effect for long strings 启用长字符串选取框的影响
    list->ItemDrawer()->FormattedCellData()->EnableMarqueeL( ETrue );
    // Set title 设置标题
    popupList->SetTitleL(_L("Scrollable items"));
    // Show popup list.
    CleanupStack::Pop();
    popupList->EnableFind();
    // popuplist
    TBool popupOk = popupList->ExecuteLD();
    if(popupOk)
    {
    // do something
    }
    else
    {
    // do something else
    }
    CleanupStack::PopAndDestroy(); // list

    123.jpg (9.49 KB)

    123.jpg

  • 相关阅读:
    linux下的crontab定时执行任务命令详解
    494. Target Sum
    347. Top K Frequent Elements
    5. Longest Palindromic Substring
    时间复杂度计算方法
    62. Unique Paths
    54. Spiral Matrix && 59. Spiral Matrix II
    57. Insert Interval
    53. Maximum Subarray
    42.Trapping rain water
  • 原文地址:https://www.cnblogs.com/yaoliang11/p/1848654.html
Copyright © 2011-2022 走看看