Syntax
typedef struct{
int MenuForeColor;
int MenuDisabledForeColor;
int MenuBackColor;
int NumberOfColorPalette;
pAM_ColorPalette ColorPalettes;
int OptionFlag;
unsigned int DefaultFont;
int DefaultLineSpacing;
int SpecialKey1;
int SpecialKey2;
unsigned int SpecialKeyHoldTime;
} AM_Option, *pAM_Option;
Members
- MenuForeColor
-
Specify the default value of character color.
- MenuDisabledForeColor
-
Specify the character color of disabled menu items. (enabled attribute of the AM_MenuItem structure is false)
- MenuBackColor
-
Specify the default value of the background color.
This will be referenced when:- Background color of the area where the menu item is not placed.
- Background color of controls such as check boxes, radio buttons, and icons.
- Background color of disabled menu item. (enabled attribute of the AM_MenuItem structure is false)
- NumberOfColorPalette
-
Specify the number of elements in the array of AM_ColorPalette structures specified in ColorPalettes.
- ColorPalettes
- Specifies a pointer to an array of AM_ColorPalette structures.
- OptionFlag
-
Specifies the logical sum of the following option flag values.
Value Description AM_ALLOW_AUTOREPEAT Enables auto repeat for the [Q1] and [Q2] keys. AM_USE_SPECIAL_KEY Enable special key operation. When this flag is specified, each SpecialKey1, SpecialKey2, and SpecialKeyHoldTime members will be valid. AM_NO_CLEAR Does not clear the screen when displaying the menu. AM_ALLOW_ROUND_UP In the list display, press the [Q1] key to move to the last line when the focus is on the first line of the list, and press the [Q2] key to move to the first line when the focus is on the last line of the list. AM_NO_SCROLL_BAR Does not display scroll bars in the list area. AM_LIST_PAINT_BGCOLOR When displaying a line in the list display, a radio button, checkbox, or blank background from the end of the text to the end of the line is drawn with the background color specified for that line. By default, it is drawn with the background color specified by MenuBackColor of AM_Option structure.
(Ver. 1.5.0 or later)AM_THICK_SCROLL_BAR When the scroll bar is displayed in the list area, it is drawn with a 2-dot red line. By default, a 1-dot line of the color specified by MenuForeColor of AM_Option structure is drawn.
(Ver. 1.5.0 or later)
- DefaultFont
-
Specify the default font with one of the following values.
Value Description MEDIUM_FONT MEDIUM_FONT is the default font. LARGE_FONT MEDIUM_FONT is the default font. HUGE_FONT LARGE_FONT is the default font. 0 No font is specified. (The default font is MEDIUM_FONT.)
- DefaultLineSpacing
-
Specify the number of pixels between lines. (Default value is 1 pixel.)
- SpecialKey1, SpecialKey2
-
Specify the key for special key operation with the following values.
Value Description NUM0_KEY [0] key NUM1_KEY [1] key NUM2_KEY [2] key NUM3_KEY [3] key NUM4_KEY [4] key NUM5_KEY [5] key NUM6_KEY [6] key NUM7_KEY [7] key NUM8_KEY [8] key NUM9_KEY [9] key SCAN_KEY [SCAN] key Q1_KEY [Q1] key Q2_KEY [Q2] key BS_KEY [BS] key CLR_KEY [CLEAR] key ENT_KEY [ENT] key SHIFT_KEY [SHIFT] key DOT_KEY [.] key F1_KEY [F1] key F2_KEY [F2] key F3_KEY [F3] key
- SpecialKeyHoldTime
- When performing special key operation, specify the time to hold down the key in milliseconds. If you hold down the keys specified in SpecialKey1 and SpecialKey2 at the same time for a specified time or longer, the AMENU_SPECIAL_KEY event will be issued.
Remarks
You can specify options in this structure when generating the menu resource with AM_CreqateMenu function or AL_CreateList function.When each function of the AdvancedMenu library changes the setting of OS's character color and the background color, the character color and background color are changed to MenuForeColor and MenuBackColor respectively before those functions return to the application.
The default option values are:
static const AM_ColorPalette default_color_palettes[] = {
//ForeColor, BackColor, Select_ForeColor, Select_BackColor, Control_ForeColor
{0x000000, 0xffffff, 0x000000, RGB_GREEN, 0x000000}
};
static const AM_Option default_menu_option = {
0x000000, //MenuForeColor
0xb0b0b0, //MenuDisabledForeColor
0xffffff, //MenuBackColor
1, //NumberOfColorPalette
(pAM_ColorPalette)default_color_palettes, //array of AM_ColorPalette
0, //Options
MEDIUM_FONT, //DefaultFont
1, //DefaultLineSpacing
0, //SpecialKey1
0, //SpecialKey2
0 //SpecialKeyHoldTime
};
Requirements
Header file:
lib.h
AdvancedMenu.h
See also
Last updated: 2021/06/03