Module Documentation
FM4, S6E2DH/S6E2DF/S6E2D5/S6E2D3 Series, 32-Bit Microcontroller, Graphic Driver User Manual, Doc. No. 002-04387 Rev. *A
189
11.27
CMenu
Data Structures
class CMenu
11.27.1 Detailed Description
The classes in this group realize a simple menu. It can be used with an 2D core display layer for demo applications
to allow selections, switches and similar operations with a minimum keys.
Sample code:
CMenu menu;
menu.Open(display, 0, 0, 320, 240, MML_GDC_DISP_LAYER_4, MML_GDC_DISP_SUB_LAYER_DEFAULT, 0,
MML_GDC_DISP_BLEND_SOURCE_ALPHA | MML_GDC_DISP_BLEND_SOURCE_MULTIPLY_ALPHA);
menu.InitMenu(Font_ttf, sizeof(Font_ttf), 16);
menu.Insert(0, MENU_LL, CMenu::MENU_FLAG_CHECKBOX , L"This is a check box menu");
menu.Insert(MENU_LL, MENU_FONT, 0, L"Font");
menu.Insert(MEN 0, MEN 1, CMenu::MENU_FLAG_POPUP | CMenu::MENU_FLAG_RADIO |
CMenu::MENU_FLAG_ISCHECKED, L"Font 1");
menu.Insert(MEN i, MEN i + 1, CMenu::MENU_FLAG_RADIO , L"Font 2");
while
(bRunning)
{
key = menu.HandleKey(GetLastKeyStroke());
switch
(key()
{
...
}
menu.Draw();
//draw other things
...
}