Compile insert App_Inserts

/***********************************************************************************************************************

    This program is proprietary and is not to be used by or disclosed to others, nor is it to be copied without written
    permission from SRP Computer Solutions, Inc.

    Name        :   App_Inserts

    Description :   Common declarations and equates used by the application.

    Notes       :   App_Inserts is designed to be the most commonly used insert within SRP FrameWorks routines.

    History     :   (Date, Initials, Notes)
        07/23/98    dmb     Original programmer.
        10/04/13    dmb     Added insert for SystemFont$, SystemTypeface$, and SystemPoint$ to make it easier for
                            commuters to apply the FrameWorks default font. - [SRPFW-17]

***********************************************************************************************************************/

Declare function    Msg, PopUp, Set_Property, Get_Property, Utility, Send_Message, Dialog_Box, Start_Window
Declare function    Start_MDIChild, Set_Printer, Get_Printer, SRP_Show_Window, MCP, GetTickCount
Declare function    Form_Services, Error_Services, Memory_Services, MCP
Declare subroutine  Set_Property, Utility, Send_Event, Send_Message, End_Dialog, Send_Info, Msg, SendMessage
Declare subroutine  Forward_Event, Lock_Record, Post_Event, SRP_Show_Window, SRP_Set_Prop_Array
Declare subroutine  Form_Services, Error_Services, SRP_Stopwatch, Memory_Services, MCP

Equ SystemTable$ to 'APP_INFO'

* Logical equates

$insert LOGICAL

Equ Success$		to 1
Equ Failure$		to 0
Equ Passed$			to 1
Equ Failed$			to 0
Equ Qualified$		to 1
Equ Not_qualified$	to 0
Equ Confirmed$		to 1
Equ Not_confirmed$	to 0
Equ OK$				to 1

* General equates

Equ Tab$		to Char(9)
Equ Esc$		to \1B\
Equ CRLF$		to \0D0A\
Equ Lock$		to 1
Equ Unlock$		to 2
Equ ReadOnly$	to 0
Equ FullWrite$	to 1
Equ NoAccess$	to -1

* Font equates

Equ Tahoma_8_Reg$		to 'Tahoma' : @SVM : -11 : @SVM : 400 : @SVM : 0 : @SVM : 0 : @SVM : 0 : @SVM : 0 : @SVM : 34 : @SVM : 0 : @SVM : 3 : @SVM : 2 : @SVM : 1 : @SVM : 0 : @SVM : 0 : @SVM : 0 : @SVM : 0
Equ Tahoma_8_Reg_UL$	to 'Tahoma' : @SVM : -11 : @SVM : 400 : @SVM : 0 : @SVM : 1 : @SVM : 0 : @SVM : 0 : @SVM : 34 : @SVM : 0 : @SVM : 3 : @SVM : 2 : @SVM : 1 : @SVM : 0 : @SVM : 0 : @SVM : 0 : @SVM : 0
Equ Tahoma_8_Bold$		to 'Tahoma' : @SVM : -11 : @SVM : 700 : @SVM : 0 : @SVM : 0 : @SVM : 0 : @SVM : 0 : @SVM : 34 : @SVM : 0 : @SVM : 3 : @SVM : 2 : @SVM : 1 : @SVM : 0 : @SVM : 0 : @SVM : 0 : @SVM : 0

Equ Tahoma_12_Reg$		to 'Tahoma' : @SVM : 12 : @SVM : 400 : @SVM : 0 : @SVM : 0 : @SVM : 0 : @SVM : 0 : @SVM : 34 : @SVM : 0 : @SVM : 3 : @SVM : 2 : @SVM : 1 : @SVM : 0 : @SVM : 0 : @SVM : 0 : @SVM : 0
Equ Tahoma_12_Reg_UL$	to 'Tahoma' : @SVM : 12 : @SVM : 400 : @SVM : 0 : @SVM : 1 : @SVM : 0 : @SVM : 0 : @SVM : 34 : @SVM : 0 : @SVM : 3 : @SVM : 2 : @SVM : 1 : @SVM : 0 : @SVM : 0 : @SVM : 0 : @SVM : 0
Equ Tahoma_12_Bold$		to 'Tahoma' : @SVM : 12 : @SVM : 700 : @SVM : 0 : @SVM : 0 : @SVM : 0 : @SVM : 0 : @SVM : 34 : @SVM : 0 : @SVM : 3 : @SVM : 2 : @SVM : 1 : @SVM : 0 : @SVM : 0 : @SVM : 0 : @SVM : 0

* Promoted Event equates

Equ Create$				to 1
Equ Activated$			to 2
Equ Read_Pre_System$	to 3
Equ Clear_Post_System$	to 4
Equ Close_Post_System$	to 5
Equ Size$				to 6
Equ Delete_Post_System$	to 7
Equ Winmsg$				to 8
Equ Write_Pre_System$	to 9
Equ Gotfocus$			to 10
Equ Lostfocus$			to 11
Equ Inactivated$		to 12
Equ Read_Post_System$	to 13
Equ Clear_Pre_System$	to 14
Equ Poschanged$			to 15
Equ Close_Pre_System$	to 16
Equ Write_Post_System$	to 17
Equ Delete_Pre_System$	to 18
Equ InsertRow$			to 19
Equ DeleteRow$			to 20
Equ ColSize$			to 21
Equ RightClickUp$		to 22
Equ MouseOver$			to 23
Equ MouseOff$			to 24
Equ OLE$				to 25
Equ Click$				to 26
Equ Timer$				to 27
Equ ContextMenu$		to 28

// General Windows API equates
Equ WM_USER 				to 1024
Equ WM_CLOSE				to 16
Equ WM_COMMAND				to 273
Equ WM_LBUTTONDOWN			to 513	; // 0x0201
Equ WM_LBUTTONUP			to 514	; // 0x0202
Equ WM_LBUTTONDBLCLK		to 515	; // 0x0203
Equ WM_RBUTTONDOWN			to 516	; // 0x0204
Equ WM_RBUTTONUP			to 517	; // 0x0205
Equ WM_PARENTNOTIFY			to 528	; // 0x0210
Equ WM_SYSCOLORCHANGE		to 21	; // 0x0015
Equ WM_SETCURSOR 			to 32	; // 0x0020
Equ WM_SIZE					to 5	; // 0x0005
Equ WM_MOVE					to 3	; // 0x0003
Equ WM_GETMINMAXINFO		to 36	; // 0x0024
Equ WM_WINDOWPOSCHANGING	to 70

// ShowWindow API equates
Equ SW_FORCEMINIMIZE        to 11
Equ SW_HIDE                 to 0
Equ SW_MAXIMIZE             to 3
Equ SW_MINIMIZE             to 6
Equ SW_RESTORE              to 9
Equ SW_SHOW                 to 5
Equ SW_SHOWDEFAULT          to 10
Equ SW_SHOWMAXIMIZED        to 3
Equ SW_SHOWMINIMIZED        to 2
Equ SW_SHOWMINNOACTIVE      to 7
Equ SW_SHOWNA               to 8
Equ SW_SHOWNOACTIVATE       to 4
Equ SW_SHOWNORMAL           to 1


Equ WS_CAPTION$				to 0x00C00000
Equ WS_SYSMENU$				to 0x00080000
Equ WS_THICKFRAME$			to 0x00040000
Equ WS_EX_TOOLWINDOW$		to 0x00000080
Equ WS_EX_CLIENTEDGE$		to 0x200
Equ WS_CLIPCHILDREN$		to 0x02000000

Equ SM_CYCAPTION$			to 4
Equ F4_VK_CODE				to 115	; // 115 is the virtual key code for F4.
Equ TAB_VK_CODE				to 9

* Edittable/Datatable equates

Equ DTN_ABORTEDIT		to 17
Equ DTM_EDITCURCELL		to WM_USER + 95 ; * Change to Edit mode now
Equ DTM_SETEDITKEY		to 1118         ; * Set key to change to Edit Mode
Equ DTM_SETCOLFORMAT	to WM_USER + 18
 	
Equ DT_BEGINEDIT		to 1  ;*  begin edit mode
Equ DT_ENDEDIT			to 2  ;*  end the edit
Equ DT_ABORTEDIT		to 3  ;*  Esc will undo changes
Equ DTS_EDIT     		to 4 
Equ DTCS_PROTECT 		to 8

* Help equates

Equ HELP_CONTEXT to 1
Equ HELP_QUIT to 2
Equ HELP_INDEX to 3
Equ HELP_CONTENTS to 3
Equ HELP_HELPONHELP to 4
Equ HELP_SETINDEX to 5
Equ HELP_SETCONTENTS to 5
Equ HELP_CONTEXTPOPUP to 8
Equ HELP_FORCEFILE to 9
Equ HELP_KEY to 257
Equ HELP_COMMAND to 258
Equ HELP_PARTIALKEY to 261
Equ HELP_MULTIKEY to 513
Equ HELP_SETWINPOS to 515

* Color equates

Equ Msg_Light_Grey$	to 212:@VM:208:@VM:200
Equ Msg_Dark_Grey$	to 127:@VM:127:@VM:127
Equ Msg_Light_Blue$	to 0:@VM:255:@VM:255
Equ Msg_Dark_Blue$	to 0:@VM:0:@VM:255
Equ Msg_Red$		to 255:@VM:0:@VM:0
Equ Msg_Green$		to 0:@VM:255:@VM:0
Equ Msg_Purple$		to 255:@VM:0:@VM:255
Equ Msg_Yellow$		to 255:@VM:255:@VM:0
Equ Msg_Black$		to 0:@VM:0:@VM:0
Equ Msg_White$		to 255:@VM:255:@VM:255

* RGB colors
EQU USEPARENT$                 TO 0          ;* \000000\
EQU BLACK$                     TO 1          ;* \FFFFFF\
EQU RED$                       TO 255        ;* \0000FF\
EQU ORANGE$                    TO 33023      ;* \0080FF\
EQU GREEN$                     TO 65280      ;* \00FF00\
EQU YELLOW$                    TO 65535      ;* \00FFFF\
EQU GREY$                      TO 12632256   ;* \C0C0C0\
EQU BLUE$                      TO 16711680   ;* \FF0000\
EQU PURPLE$                    TO 16711808   ;* \FF0080\
EQU MAGENTA$                   TO 16711935   ;* \FF00FF\
EQU CYAN$                      TO 16776960   ;* \FFFF00\
EQU WHITE$                     TO 16777215   ;* \FFFFFF\

// The following color equates are used directly
// Example: Set_Property(CtrlEntID, "BACKCOLOR", COLOR_BTNFACE$)
EQU COLOR_SCROLLBAR$           TO 2147483648 ;* \80000000\
EQU COLOR_BACKGROUND$          TO 2164260864 ;* \81000000\
EQU COLOR_ACTIVECAPTION$       TO 2181038080 ;* \82000000\
EQU COLOR_INACTIVECAPTION$     TO 2197815296 ;* \83000000\
EQU COLOR_MENU$                TO 2214592512 ;* \84000000\
EQU COLOR_WINDOW$              TO 2231369728 ;* \85000000\
EQU COLOR_WINDOWFRAME$         TO 2248146944 ;* \86000000\
EQU COLOR_MENUTEXT$            TO 2264924160 ;* \87000000\
EQU COLOR_WINDOWTEXT$          TO 2281701376 ;* \88000000\
EQU COLOR_CAPTIONTEXT$         TO 2298478592 ;* \89000000\
EQU COLOR_ACTIVEBORDER$        TO 2315255808 ;* \8A000000\
EQU COLOR_INACTIVEBORDER$      TO 2332033024 ;* \8B000000\
EQU COLOR_APPWORKSPACE$        TO 2348810240 ;* \8C000000\
EQU COLOR_HIGHLIGHT$           TO 2365587456 ;* \8D000000\
EQU COLOR_HIGHLIGHTTEXT$       TO 2382364672 ;* \8E000000\
EQU COLOR_BTNFACE$             TO 2399141888 ;* \8F000000\
EQU COLOR_BTNSHADOW$           TO 2415919104 ;* \90000000\
EQU COLOR_GRAYTEXT$            TO 2432696320 ;* \91000000\
EQU COLOR_BTNTEXT$             TO 2449473536 ;* \92000000\
EQU COLOR_INACTIVECAPTIONTEXT$ TO 2466250752 ;* \93000000\
EQU COLOR_BTNHIGHLIGHT$        TO 2483027968 ;* \94000000\

// The following color equates are used with the GetSysColor WinAPI command
// Example: Set_Property(CtrlEntID, "BACKCOLOR", GetSysColor(API_COLOR_BTNFACE$))
Equ API_COLOR_SCROLLBAR$           To       0 
Equ API_COLOR_BACKGROUND$          To       1
Equ API_COLOR_ACTIVECAPTION$       To       2 
Equ API_COLOR_INACTIVECAPTION$     To       3 
Equ API_COLOR_MENU$                To       4 
Equ API_COLOR_WINDOW$              To       5 
Equ API_COLOR_WINDOWFRAME$         To       6 
Equ API_COLOR_MENUTEXT$            To       7 
Equ API_COLOR_WINDOWTEXT$          To       8 
Equ API_COLOR_CAPTIONTEXT$         To       9 
Equ API_COLOR_ACTIVEBORDER$        To       10 
Equ API_COLOR_INACTIVEBORDER$      To       11 
Equ API_COLOR_APPWORKSPACE$        To       12 
Equ API_COLOR_HIGHLIGHT$           To       13 
Equ API_COLOR_HIGHLIGHTTEXT$       To       14 
Equ API_COLOR_BTNFACE$             To       15 
Equ API_COLOR_BTNSHADOW$           To       16 
Equ API_COLOR_GRAYTEXT$            To       17 
Equ API_COLOR_BTNTEXT$             To       18 
Equ API_COLOR_INACTIVECAPTIONTEXT$ To       19 
Equ API_COLOR_BTNHIGHLIGHT$        To       20

// Preference Manager
Equ ImagePath$ to Memory_Services('GetValue', 'PM_CURRENT_IMAGE_PATH') : '\'
PMSystemFont = Memory_Services('GetValue', 'PM_SYSTEM_FONT')
Convert ',' to @SVM in PMSystemFont
Equ SystemFont$     to PMSystemFont
Equ SystemTypeface$ to SystemFont$[1, @SVM]
Equ SystemPoint$    to SystemFont$[Col2() + 1, @SVM]

