Confirmation key pop-up menu

Source: Internet
Author: User

One-step usage of the dynamic pop-up menu by pressing the validation key in the container is:

Tkeyresponse ccontextmenucontainer: offerkeyeventl (const tkeyevent & akeyevent, teventcode Atype)
{
 
// If the select key (OK key in emulator) is pressed, show the context sensitive Menu
Tbool selectkeypressed = (Atype = eeventkey) & (akeyevent. icode = ekeyok );
Tbool savedgamelistnotempty = (isavedgameslistbox) & (isavedgameslistbox-> model ()-> numberofitems ()> 0 );

If (selectkeypressed & savedgamelistnotempty)
{

// Get the menu bar from the parent of this control.
Ceikmenubar * parentmenubar = ieikonenv-> appuifacloud ()-> menubar ();

// Set the menu bar to the context-sensitive Menu Bar
Parentmenubar-> setmenutitleresourceid (r_contextmenu_saved_games_menu_bar );

// Try to display the context sensitive Menu Bar
If (parentmenubar)
{
Parentmenubar-> trydisplaymenubarl ();
}

// Change The Menu Bars resource to the normal menu bar so that the Left softkey displays
// The correct menu

Parentmenubar-> setmenutitleresourceid (r_contextmenu_menu_bar );

Return ekeywasconsumed;
}

// Otherwise, offer the key to The ListBox to process.
Else
Return isavedgameslistbox-> offerkeyeventl (akeyevent, Atype );
}

Ceikmenubar * parentmenubar = ieikonenv-> appuifacloud ()-> menubar ();
At the beginning, there was no problem in the container mode. In view + container mode, an error occurs. parentmenubar is a null pointer. The solution is as follows: Pass the view pointer to container and replace the preceding statement

Ceikmenubar * parentmenubar = iparentview-> menubar ();

.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.