Self-painted menu

zhaozj2021-02-17  73

Self-painted menu

Self-painted menu

A CCustomMmenu is provided here, which is a subclass of CMenu and has self-painting capabilities. It can provide you with the following features:

Set the font color.

Set high brightness colors.

Set the style of high brightness.

Set the icon that is selected and in a menu in a normal state.

Set the display icon size.

The structure Menudata is defined in the CCustomU, you must fill this structure according to your needs, and provide the pointer to the structure (call Appendmenu, InsertMenu) when adding menus. Below is an example:

1. Define the instance of CCUSTomMenu, and Menudata structural variables.

CCustomMMmenu M_CCUSTommenu;

Menudata Menudata [8]; // AS Many Menu Items Are Present, You Should Be Able To Use

// new and do the same

2. Call the createMenu () Set the relevant parameters.

m_customMenu.createMenu ();

M_CustomMenu.seticonsize (25, 25); // this is to set the size of the icon.

// this sales be used only overce for any menu

// in Order To Resize It, Destroy and Create The Menu Again with Different Size.

m_customMenu.SethighlightStyle (Normal); // or textonly, if you want the

// Background Color to Remain The Same

//

转载请注明原文地址:https://www.9cbs.com/read-31492.html

New Post(0)