antoine-source/appleworksgs/WP/Src/Dlgstuff.aii
2023-03-04 03:45:20 +01:00

1 line
15 KiB
Plaintext
Executable File

load 'macros.dump'
include 'driver.equ'
include 'wp.equ'
;-----------------------------------------------
;
; Imported addresses
;
;-----------------------------------------------
IMPORT D_BLSelect
IMPORT W_GetMfString
IMPORT D_StringBuffer
;-----------------------------------------------
;
; Forward addresses and entries
;
;-----------------------------------------------
ENTRY W_dbNames
ENTRY W_DbDocStr
ENTRY W_DbDocTitle
ENTRY W_DispMergeDB
ENTRY W_DoLETextBox2
ENTRY W_FieldTitle
ENTRY W_FieldTstr
ENTRY W_WhichDB
ENTRY W_wholeStr
ENTRY W_allbutton
ENTRY W_def_replace
ENTRY W_def_search
ENTRY W_donebutton
ENTRY W_donestr
ENTRY W_dsCancelButton
ENTRY W_dsDrawItem
ENTRY W_dsOkButton
ENTRY W_findbutton
ENTRY W_findstr
ENTRY W_ignoreBox
ENTRY W_ignoreStr
ENTRY W_mfCancelButton
ENTRY W_mfDrawItem
ENTRY W_mfOkButton
ENTRY W_pmCancelStr
ENTRY W_pmOKstr
ENTRY W_pmSelItem
ENTRY W_repallstr
ENTRY W_replacebutton
ENTRY W_replaceEdit
ENTRY W_replaceTitle
ENTRY W_replaceTstr
ENTRY W_replacestr
ENTRY W_restartbutton
ENTRY W_restartstr
ENTRY W_searchEdit
ENTRY W_searchTitle
ENTRY W_searchTstr
ENTRY W_stOKbutton
ENTRY W_stOKstr
ENTRY W_stStatRect
ENTRY W_stStatText
ENTRY W_stStatTitle
ENTRY W_stStatTitleStr
ENTRY W_stStats
ENTRY W_stThingRect
ENTRY W_stThingText
ENTRY W_stThings
ENTRY W_thenbutton
ENTRY W_thenstr
ENTRY W_WhichDBlen
ENTRY W_WhichDBrect
ENTRY W_WhichDBtext
ENTRY W_wholeBox
********************************************************************
* Includes...
* Thursday, April 27, 1989 5:56:34 PM
********************************************************************
*--------------------------------------------------------------*
W_DispMergeDB PROC EXPORT
;Using W_MergeDlgData
input dialog:l,item:w
begin +b
spacelong
_GetPort
pushlong dialog
_SetPort
_PenNormal
pushlong #W_WhichDBtext
pushword >W_WhichDBlen
pushlong #W_WhichDBrect
pushword #1 ; centered
_LETextBox2
_SetPort
return
ENDP
*--------------------------------------------------------------*
W_mfDrawItem PROC EXPORT
;Using D_UtilData ; <<driver<<
;Using W_MergeDlgData
input listptr:l,item:w
begin +b
pushword #2
pushword #8
_Move
pushword item
jsl W_GetMfString
pushlong #D_StringBuffer+1
_DrawString
return
ENDP
*--------------------------------------------------------------*
W_dsDrawItem PROC EXPORT
;Using W_MergeDlgData
input listptr:l,item:w
local tmp:l
BEGIN +b
movelong W_dbNames,tmp
movelong [tmp],ax
movelong ax,tmp
lda item
asl a
asl a
tay
lda [tmp],y ; movelong [tmp]:y,tmp
tax
iny
iny
lda [tmp],y
stx tmp
sta tmp+2
Tool _HLock,in=(tmp:l)
Tool _Move,in=(#2:w,#8:w)
Tool _DrawString,in=([tmp]:l)
Tool _HUnLock,in=(tmp:l)
RETURN
ENDP
****************************************************************
W_pmSelItem PROC EXPORT
input listptr:l,item:w
begin +b
lda item ; If nothing is selected, select
bpl exit ; the last thing in the list
pushlong listptr
ldy #20 ; (offset to last item)
lda [listptr],y
dec a
pha
jsl D_BLSelect
exit return
ENDP
****************************************************************
*
* W_MergeDlgData
*
****************************************************************
W_MergeDlgData PROC EXPORT
;Using D_WindowData
;Using W_PMergeData
EXPORT W_DBsuffix
EXPORT W_NoDBs
EXPORT W_indexPtr
EXPORT W_MergeDlg
EXPORT W_mfOkButton
EXPORT W_mfCancelButton
EXPORT W_pmOKstr
EXPORT W_pmCancelStr
EXPORT W_FieldTitle
EXPORT W_FieldTstr
EXPORT W_WhichDB
EXPORT W_WhichDBrect
EXPORT W_WhichDBtext
EXPORT W_WhichDBname
EXPORT W_WhichDBlen
EXPORT W_mfBobList
EXPORT W_mfDialog
EXPORT W_mfNumItems
EXPORT W_DbSelectDlg
EXPORT W_dsOkButton
EXPORT W_dsCancelButton
EXPORT W_DbDocTitle
EXPORT W_DbDocStr
EXPORT W_dsBobList
EXPORT W_dsDialog
EXPORT W_dsNumItems
EXPORT W_dbNames
W_DBsuffix DC.B '(DB)'
W_NoDBs str 'There are no database windows open.'
W_indexPtr DS.B 4
*--------------------------------------------------------------*
* Dialog for selecting a merge field ;
*--------------------------------------------------------------*
W_MergeDlg
DC.W 30,190,145,450
DC.W 1
DC.L 0
DC.L W_mfOkButton
DC.L W_mfCancelButton
DC.L W_FieldTitle
DC.L W_WhichDB
DC.L 0
W_mfOkButton
DC.W 1 ; Item id
DC.W 97,152,110,228 ; Item bounds
DC.W $000A ; item type (Button)
DC.L W_pmOKstr ; item descriptor
DC.W 0 ; item value
DC.W 0 ; bit vector
DC.L 0 ; default color table
W_mfCancelButton
DC.W 2 ; Item id
DC.W 97,32,110,108 ; Item bounds
DC.W $000A ; item type (Button)
DC.L W_pmCancelStr ; item descriptor
DC.W 0 ; item value
DC.W 0 ; bit vector
DC.L 0 ; default color table
W_pmOKstr str 'OK'
W_pmCancelStr str 'Cancel'
W_FieldTitle
DC.W $100 ; Item id
DC.W 5,25,15,200 ; Item bounds
DC.W $800f ; Item type (StatText+Disable)
DC.L W_FieldTstr ; Item descriptor
DC.W 0 ; Item value
DC.W 0 ; default bit vector
DC.L 0 ; default color table
W_FieldTstr str 'Select a merge field:'
W_WhichDB
DC.W $200 ; Item id
W_WhichDBrect
DC.W 80,0,90,260 ; Item bounds
DC.W $8014 ; item type (UserItem+Disable)
DC.L W_DispMergeDB ; item descriptor
DC.W 0 ; item value
DC.W 0 ; bit vector
DC.L 0 ; default color table
W_WhichDBtext DC.B 'Database: '
W_WhichDBname DC.B 'Mailing.List '
W_WhichDBlen DC.W 22
W_mfBobList
W_mfDialog
DS.B 4 ; dialog pointer
DC.W 15,20,77,217 ; W_View box (W_Height%10 = 2)
DC.W 15,216,77,240 ; scroll bar box
W_mfNumItems
DC.W 8 ; # items in list
DC.W 10 ; item W_Height
DC.W 1 ; double-click item (OK)
DC.L W_mfDrawItem ; D_DrawProc
DC.L W_pmSelItem ; D_SelProc
DS.B 28 ; D_Reserved
*--------------------------------------------------------------*
* Dialog for selecting a database ;
*--------------------------------------------------------------*
W_DbSelectDlg
DC.W 50,190,135,450
DC.W 1
DC.L 0
DC.L W_dsOkButton
DC.L W_dsCancelButton
DC.L W_DbDocTitle
DC.L 0
W_dsOkButton
DC.W 1 ; Item id
DC.W 67,152,80,228 ; Item bounds
DC.W $000A ; item type (Button)
DC.L W_pmOKstr ; item descriptor
DC.W 0 ; item value
DC.W 0 ; bit vector
DC.L 0 ; default color table
W_dsCancelButton
DC.W 2 ; Item id
DC.W 67,32,80,108 ; Item bounds
DC.W $000A ; item type (Button)
DC.L W_pmCancelStr ; item descriptor
DC.W 0 ; item value
DC.W 0 ; bit vector
DC.L 0 ; default color table
W_DbDocTitle
DC.W $100 ; Item id
DC.W 5,25,15,200 ; Item bounds
DC.W $800f ; Item type (StatText+Disable)
DC.L W_DbDocStr ; Item descriptor
DC.W 0 ; Item value
DC.W 0 ; default bit vector
DC.L 0 ; default color table
W_DbDocStr str 'Select a database:'
W_dsBobList
W_dsDialog
DS.B 4 ; dialog pointer
DC.W 15,20,57,217 ; W_View box (W_Height%10 = 2)
DC.W 15,216,57,240 ; scroll bar box
W_dsNumItems
DC.W 0 ; # items in list
DC.W 10 ; item W_Height
DC.W 1 ; double-click item (OK)
DC.L W_dsDrawItem ; D_DrawProc
DC.L W_pmSelItem ; D_SelProc
DS.B 28 ; D_Reserved
W_dbNames
DS.B 4
ENDP
****************************************************************
W_StatData PROC EXPORT
EXPORT W_StatDlg
EXPORT W_stOKbutton
EXPORT W_stOKstr
EXPORT W_stStatTitle
EXPORT W_stStatTitleStr
EXPORT W_stThings
EXPORT W_stThingRect
EXPORT W_stStats
EXPORT W_stStatRect
EXPORT W_stThingText
EXPORT W_stThingEnd
EXPORT W_stStatText
EXPORT W_shiftTab
EXPORT W_stStatLen
EXPORT W_stThingLen
W_stStatLen equ 38
*--------------------------------------------------------------*
* The dialog template ;
*--------------------------------------------------------------*
W_StatDlg DC.W 30,235,125,405 ; window Q_Rect
DC.W 1 ; visible
DC.L 0 ; refcon -- who cares?
DC.L W_stStats ; Disabled items
DC.L W_stThings
DC.L W_stStatTitle
DC.L W_stOKbutton ; Button items
DC.L 0 ; That's it!
*--------------------------------------------------------------*
W_stOKbutton DC.W 1 ; Item id
DC.W 75,35,88,135 ; Item bounds
DC.W $000A ; item type (Button)
DC.L W_stOKstr ; item descriptor
DC.W 0 ; item value
DC.W 0 ; bit vector
DC.L 0 ; default color table
W_stOKstr str 'OK'
*--------------------------------------------------------------*
W_stStatTitle DC.W $302 ; Item id
DC.W 3,10,14,200 ; Item bounds
DC.W $800f ; Item type (StatText+Disable)
DC.L W_stStatTitleStr ; Item descriptor
DC.W 0 ; Item value
DC.W 0 ; default bit vector
DC.L 0 ; default color table
W_stStatTitleStr str 'Document contents:'
W_stThings DC.W $1000 ; Item id
W_stThingRect DC.W 15,70,70,190 ; Item bounds
DC.W $8014 ; item type (UserItem+Disable)
DC.L W_DoLETextBox2 ; item descriptor
DC.W 0 ; item value
DC.W 0 ; bit vector
DC.L 0 ; default color table
W_stStats DC.W $1001 ; Item id
W_stStatRect DC.W 15,10,70,60 ; Item bounds
DC.W $8014 ; item type (UserItem+Disable)
DC.L W_DoLETextBox2 ; item descriptor
DC.W 0 ; item value
DC.W 0 ; bit vector
DC.L 0 ; default color table
*--------------------------------------------------------------*
* Other W_Stuff ;
*--------------------------------------------------------------*
W_stThingText DC.B $01 ; space things out a bit
DC.B 'X'
DC.W 1
DC.B 'character(s)'
DC.B $0d
DC.B 'word(s)'
DC.B $0d
DC.B 'line(s)'
DC.B $0d
DC.B 'paragraph(s)'
DC.B $0d
DC.B 'page(s)'
W_stThingEnd
W_stThingLen equ W_stThingEnd-W_stThingText
W_stStatText DC.B $01 ; space out a bit
DC.B 'X'
DC.W 1
DC.B '012345' ; 4
DC.B $0d
DC.B '123456' ; 11 ~0~
DC.B $0d
DC.B '234567' ; 18 -+-
DC.B $0d
DC.B '345678' ; 25 _|\_
DC.B $0d
DC.B '456789' ; 32
W_shiftTab DC.W 1,3,2,2,2,1,1,1,1,1,1,1,1,1,1,1 ;=U__,
DC.W 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 ;^ ^
ENDP
W_DoLETextBox2 PROC EXPORT
;Using W_StatData
input dlgptr:l,item:w
begin +b
spacelong
_GetPort
pushlong dlgptr
_SetPort
_PenNormal
cmpw item,#$1000
bne stats
pushlong #W_stThingText
pushword #W_stThingLen
pushlong #W_stThingRect
pushword #0 ; left justify
_LETextBox2
bra _ok_
stats pushlong #W_stStatText
pushword #W_stStatLen
pushlong #W_stStatRect
pushword #-1 ; right justify
_LETextBox2
_ok_ _SetPort
return
ENDP
****************************************************************
****************************************************************
W_FRdlgData PROC EXPORT
EXPORT W_FindRepDlg
EXPORT W_findbutton
EXPORT W_findstr
EXPORT W_replacebutton
EXPORT W_replacestr
EXPORT W_thenbutton
EXPORT W_thenstr
EXPORT W_allbutton
EXPORT W_repallstr
EXPORT W_restartbutton
EXPORT W_restartstr
EXPORT W_donebutton
EXPORT W_donestr
EXPORT W_searchEdit
EXPORT W_def_search
EXPORT W_replaceEdit
EXPORT W_def_replace
EXPORT W_ignoreBox
EXPORT W_ignoreValue
EXPORT W_ignoreStr
EXPORT W_wholeBox
EXPORT W_wholeValue
EXPORT W_wholeStr
EXPORT W_searchTitle
EXPORT W_searchTstr
EXPORT W_replaceTitle
EXPORT W_replaceTstr
W_FindRepDlg
DC.W 106,25,195,615 ; window bounds
DC.W 1 ; yes, it's visible
DC.L 0 ; refcon -- who cares?
DC.L W_searchEdit ; Q_Line edit items
DC.L W_replaceEdit
DC.L W_ignoreBox ; Check items
DC.L W_wholeBox
DC.L W_searchTitle ; Disabled items
DC.L W_replaceTitle
DC.L W_findbutton ; Button items
DC.L W_replacebutton
DC.L W_thenbutton
DC.L W_allbutton
DC.L W_restartbutton
DC.L W_donebutton
DC.L 0 ; No more!
*--------------------------------------------------------------*
W_findbutton
DC.W 1 ; Item id
DC.W 55,15,68,165 ; Item bounds
DC.W $000A ; item type (Button)
DC.L W_findstr ; item descriptor
DC.W 0 ; item value
DC.W 0 ; bit vector
DC.L 0 ; default color table
W_findstr str 'Find next'
W_replacebutton
DC.W 2 ; Item id
DC.W 72,15,85,165 ; Item bounds
DC.W $000A ; item type (Button)
DC.L W_replacestr ; item descriptor
DC.W 0 ; item value
DC.W 0 ; bit vector
DC.L 0 ; default color table
W_replacestr str 'Replace'
W_thenbutton
DC.W 3 ; Item id
DC.W 55,200,68,350 ; Item bounds
DC.W $000A ; item type (Button)
DC.L W_thenstr ; item descriptor
DC.W 0 ; item value
DC.W 0 ; bit vector
DC.L 0 ; default color table
W_thenstr str 'Replace, then find'
W_allbutton
DC.W 4 ; Item id
DC.W 72,200,85,350 ; Item bounds
DC.W $000A ; item type (Button)
DC.L W_repallstr ; item descriptor
DC.W 0 ; item value
DC.W 0 ; bit vector
DC.L 0 ; default color table
W_repallstr str 'Replace all'
W_restartbutton
DC.W 5 ; Item id
DC.W 55,425,68,575 ; Item bounds
DC.W $000A ; item type (Button)
DC.L W_restartstr ; item descriptor
DC.W 0 ; item value
DC.W 0 ; bit vector
DC.L 0 ; default color table
W_restartstr str 'Go to beginning'
W_donebutton
DC.W 6 ; Item id
DC.W 72,425,85,575 ; Item bounds
DC.W $000A ; item type (Button)
DC.L W_donestr ; item descriptor
DC.W 0 ; item value
DC.W 0 ; bit vector
DC.L 0 ; default color table
W_donestr str 'Done'
*--------------------------------------------------------------*
W_searchEdit
DC.W $100 ; Item id
DC.W 4,120,17,575 ; Item bounds
DC.W $0011 ; item type (EditLine)
DC.L W_def_search ; item descriptor
DC.W 60 ; item value
DC.W 0 ; bit vector
DC.L 0 ; default color table
W_def_search str '' ; default string -- empty
DS.B 64 ; room for later defaults
W_replaceEdit
DC.W $101 ; Item id
DC.W 21,120,34,575 ; Item bounds
DC.W $0011 ; item type (EditLine)
DC.L W_def_replace ; item descriptor
DC.W 60 ; item value (max. lngth)
DC.W 0 ; bit vector
DC.L 0 ; default color table
W_def_replace str ''
DS.B 64 ; room for later defaults
*--------------------------------------------------------------*
W_ignoreBox
DC.W $202 ; Item id
DC.W 38,115,49,250 ; Item bounds
DC.W $000B ; item type (CheckItem)
DC.L W_ignoreStr ; item descriptor
W_ignoreValue
DC.W 1 ; item value
DC.W 0 ; bit vector
DC.L 0 ; default color table
W_ignoreStr str 'Ignore case'
W_wholeBox
DC.W $203 ; Item id
DC.W 38,350,49,495 ; Item bounds
DC.W $000B ; item type (CheckItem)
DC.L W_wholeStr ; item descriptor
W_wholeValue
DC.W 0 ; item value
DC.W 0 ; bit vector
DC.L 0 ; default color table
W_wholeStr str 'Whole word(s)'
*--------------------------------------------------------------*
W_searchTitle
DC.W $300 ; Item id
DC.W 6,15,17,145 ; Item bounds
DC.W $800f ; item type (StatText+Disable)
DC.L W_searchTstr ; item descriptor
DC.W 0 ; item value
DC.W 0 ; bit vector
DC.L 0 ; default color table
W_searchTstr str 'Search for:'
W_replaceTitle
DC.W $301 ; Item id
DC.W 23,15,34,145 ; Item bounds
DC.W $800f ; item type (StatText+Disable)
DC.L W_replaceTstr ; item descriptor
DC.W 0 ; item value
DC.W 0 ; bit vector
DC.L 0 ; default color table
W_replaceTstr str 'Replace with:'
ENDP
END