home *** CD-ROM | disk | FTP | other *** search
Ami Pro/Word Pro document | 1993-05-17 | 18.6 KB | 587 lines |
- [ver]
- [sty]
- [files]
- [charset]
- ANSI (Windows, IBM CP 1252)
- [revisions]
- [prn]
- QMS-PS 810
- [port]
- LPT1:
- [lang]
- [desc]
- This is the template for the build.smm macro.
- 737753952
- 736633139
- [fopts]
- [lnopts]
- Body Text
- [docopts]
- [GramStyle]
- [ParaNum]
- [tag]
- Body Text
- [fnt]
- Times New Roman
- 240
- 49152
- [algn]
- [spc]
- 273
- 100
- [brk]
- [line]
- [spec]
- [nfmt]
- 280
- Body Text
- [tag]
- Body Single
- [fnt]
- Times New Roman
- 240
- 49152
- [algn]
- [spc]
- 273
- 100
- [brk]
- [line]
- [spec]
- [nfmt]
- 280
- Body Single
- [tag]
- Bullet
- [fnt]
- Times New Roman
- 240
- 49152
- [algn]
- 288
- 288
- [spc]
- 273
- 100
- [brk]
- [line]
- [spec]
- <*0>
- 360
- [nfmt]
- 272
- Bullet
- [tag]
- Bullet 1
- [fnt]
- Times New Roman
- 240
- 49152
- [algn]
- 288
- 288
- 288
- [spc]
- 273
- 100
- [brk]
- [line]
- [spec]
- <*5>
- [nfmt]
- 280
- Bullet 1
- [tag]
- Number List
- [fnt]
- Times New Roman
- 240
- 49152
- [algn]
- 360
- 360
- 360
- [spc]
- 273
- 100
- [brk]
- [line]
- [spec]
- <*:>.
- 360
- [nfmt]
- 272
- Number List
- [tag]
- Subhead
- [fnt]
- Times New Roman
- 240
- 49155
- [algn]
- [spc]
- 273
- 100
- [brk]
- [line]
- [spec]
- [nfmt]
- 272
- Body Text
- [tag]
- Title
- [fnt]
- Arial
- 360
- 16385
- [algn]
- [spc]
- 446
- 144
- 100
- [brk]
- [line]
- [spec]
- [nfmt]
- 272
- Title
- [tag]
- Header
- [fnt]
- Times New Roman
- 240
- 49152
- [algn]
- [spc]
- 273
- 100
- [brk]
- [line]
- [spec]
- [nfmt]
- 280
- Header
- [tag]
- Footer
- [fnt]
- Times New Roman
- 240
- 49152
- [algn]
- [spc]
- 273
- 100
- [brk]
- [line]
- [spec]
- [nfmt]
- 280
- Footer
- [lay]
- Standard
- [rght]
- 15840
- 12240
- 576
- 720
- 1080
- 576
- 576
- 11664
- 720
- 1440
- 2160
- 2880
- 3600
- 4320
- 5040
- 5760
- 6480
- 7200
- 7920
- 8640
- [hrght]
- [lyfrm]
- 11200
- 12240
- 1080
- 1 0 0 0 0 0 0
- [frmlay]
- 1080
- 12240
- 1440
- 792
- 1440
- 1440
- 10800
- 4680
- 9360
- [txt]
- [frght]
- [lyfrm]
- 13248
- 15120
- 12240
- 15840
- 1 0 0 0 0 0 0
- [frmlay]
- 15840
- 12240
- 1440
- 648
- 15192
- 1440
- 1440
- 10800
- 4680
- 9360
- [txt]
- [elay]
- 48 0 0 0 0 0 0 65535 65535 Standard 65535 0 0 0 0 0 0 0 0 0 65535 0 0 65535 0 0 0 0 0
- 96 0 14 0 0 0 0 65535 65535 Standard 65535 0 0 0 0 0 0 0 0 0 65535 0 0 65535 0 0 0 0 0
- 144 0 0 0 0 0 0 65535 65535 Standard 65535 0 0 0 0 0 0 0 0 0 65535 0 0 65535 0 0 0 0 0
- 170 0 5 512 0 0 0 65535 65535 Standard 65535 0 0 0 0 0 0 0 0 0 65535 0 0 65535 0 0 0 0 0
- 218 0 38 0 0 1 0 65535 65535 Standard 65535 0 0 0 0 0 0 0 0 0 65535 0 0 65535 0 0 0 0 0
- 264 0 39 0 0 1 0 65535 65535 Standard 65535 0 0 0 0 0 0 0 0 0 65535 0 0 65535 0 0 0 0 0
- 312 0 49 0 0 1 0 65535 65535 Standard 65535 0 0 0 0 0 0 0 0 0 65535 0 0 65535 0 0 0 0 0
- 337 0 10 1025 0 0 0 65535 65535 Standard 65535 0 0 0 0 0 0 0 0 0 65535 0 0 65535 0 0 0 0 0
- [edoc]
- <:#284,11088>
- <:#284,11088>
- <:#284,11088>
- <:#284,11088>
- <:#284,11088>' Declare functions
- <:#284,11088>Declare FontDlg(Action, Hdlg, id)
- <:#284,11088>Declare CellEngine(action,Form)
- <:#284,11088>Declare StrPath(Filename)
- <:#284,11088>Declare SizeBox(Hdlg, NumberEditControls)
- <:#284,11088>Declare GetFormats(Action)
- <:#284,11088>
- <:#284,11088>' WinApi defines
- <:#284,11088>Define SetWindowText(hwnd, text) DllCall("user,SetWindowText,IHC", %1, %2)
- <:#284,11088>Define MoveWindow() DllCall("User,MoveWindow,HHHHHHA",%1,%2,%3,%4,%5,%6)
- <:#284,11088>DEFINE GetWindowRect() DllCall("user,GetWindowRect,HHN",%1,%2)
- <:#284,11088>Define ShowWindow(hWnd, stuff) DllCall("user,ShowWindow,HHH", %1, %2)
- <:#284,11088>Define getsystemmetrics() dllcall("user,getsystemmetrics,HH", %1)
- <:#284,11088>
- <:#284,11088>
- <:#284,11088>Define GetPrefix() GetGlobalVar$("Prefix")
- <:#284,11088>Define GetSuffix() GetGlobalVar$("Suffix")
- <:#284,11088>
- <:#284,11088>
- @Subhead@<:#284,11088>Function Main()
- <:#284,11088>DefStr hInstance;
- <:#284,11088>
- <:#284,11088>
- <:#284,11088>Mac = GetRunningMacroFile$()
- <:#284,11088>MacPath = StrPath(Mac)
- <:#284,11088>FontDlg(1,0,0)
- <:#284,11088>CellEngine(1,0)
- <:#284,11088>GetFormats(1)
- <:#284,11088>FillEdit(1000, HelpText)
- <:#284,11088>SetDlgCallBack(0,"{Mac}!InitDlg")
- <:#284,11088>For Id = 8001 to 8009
- <:#284,11088> SetDlgCallBack(Id, "{Mac}!DataChange")
- <:#284,11088>Next
- <:#284,11088>
- <:#284,11088>FillEdit(1001, Value1Text)
- <:#284,11088>FillEdit(1002, Value2Text)
- <:#284,11088>FillEdit(1003, Value3Text)
- <:#284,11088>FillEdit(1004, Value4Text)
- <:#284,11088>FillEdit(1005, Value5Text)
- <:#284,11088>FillEdit(1006, Value6Text)
- <:#284,11088>FillEdit(1007, Value7Text)
- <:#284,11088>FillEdit(1008, Value8Text)
- <:#284,11088>FillEdit(1009, Value9Text)
- <:#284,11088>
- <:#284,11088>
- <:#284,11088>Box = DialogBox(".","Deprec")
- <:#284,11088>If Box = 3
- <:#284,11088> ' box closed with the copy button
- <:#284,11088> Answer = GetDialogField$(8010)
- <:#284,11088> ClipBoardWrite(Answer,1)
- <:#284,11088>Endif
- <:#284,11088>
- <:#284,11088>FontDlg(4,0,0)
- <:#284,11088>CellEngine(0,0)
- <:#284,11088>GetFormats(0)
- <:#284,11088>End function
- <:#284,11088>
- <:#284,11088>
- @Subhead@<:#284,11088>Function DataChange(Hdlg, id, value)
- <:#284,11088>IgnoreKeyBoard(2)
- <:#284,11088>DefStr Allowance;
- <:#284,11088>Value1 = GetDlgItemText(hDlg, 8001) * 1
- <:#284,11088>Value2 = GetDlgItemText(hDlg, 8002) * 1
- <:#284,11088>value3 = GetDlgItemText(hDlg, 8003) * 1
- <:#284,11088>value4 = GetDlgItemText(hDlg, 8004) * 1
- <:#284,11088>value5 = GetDlgItemText(hDlg, 8005) * 1
- <:#284,11088>value6 = GetDlgItemText(hdlg, 8006) * 1
- <:#284,11088>value7 = GetDlgItemText(hdlg, 8007) * 1
- <:#284,11088>value8 = GetDlgItemText(hdlg, 8008) * 1
- <:#284,11088>value9 = GetDlgItemText(hdlg, 8009) * 1
- <:#284,11088>Answer = CellEngine(3,Formula)
- <:#284,11088>Answer = FormatNum$("","",2,Answer )
- <:#284,11088>SetDlgItemText(hDlg, 8010, Answer)
- <:#284,11088>End Function
- <:#284,11088>
- @Subhead@<:#284,11088>Function InitDlg(hDlg, id, value)
- <:#284,11088>' use the fontdlg function to display the following control with a small font
- <:#284,11088>HourGlass(on)
- <:#284,11088>SetWindowText(Hdlg, DialogTitle)
- <:#284,11088>FontDlg(3, Hdlg, 1000)
- <:#284,11088>For Id = 1 to 9
- <:#284,11088> FontDlg(3, Hdlg, id + 1000)
- <:#284,11088> FontDlg(3, Hdlg, id + 8000)
- <:#284,11088> If Id <;> NumberItems
- <:#284,11088> ShowWindow(GetDlgItem(Hdlg, id + 1000), 0)
- <:#284,11088> ShowWindow(GetDlgItem(Hdlg, id + 8000), 0)
- <:#284,11088> Endif
- <:#284,11088>Next
- <:#284,11088>FontDlg(3, Hdlg, 8010)
- <:#284,11088>FontDlg(3, Hdlg, 8011)
- <:#284,11088>SizeBox(Hdlg, NumberItems)
- <:#284,11088>HourGlass(off)
- <:#284,11088>
- <:#284,11088>End Function
- <:#284,11088>
- <:#284,11088>
- @Subhead@<:#284,11088>Function SizeBox(Hdlg, NumberEditControls)
- <:#284,11088>Define Repaint 1
- <:#284,11088>Dim Rect(4)
- Stat = GetSystemMetrics(4)
- GetWindowRect(Hdlg, &Rect)
- <:#284,11088>DeltaX = Rect(3) - Rect(1);
- <:#284,11088>NumberIncrease = (NumberEditControls - 3);
- <:#284,11088>If NumberIncrease <<0
- <:#284,11088> NumberIncrease = 0
- <:#284,11088>Endif
- If Stat = 20
- DeltaY = (20 * NumberIncrease) + 140;
- DeltaY = (26 * NumberIncrease) + 190;
- Endif
- MoveWindow(Hdlg, Rect(1), Rect(2), DeltaX, DeltaY, Repaint)
- <:#284,11088>End Function
- <:#284,11088>
- <:#284,11088>
- @Subhead@<:#284,11088>Function GetFormats(Action)
- <:#284,11088>iCurrency = GetProfileString$("Intl","iCurrency","Win.ini")
- <:#284,11088>currency = GetProfileString$("Intl","sCurrency","Win.ini")
- <:#284,11088>AllocGlobalVar("Prefix",1)
- <:#284,11088>AllocGlobalVar("Suffix",1)
- <:#284,11088>
- <:#284,11088>Switch Action
- <:#284,11088> Case 1 ' turn this on
- <:#284,11088> Switch iCurrency
- <:#284,11088> Case 0
- <:#284,11088> Prefix = Currency
- <:#284,11088> Suffix = ""
- <:#284,11088> Case 1
- <:#284,11088> Prefix = ""
- <:#284,11088> Suffix = Currency
- <:#284,11088> Case 2
- <:#284,11088> Prefix = StrCat$(Currency," ")
- <:#284,11088> Suffix = ""
- <:#284,11088> Case 3
- <:#284,11088> Prefix = ""
- <:#284,11088> Suffix = StrCat$(" ",Currency)
- <:#284,11088> endSwitch
- <:#284,11088> SetGlobalVar("Suffix",Suffix)
- <:#284,11088> SetGlobalVar("Prefix",Prefix)
- <:#284,11088>
- <:#284,11088> Case 0 ' free globals
- <:#284,11088> FreeGlobalVar("Suffix")
- <:#284,11088> FreeGlobalVar("Prefix")
- <:#284,11088>
- <:#284,11088>EndSwitch
- <:#284,11088>End Function
- <:#284,11088>
- <:#284,11088>
- <:#284,11088>
- @Subhead@<:#284,11088>function strpath(filename)
- <:#284,11088>defstr char;
- <:#284,11088>Length = len(FileName)
- <:#284,11088>WHILE "\" != Assign(&Char, MID$(FileName, Length, 1))
- <:#284,11088> Length = Length - 1
- <:#284,11088>WEND
- <:#284,11088>InFileName = Right$(FileName, (len(FileName) - Length))
- <:#284,11088>InDir = Left$(FileName, Length - 1)
- <:#284,11088>if right$(indir, 1) <<<;> "\"
- <:#284,11088> indir = strcat$(indir, "\")
- <:#284,11088>endif
- <:#284,11088>return indir
- <:#284,11088>end function
- <:#284,11088>
- <:#284,11088>
- <:#284,11088>
- <:p<* >>
- @Subhead@<:#284,11088>Function CellEngine(Action,Form)
- <:#284,11088>'Available Actions
- <:#284,11088>' 1 Start the engine and allocate globalvar
- <:#284,11088>' 2 Return the handle to the instance of the sheet
- <:#284,11088>' 3 Pass the formula as the second param
- <:#284,11088>' 0 Shut everything down
- <:#284,11088>' Default Expect a formula and return an answer
- <:#284,11088>
- <:#284,11088>' these defines may be useful at the beginning of your macro
- <:#284,11088>Define StartEngine 1
- <:#284,11088>Define GetInstance 2
- <:#284,11088>Define CloseEngine 0
- <:#284,11088>
- <:#284,11088>Define CECREATEINSTANCE(LPHANDLE) DllCall("LTSCE01.DLL,CECREATEINSTANCE,HO",%1)
- <:#284,11088>Define CEDESTROYINSTANCE(HANDLE) DllCall("LTSCE01.DLL,CEDESTROYINSTANCE,HH",%1)
- <:#568,11088>Define CECALCNOW(HINSTANCE, lpFormula, lpOutPut) DllCall("LTSCE01.DLL,CECALCNOW,HHCC",%1,%2,%3)
- <:#284,11088>
- <:#284,11088>DefStr hInstance, Answer, Var;
- <:#284,11088>Mac = GetRunningMacroFile$()
- <:#284,11088>GlobalInstance = StrCat$(Mac,"hIstance")
- <:#284,11088>AmiDir = GetAmiDirectory$()
- <:#284,11088>
- <:#284,11088>Switch Action
- <:#284,11088> Case 1
- <:#284,11088> ' start the engine
- <:#284,11088> LibId = DLLLoadLib("{AmiDir}LTSCE01.DLL","CECreateInstance","HO")
- <:#284,11088> If LibId = 0
- <:#284,11088> Message("LTSCE01.DLL not found. Copy the dll to your Ami Pro Directory.")
- <:#284,11088> Return -1;
- <:#284,11088> Endif
- <:#284,11088> RetVal = CECREATEINSTANCE(&hInstance)
- <:#284,11088> AllocGlobalVar("{GlobalInstance}",1)
- <:#284,11088> AllocGlobalVar("{Mac}LibId",1)
- <:#284,11088> SetGlobalVar("{Mac}Libid",LibId)
- <:#284,11088> SetGlobalVar("{GlobalInstance}",hInstance)
- <:#284,11088> Return hInstance;
- <:#284,11088> Break;
- <:#284,11088>
- <:#284,11088> Case 2
- <:#284,11088> ' return the handle to the instance of the sheet
- <:#284,11088> AllocGlobalVar("{GlobalInstance}",1)
- <:#284,11088> hInstance = GetGlobalVar$("{GlobalInstance}")
- <:#284,11088> Return hInstance;
- <:#284,11088> Break;
- <:#284,11088>
- <:#284,11088> Case 3
- <:#284,11088> ' Calculate the formula and return the answer
- <:#284,11088> AllocGlobalVar("{GlobalInstance}",1)
- <:#284,11088> hInstance = GetGlobalVar$("{GlobalInstance}")
- <:#284,11088> CECalcNow(hInstance,"{Form}",&Answer)
- <:#284,11088> Return Answer;
- <:#284,11088> Break;
- <:#284,11088>
- <:#284,11088>
- <:#284,11088> Case 0
- <:#284,11088> ' destroy the instance of the sheet and free the global var and libid
- <:#284,11088> AllocGlobalVar("{GlobalInstance}",1)
- <:#284,11088> AllocGlobalVar("{Mac}LibId",1)
- <:#284,11088> hInstance = GetGlobalVar$("{GlobalInstance}")
- <:#284,11088> LibId = GetGlobalVar$("{Mac}LibId")
- <:#284,11088> If hInstance
- <:#284,11088> CEDestroyInstance(hInstance)
- <:#284,11088> DllFreeLib(Libid)
- <:#284,11088> Endif
- <:#284,11088> FreeGlobalVar("{GlobalInstance}")
- <:#284,11088> FreeGlobalVar("{Mac}LibId")
- <:#284,11088> Break;
- <:#284,11088>
- <:#284,11088> Default
- <:#284,11088>EndSwitch
- <:#284,11088>End Function
- <:#284,11088>
- <:#284,11088>
- <:#284,11088>
- <:#284,11088>
- <:#284,11088>
- @Subhead@<:#284,11088>Function FontDlg(Action, Hdlg, id)
- <:#284,11088>' 1 Create a font and allocvar
- <:#284,11088>' 2 Return the handle of the create font
- <:#284,11088>' 3 Set the id specified to the font
- <:#284,11088>' 4 Freeglobalvar and delete created object
- <:#284,11088>
- @Outline2@<:#568,11088>define CreateFontDLG() DllCall("gdi,CreateFont,HHHHHHHHHHHHHHC", %1, %2, %3, %4, %5, %6, %7, %8, %9, %10, %11, %12, %13, %14)
- @Outline2@<:#284,11088>define DeleteObjectDLG(handle) DllCall("gdi,DeleteObject,HH", %1)
- @Outline2@<:#568,11088>define SendMessageDLG(hwnd, msg, wpara, lparm) DllCall("user,SendMessage,HHHHJ", %1, %2, %3, %4)
- @Outline2@<:#284,11088>
- @Outline2@<:#284,11088>Mac = GetRunningMacroFile$()
- @Outline2@<:#284,11088>
- <:#284,11088>Switch Action
- <:#284,11088> Case 1 ' Create the font and store it
- @Outline2@<:#284,11088> Font = CreateFontDLG(13, 0, 0, 0, 400, 0, 0, 0, 0, 0, 0, 0, 32, "Helv")
- <:#284,11088> AllocGlobalVar("{Mac}FontHandle",1)
- <:#284,11088> If Font
- <:#284,11088> SetGlobalVar("{Mac}FontHandle",Font)
- <:#284,11088> Return Font
- <:#284,11088> Else
- <:#284,11088> Return 0; ' no font
- <:#284,11088> Endif
- <:#284,11088> Break;
- <:#284,11088> Case 2 ' Return the handle to the font
- <:#284,11088> Handle = GetGlobalVar$("{Mac}FontHandle")
- <:#284,11088> If Handle
- <:#284,11088> Return Handle
- <:#284,11088> Else
- <:#284,11088> Return 0
- <:#284,11088> Endif
- <:#284,11088>
- <:#284,11088> Case 3 ' Set the id to the font
- <:#284,11088> Handle = GetGlobalVar$("{Mac}FontHandle")
- <:#284,11088> If Handle
- <:#284,11088> IdControl = GetDlgITem(Hdlg, id)
- <:#284,11088> SendMessageDlg(idControl, 0x30, Handle, 0)
- <:#284,11088> Return 1
- <:#284,11088> Else
- <:#284,11088> Return 0
- <:#284,11088> Endif
- <:#284,11088> Break;
- <:#284,11088>
- <:#284,11088> Case 4 ' Delete the font and clear the var
- <:#284,11088> Handle = GetGlobalVar$("{Mac}FontHandle")
- <:#284,11088> If Handle
- <:#284,11088> DeleteObjectDLG(Handle)
- <:#284,11088> Stat = 1
- <:#284,11088> Else
- <:#284,11088> Stat = 0
- <:#284,11088> Endif
- <:#284,11088> FreeGlobalVar("{Mac}FontHandle")
- <:#284,11088> Return Stat
- <:#284,11088> Default
- <:#284,11088> Message("Fontdlg received an invalid parameter {Action}")
- <:#284,11088>EndSwitch
- <:#284,11088>
- <:#284,11088>End Function
- <:#284,11088>
- @Subhead@<:#284,11088>
- <:#284,11088>
- <:#284,11088>
- <:#284,11088>
- <:#284,11088>
- <:#284,11088>
- <:#284,11088>DIALOG Deprec
- <:#284,11088>-2134376448 23 78 50 158 159 "" "" "Dialog Title"
- <:#284,11088>FONT 8 "Helv"
- <:#284,11088>60 28 33 12 8001 1350631552 "edit" "" 0
- <:#284,11088>60 42 33 12 8002 1350631552 "edit" "" 0
- <:#284,11088>60 56 33 12 8003 1350631552 "edit" "" 0
- <:#284,11088>60 70 33 12 8004 1350631552 "edit" "" 0
- <:#284,11088>60 84 33 12 8005 1350631552 "edit" "" 0
- <:#284,11088>60 98 33 12 8006 1350631552 "edit" "" 0
- <:#284,11088>60 112 33 12 8007 1350631552 "edit" "" 0
- <:#284,11088>60 126 33 12 8008 1350631552 "edit" "" 0
- <:#284,11088>60 140 33 12 8009 1350631552 "edit" "" 0
- <:#284,11088>114 3 40 14 1 1342373889 "button" "OK" 0
- <:#284,11088>114 19 40 14 3 1342373888 "button" "Copy" 0
- <:#284,11088>106 52 38 8 8010 1342177282 "static" "" 0
- <:#284,11088>98 39 57 29 20 1342177287 "button" "Answer" 0
- <:#284,11088>4 2 103 24 1000 1342177280 "static" "" 0
- <:#284,11088>4 30 56 8 1001 1342177280 "static" "value1text" 0
- <:#284,11088>4 44 56 8 1002 1342177280 "static" "value2text" 0
- <:#284,11088>4 58 56 8 1003 1342177280 "static" "value3text" 0
- <:#284,11088>4 72 56 8 1004 1342177280 "static" "value4text" 0
- <:#284,11088>4 86 56 8 1005 1342177280 "static" "value5text" 0
- <:#284,11088>3 99 56 8 1006 1342177280 "static" "value6text" 0
- <:#284,11088>3 111 56 8 1007 1342177280 "static" "value7text" 0
- <:#284,11088>2 123 56 8 1008 1342177280 "static" "value8text" 0
- <:#284,11088>1 141 56 8 1009 1342177280 "static" "value9text" 0
- <:#284,11088>END DIALOG
- [Embedded]
- 00019011
-