home *** CD-ROM | disk | FTP | other *** search
- *:
- *: MENUS.DFT - dBFast Template File for Menus
- *:
- *: Project: <<PROJECT_NAME>>
- *:
- *: Program: <<PROG_NAME>>
- *: Description: <<DESC>>
- *: Author: <<AUTHOR>>
- *: Copyright <<COPYRITE>>
- *:
-
- <<DO WHILE DLLS>>
- <<DECLARE_DLL>>
- <<ENDDO>>
-
- SET PROCEDURE TO <<PROG_NAME>>
-
- <<DO WHILE PROC_LIBS>>
- SET PROCEDURE TO <<PROC_LIB>> && Set user procedure file
- <<ENDDO>>
-
- SET EVENTMSK TO 159
-
- SET READ VIDEO TO 240
-
- <<SET_FONTS>>
-
- *: Initialize memory variables
- STORE 0 TO nTheMenu, nTheOption, nTheKey
- STORE '' TO sTheWindow, sTheButton
- <<MEM_VARS>>
-
- SET WINDOW TITLE TO '<<DESC>>'
-
- <<DO WHILE DATAFILES>>
- IF FILE("<<DATAFILE>>.DBF")
- SELECT <<WORKAREA>>
- USE <<DATAFILE>>
- <<IF INDEXES>>
- SET INDEX TO <<INDEXES>>
- <<ENDIF>>
- <<IF FIELDLIST>>
- SET FIELDS TO <<FIELDLIST>>
- SET FIELDS ON
- <<ENDIF>>
- <<IF FILTER>>
- SET FILTER TO <<FILTER>>
- <<ENDIF>>
- ELSE
- WARNING(csNoDataFile,"<<DATAFILE>>",387)
- RETURN
- ENDIF
- <<ENDDO>>
-
- <<DO WHILE RELATIONS>>
- SELECT <<REL_FROM>>
- <<DO WHILE LINKS>>
- SET RELATION TO <<REL_EXP>> INTO <<REL_TO>>
- <<ENDDO>>
- <<ENDDO>>
-
- SELECT 1
-
- <<DO BEFORE>>
-
- <<DO WHILE POPUPS>>
- <<CREATE POPUP>>
- <<ENDDO>>
-
- <<CREATE PULLDOWN>>
-
- SET MENU TO '<<PROG_NAME>>'
- sMenuName = '<<PROG_NAME>>'
-
- <<MENU_STATES>>
-
- *: Init sAction to something so it is not empty
- sAction = '?'
-
- DO WHILE .NOT. EMPTY(sAction)
-
- READ SAVE
-
- nEvent = EVENT()
- nTheMenu = HMENU()
- nTheOption = VMENU()
- nTheKey = LASTKEY()
- sTheWindow = WINDOW()
- sTheButton = BUTTON()
-
- sAction = <<PROG_NAME>>_Translate(nEvent)
- DO <<PROG_NAME>>_Action
- ENDDO
-
- sAction = '?'
-
- ERASE
- CLOSE MENU '<<PROG_NAME>>'
-
- <<DO AFTER>>
-
- RETURN
-
- *****************************
- FUNCTION <<PROG_NAME>>_Translate()
- *****************************
- PARAMETER nTheEvent
- PRIVATE sTheAction
-
- sTheAction = ' '
- DO CASE
- CASE nTheEvent = eClose
- sTheAction = 'CLOSE'
-
- <<IF KEYS>>
- CASE nTheEvent = eKybd
- DO CASE
- <<DO WHILE KEYS>>
- CASE ExactMatch(nTheKey, <<THE_KEY>>)
- sTheAction = '<<THE_NAME>>'
- <<ENDDO>>
- OTHERWISE
- sTheAction = '?'
- ENDCASE
- <<ENDIF>>
-
- <<IF MENUS>>
- CASE nTheEvent = eMenu
- DO CASE
- <<DO WHILE MENUS>>
- CASE ExactMatch(nTheMenu, <<THE_MENU>>)
- DO CASE
- <<DO WHILE OPTIONS>>
- CASE ExactMatch(nTheOption, <<THE_OPTION>>)
- sTheAction = '<<THE_NAME>>'
- <<ENDDO>>
- ENDCASE
- <<ENDDO>>
- ENDCASE
- <<ENDIF>>
-
- OTHERWISE
- sTheAction = '?'
- ENDCASE
- RETURN(sTheAction)
-
-
- *************************
- PROCEDURE <<PROG_NAME>>_Action
- *************************
-
- DO CASE
- CASE sAction = 'CLOSE'
- sAction = ''
-
- <<DO WHILE ACTIONS>>
- CASE ExactMatch(sAction, '<<THE_NAME>>')
- <<DO ACTION>>
- <<ENDDO>>
- ENDCASE
- RETURN
-
-
- *************************
- FUNCTION ExactMatch()
- *************************
- PARAMETERS sVar1, sVar2
-
- lReturn = .F.
- SET EXACT ON
- lReturn = (sVar1 = sVar2)
- SET EXACT OFF
- RETURN(lReturn)
-