home *** CD-ROM | disk | FTP | other *** search
- ;/*------------------------------------------------------------------*/
- ;/* ACTMENU.ASM */
- ;/*------------------------------------------------------------------*/
- ;/* API ▒` ªí : 1. StartUp() ( in addmenu.asm ) */
- ;/* 2. ShutDown() ( in addmenu.asm ) */
- ;/* ╜s─╢╗P│s╡▓ : makeasm actmenu */
- ;/* (¬■╡∙: makeasm.bat ñw¬■⌐≤╜d¿╥║╧ñ∙ññ) */
- ;/* API ¿τ╝╞└] : actmenu.plb */
- ;/* ⌐IÑsñΦªí : SET LIBRARY TO ACTMENU ( ⌐IÑs StartUp() ) */
- ;/* SET LIBRARY TO ( ⌐IÑs ShutDown() ) */
- ;/*------------------------------------------------------------------*/
-
-
- .MODEL large
- .STACK 0 ; Ñ▓╢╖╡LÑ⌠ª≤º┌¡╠ª█ñv¬║░∩┼|
-
- INCLUDE C:\FOXLCK\H\pro_ext.inc
-
-
- .DATA
-
- PUBLIC _myFoxInfo
- PUBLIC __FoxTable
-
- StartUpName DB "STARTUP", 0
- StartUpParmTypes DB "C", 0
-
- ShutDownName DB "SHUTDOWN", 0
- ShutDownParmTypes DB "C", 0
-
- _myFoxInfo FoxInfo <StartUpName, StartUp, CALLONLOAD, StartUpParmTypes>
- FoxInfo <ShutDownName, ShutDown, CALLONUNLOAD, ShutDownParmTypes>
-
- sizeof_myFoxInfo = $ - _myFoxInfo
-
- __FoxTable FoxTable <0, sizeof_myFoxInfo/TYPE FoxInfo, _myFoxInfo>
-
-
- PadPrompt DB "E\<nvironment" , 0
- Bar1_Prompt DB "\<1.CLOCK ON" , 0
- Bar2_Prompt DB "\<2.CLOCK OFF", 0
- Bar3_Prompt DB "\<3.STATUS ON" , 0
- Bar4_Prompt DB "\<4.STATUS OFF", 0
- NullString DB 0
- Alt1_String DB "Alt+1", 0
- Alt2_String DB "Alt+2", 0
- Alt3_String DB "Alt+3", 0
- Alt4_String DB "Alt+4", 0
- ClockOn DB "SET CLOCK ON" , 0
- ClockOff DB "SET CLOCK OFF" , 0
- StatOn DB "SET STATUS ON" , 0
- StatOff DB "SET STATUS OFF", 0
-
-
- .DATA?
-
-
- SysMenuId DW 2 DUP(?) ;typedef long MENUID
- PopupId DW 2 DUP(?) ;typedef long MENUID
- PadId DW 2 DUP(?) ;typedef long ITEMID
-
-
- .CODE
-
-
- SetClockOn PROC FAR
-
- FarEnter
-
- push ax
- push dx
- ;
- ; _Execute("SET CLOCK ON")
- ;
- mov dx, @data
- mov ax, offset ClockOn
-
- call _Execute
-
- pop dx
- pop ax
-
- FarExit
-
- ret
- SetClockOn ENDP
-
-
-
- SetClockOff PROC FAR
-
- FarEnter
-
- push ax
- push dx
- ;
- ; _Execute("SET CLOCK OFF")
- ;
- mov dx, @data
- mov ax, offset ClockOFF
-
- call _Execute
-
- pop dx
- pop ax
-
- FarExit
-
- ret
- SetClockOff ENDP
-
-
- SetStatOn PROC FAR
-
- FarEnter
-
- push ax
- push dx
- ;
- ; _Execute("SET STATUS ON")
- ;
- mov dx, @data
- mov ax, offset StatOn
-
- call _Execute
-
- pop dx
- pop ax
-
- FarExit
-
- ret
- SetStatOn ENDP
-
-
- SetStatOff PROC FAR
-
- FarEnter
-
- push ax
- push dx
- ;
- ; _Execute("SET STATUS OFF")
- ;
- mov dx, @data
- mov ax, offset StatOff
-
- call _Execute
-
- pop dx
- pop ax
-
- FarExit
-
- ret
- SetStatOff ENDP
-
- StartUp PROC FAR
-
- FarEnter ; bp := sp
- ;
- ; ITEMID Bar1_Id
- ; ITEMID Bar2_Id
- ; ITEMID Bar3_Id
- ; ITEMID Bar4_Id
- ;
- Bar1_Id = -sizeof_ITEMID
- Bar2_Id = Bar1_Id-sizeof_ITEMID
- Bar3_Id = Bar2_Id+Bar1_Id-sizeof_ITEMID
- Bar4_Id = Bar3_Id+Bar2_Id-Bar1_Id-sizeof_ITEMID
-
- sub sp, 4*sizeof_ITEMID
-
- push ax
- push bx
- push cx
- push dx
- push ds
-
- mov ax, @data
- mov ds, ax
- ;
- ; ╝WÑ[ñ@¡╙ÑDÑ\»α┐∩╢╡ (PAD) ª▄ FoxPro ¿t▓╬Ñ\»α¬φ│µñW
- ;
- ; SysMenuId = _MenuId(_SYSMENU)
- ;
- mov ax, _SYSMENU
-
- _MenuId ; dx:ax := _MenuId(ax)
-
- mov [SysMenuId], ax
- mov [SysMenuId+2], dx
-
- ;
- ; PadId = _GetNewItemId(SysMenuId)
- ;
- _GetNewItemId ; dx:ax := _GetNewItemId(dx:ax)
-
- mov [PadId], ax
- mov [PadId+2], dx
- ;
- ; if (_NewItem(SysMenuId, PadId, _LASTITEM, "E\\<nvironment"))
- ; {
- ; _Error(623); /* Ñ\»α┐∩╢╡╡L¬k│Q⌐w╕q */
- ; }
- ;
- mov bx, ax ; cx:bx := ITEMID PadId
- mov cx, dx
-
- mov ax, offset PadPrompt ; push char FAR * PadPrompt
-
- push ds
- push ax
-
- mov ax, _LASTITEM ; push ITEMID _LASTITEM
- cwd
- push dx
- push ax
-
- mov ax, [SysMenuId]
- mov dx, [SysMenuId+2]
-
- call _NewItem
-
- or ax, ax
- jz L1
-
- mov ax, 623 ; Ñ\»α┐∩╢╡╡L¬k│Q⌐w╕q
- call _Error
- L1:
- ;
- ; ⌐w╕q╖s╝WñºÑDÑ\»α┐∩╢╡ (PAD) ¬║ñU⌐╘¼≡┼πªíÑ\»α¬φ│µ (POPUP)
- ;
- ; PopupId = _GetNewMenuId();
- ;
- _GetNewMenuId
-
- mov [PopupId], ax
- mov [PopupId+2], dx
- ;
- ; if (Error = _NewMenu(MPOPUP, PopupId))
- ; {
- ; _Error(-Error);
- ; }
- ;
- mov bx, ax
- mov cx, dx
-
- mov ax, MPOPUP
-
- call _NewMenu
-
- or ax, ax
- jz L2
-
- neg ax
- call _Error
- L2:
- ;
- ; Bar1_Id = _GetNewItemId(PopupId);
- ;
- mov ax, [PopupId] ; dx:ax := PopupId
- mov dx, [PopupId+2]
-
- _GetNewItemId
-
- mov [bp+Bar1_Id], ax
- mov [bp+Bar1_Id+2], dx
- ;
- ; ╜╨¬`╖N: ╜╨⌐≤⌐IÑsÑ⌠ª≤¿ΣѪ _GetNewItemId() ½eѲ⌐IÑs _NewItem()
- ;
- ; if (_NewItem(PopupId, Bar1_Id, _LASTITEM, "\\<1.CLOCK ON"))
- ; {
- ; _Error(623); /* Ñ\»α┐∩╢╡╡L¬k│Q⌐w╕q */
- ; }
- ;
- mov bx, ax ; cx:bx := ITEMID Bar1_Id
- mov cx, dx
-
- mov ax, offset Bar1_Prompt ; push char FAR * Bar1_Prompt
-
- push ds
- push ax
-
- mov ax, _LASTITEM ; push ITEMID _LASTITEM
- cwd
- push dx
- push ax
-
- mov ax, [PopupId]
- mov dx, [PopupId+2]
-
- call _NewItem
-
- or ax, ax
- jz L3
-
- mov ax, 623 ; Ñ\»α┐∩╢╡╡L¬k│Q⌐w╕q
- call _Error
- L3:
- ;
- ; Bar2_Id = _GetNewItemId(PopupId);
- ;
- mov ax, [PopupId] ; dx:ax := PopupId
- mov dx, [PopupId+2]
-
- _GetNewItemId
-
- mov [bp+Bar2_Id], ax
- mov [bp+Bar2_Id+2], dx
- ;
- ; if (_NewItem(PopupId, Bar2_Id, _LASTITEM, "\\<2.CLOCK OFF"))
- ; {
- ; _Error(623); /* Ñ\»α┐∩╢╡╡L¬k│Q⌐w╕q */
- ; }
- ;
- mov bx, ax ; cx:bx := ITEMID Bar2_Id
- mov cx, dx
-
- mov ax, offset Bar2_Prompt ; push char FAR * Bar2_Prompt
- push ds
- push ax
-
- mov ax, _LASTITEM ; push ITEMID _LASTITEM
- cwd
- push dx
- push ax
-
- mov ax, [PopupId]
- mov dx, [PopupId+2]
-
- call _NewItem
-
- or ax, ax
- jz L4
-
- mov ax, 623 ; Ñ\»α┐∩╢╡╡L¬k│Q⌐w╕q
- call _Error
- L4:
-
-
- ;
- ; Bar3_Id = _GetNewItemId(PopupId);
- ;
- mov ax, [PopupId] ; dx:ax := PopupId
- mov dx, [PopupId+2]
-
- _GetNewItemId
-
- mov [bp+Bar3_Id], ax
- mov [bp+Bar3_Id+2], dx
- ;
- ; if (_NewItem(PopupId, Bar3_Id, _LASTITEM, "\\<3.STATUS ON"))
- ; {
- ; _Error(623); /* Ñ\»α┐∩╢╡╡L¬k│Q⌐w╕q */
- ; }
- ;
- mov bx, ax ; cx:bx := ITEMID Bar3_Id
- mov cx, dx
-
- mov ax, offset Bar3_Prompt ; push char FAR * Bar3_Prompt
- push ds
- push ax
-
- mov ax, _LASTITEM ; push ITEMID _LASTITEM
- cwd
- push dx
- push ax
-
- mov ax, [PopupId]
- mov dx, [PopupId+2]
-
- call _NewItem
-
- or ax, ax
- jz L5
-
- mov ax, 623 ; Ñ\»α┐∩╢╡╡L¬k│Q⌐w╕q
- call _Error
- L5:
-
-
- ;
- ; Bar4_Id = _GetNewItemId(PopupId);
- ;
- mov ax, [PopupId] ; dx:ax := PopupId
- mov dx, [PopupId+2]
-
- _GetNewItemId
-
- mov [bp+Bar4_Id], ax
- mov [bp+Bar4_Id+2], dx
- ;
- ; if (_NewItem(PopupId, Bar4_Id, _LASTITEM, "\\<4.STATUS OFF"))
- ; {
- ; _Error(623); /* Ñ\»α┐∩╢╡╡L¬k│Q⌐w╕q */
- ; }
- ;
- mov bx, ax ; cx:bx := ITEMID Bar4_Id
- mov cx, dx
-
- mov ax, offset Bar4_Prompt ; push char FAR * Bar4_Prompt
- push ds
- push ax
-
- mov ax, _LASTITEM ; push ITEMID _LASTITEM
- cwd
- push dx
- push ax
-
- mov ax, [PopupId]
- mov dx, [PopupId+2]
-
- call _NewItem
-
- or ax, ax
- jz L6
-
- mov ax, 623 ; Ñ\»α┐∩╢╡╡L¬k│Q⌐w╕q
- call _Error
- L6:
-
-
- ;
- ; ▒NñU⌐╘¼≡┼πªíÑ\»α¬φ│µ (POPUP:PopupId) ªw╕m⌐≤╖s╝WñºÑDÑ\»α┐∩╢╡ (PAD:PadId) ñW
- ;
- ; _SetItemSubMenu(SysMenuId, PadId, PopupId);
- ;
- mov ax, [PopupId]
- mov dx, [PopupId+2]
- push dx
- push ax
-
- mov bx, [PadId]
- mov cx, [PadId+2]
-
- mov ax, [SysMenuId]
- mov dx, [SysMenuId+2]
-
- call _SetItemSubMenu
- ;
- ; │]⌐w╝÷┴Σ
- ;
- ; _SetItemCmdKey(SysMenuId, PadId, 0x4100 | 49, "");
- ;
- mov ax, offset NullString
-
- push ds
- push ax
-
- mov ax, 4100h or 49
- push ax
-
- mov bx, [PadId]
- mov cx, [PadId+2]
-
- mov ax, [SysMenuId]
- mov dx, [SysMenuId+2]
-
- call _SetItemCmdKey
- ;
- ; _SetItemCmdKey(PopupId, Bar1_Id, 0x4100 | 120, "Alt+1");
- ;
- mov ax, offset Alt1_String
-
- push ds
- push ax
-
- mov ax, 4100h or 120
- push ax
-
- mov bx, [bp+Bar1_Id]
- mov cx, [bp+Bar1_Id+2]
-
- mov ax, [PopupId]
- mov dx, [PopupId+2]
-
- call _SetItemCmdKey
- ;
- ; _SetItemCmdKey(PopupId, Bar2_Id, 0x4100 | 121, "Alt+2");
- ;
- mov ax, offset Alt2_String
- push ds
- push ax
-
- mov ax, 4100h or 121
- push ax
-
- mov bx, [bp+Bar2_Id]
- mov cx, [bp+Bar2_Id+2]
-
- mov ax, [PopupId]
- mov dx, [PopupId+2]
-
- call _SetItemCmdKey
-
-
- ;
- ; _SetItemCmdKey(PopupId, Bar3_Id, 0x4100 | 122, "Alt+3");
- ;
- mov ax, offset Alt3_String
- push ds
- push ax
-
- mov ax, 4100h or 122
- push ax
-
- mov bx, [bp+Bar3_Id]
- mov cx, [bp+Bar3_Id+2]
-
- mov ax, [PopupId]
- mov dx, [PopupId+2]
-
- call _SetItemCmdKey
-
-
- ;
- ; _SetItemCmdKey(PopupId, Bar4_Id, 0x4100 | 123, "Alt+4");
- ;
- mov ax, offset Alt4_String
- push ds
- push ax
-
- mov ax, 4100h or 123
- push ax
-
- mov bx, [bp+Bar4_Id]
- mov cx, [bp+Bar4_Id+2]
-
- mov ax, [PopupId]
- mov dx, [PopupId+2]
-
- call _SetItemCmdKey
-
-
- ;
- ; │]⌐wªU¡╙ñlÑ\»α┐∩╢╡│Q┐∩╛▄½ß⌐╥¡n░⌡ªµñº▒`ªí
- ;
- ; _OnSelection(PopupId, Bar1_Id, SetClockOn);
- ;
- mov ax, offset SetClockOn
- push cs
- push ax
-
- mov bx, [bp+Bar1_Id]
- mov cx, [bp+Bar1_Id+2]
-
- mov ax, [PopupId]
- mov dx, [PopupId+2]
-
- call _OnSelection
- ;
- ; _OnSelection(PopupId, Bar2_Id, SetClockOff);
- ;
- mov ax, offset SetClockOff
- push cs
- push ax
-
- mov bx, [bp+Bar2_Id]
- mov cx, [bp+Bar2_Id+2]
-
- mov ax, [PopupId]
- mov dx, [PopupId+2]
-
- call _OnSelection
-
- ;
- ; _OnSelection(PopupId, Bar3_Id, SetStatOn);
- ;
- mov ax, offset SetStatOn
- push cs
- push ax
-
- mov bx, [bp+Bar3_Id]
- mov cx, [bp+Bar3_Id+2]
-
- mov ax, [PopupId]
- mov dx, [PopupId+2]
-
- call _OnSelection
-
- ;
- ; _OnSelection(PopupId, Bar4_Id, SetStatOff);
- ;
- mov ax, offset SetStatOff
- push cs
- push ax
-
- mov bx, [bp+Bar4_Id]
- mov cx, [bp+Bar4_Id+2]
-
- mov ax, [PopupId]
- mov dx, [PopupId+2]
-
- call _OnSelection
-
-
- pop ds
- pop dx
- pop cx
- pop bx
- pop ax
-
- add sp, 4*sizeof_ITEMID
-
- FarExit
-
- ret
- StartUp ENDP
-
-
- ShutDown PROC FAR
-
- FarEnter
-
- push ax
- push bx
- push cx
- push dx
- push ds
-
- mov ax, @data
- mov ds, ax
- ;
- ; _DisposeItem(SysMenuId, PadId);
- ;
- mov bx, [PadId]
- mov cx, [PadId+2]
- mov ax, [SysMenuId]
- mov dx, [SysMenuId+2]
-
- call _DisposeItem
- ;
- ; _DisposeMenu(PopupId);
- ;
- mov ax, [PopupId]
- mov dx, [PopupId+2]
-
- pop ds
- pop dx
- pop cx
- pop bx
- pop ax
-
- FarExit
-
- ret
- ShutDown ENDP
- END