source: xtideuniversalbios/trunk/Assembly_Library/Inc/MenuEvents.inc @ 390

Last change on this file since 390 was 198, checked in by gregli@…, 12 years ago

Fixing a bug in the configurator with user entry of word values into dialogs, introduced with the idle processing optimization in r189.

File size: 3.3 KB
RevLine 
[41]1; File name     :   MenuEvents.inc
2; Project name  :   Assembly Library
3; Created date  :   13.7.2010
[58]4; Last update   :   18.10.2010
[41]5; Author        :   Tomi Tilli
6; Description   :   Defines for Menu events send to the user.
7%ifndef MENUEVENTS_INC
8%define MENUEVENTS_INC
9
10;--------------------------------------------------------------------
11; Events to be processed in user implemented handler.
12;   Common parameters for all events:
13;       BX:         Menu event (anything from MENUEVENT struct)
14;       SS:BP:      Menu library handle
15;   Common return values for all events:
16;       CF:         Set if event processed
17;                   Cleared if event not processed
18;   Corrupts registers:
19;       All
20;--------------------------------------------------------------------
[183]21
22;
23; There are two ways to use MENUEVENT:
24;
25; 1. If the program needs two different menus, include the definition of the MENUEVENT structure below,
26;    instantiate with members that point to the routines that make up the menu.
27;
28; 2. If the program needs only one menu, %define MENUEVENT_INLINE_OFFSETS before this include file,
29;    and define (through EQU statements) each of the entry points as offsets from a base address. 
[198]30;
31
[183]32;
[198]33; If user level idle processing is desired, %define this symbol and .IdleProcessing will be called.
34; Otherwise, the code and structure entry will be omitted.  Note that INCLUDE_MENU_DIALOGS requires
35; the idle processing (if that is the case, it is turned on here).
36;
37;%define MENUEVENT_IDLEPROCESSING_ENABLE
38;
[183]39
[198]40%ifdef INCLUDE_MENU_DIALOGS
41%define MENUEVENT_IDLEPROCESSING_ENABLE
42%endif
43
[183]44%ifndef MENUEVENT_INLINE_OFFSETS
45
[41]46struc MENUEVENT
47    ; Parameters:
48    ;   DS:SI:      Ptr to MENUINIT struct to initialize
49    ; Returns:
50    ;   DS:SI:      Ptr to initialized MENUINIT struct
51    .InitializeMenuinitFromDSSI     resb    2
[183]52%define MENUEVENT_InitializeMenuinitFromDSSI MENUEVENT.InitializeMenuinitFromDSSI
[41]53
54    ; Parameters:
55    ;   None
[58]56    ; Returns:
57    ;   CF:         Set to exit menu
58    ;               Clear to cancel exit
[41]59    .ExitMenu                       resb    2
[183]60%define MENUEVENT_ExitMenu MENUEVENT.ExitMenu
[41]61
[198]62%ifdef MENUEVENT_IDLEPROCESSING_ENABLE
[41]63    ; Parameters:
64    ;   None
[189]65    ; See the definition of MENUEVENT_IDLEPROCESSING_ENABLE below.
[41]66    .IdleProcessing                 resb    2
[183]67%define MENUEVENT_IdleProcessing MENUEVENT.IdleProcessing
[198]68%endif
[41]69
70    ; Parameters:
71    ;   CX:         Index of new highlighted item
72    ;   DX:         Index of previously highlighted item or NO_ITEM_HIGHLIGHTED
73    .ItemHighlightedFromCX          resb    2
[183]74%define MENUEVENT_ItemHighlightedFromCX MENUEVENT.ItemHighlightedFromCX
[41]75
76    ; Parameters:
77    ;   CX:         Index of selected item
78    .ItemSelectedFromCX             resb    2
[183]79%define MENUEVENT_ItemSelectedFromCX MENUEVENT.ItemSelectedFromCX
[41]80
81    ; Parameters:
82    ;   AL:         ASCII character for the key
83    ;   AH:         Keyboard library scan code for the key
84    .KeyStrokeInAX                  resb    2
[183]85%define MENUEVENT_KeyStrokeInAX MENUEVENT.KeyStrokeInAX
[41]86
87    ; Parameters:
[48]88    ;   CX:         Index of highlighted item
89    ;   Cursor has been positioned to the beginning of first line
[41]90    .RefreshTitle                   resb    2
91    .RefreshInformation             resb    2
[183]92%define MENUEVENT_RefreshTitle MENUEVENT.RefreshTitle
93%define MENUEVENT_RefreshInformation MENUEVENT.RefreshInformation
[41]94
95    ; Parameters:
96    ;   CX:         Index of item to refresh
97    ;   Cursor has been positioned to the beginning of item line
98    .RefreshItemFromCX              resb    2
[183]99%define MENUEVENT_RefreshItemFromCX MENUEVENT.RefreshItemFromCX
[41]100endstruc
101
[183]102%endif ; MENUEVENTS_INLINE_OFFSETS
[41]103
104%endif ; MENUEVENTS_INC
Note: See TracBrowser for help on using the repository browser.