1 line
12 KiB
NASM
1 line
12 KiB
NASM
|
keep WINDOWS
****************************************************************
* ChemiGS *
****************************************************************
* A Drawing Program for Chemical Structures *
* (c) 1992-93 by Urs Hochstrasser *
* Buendtenweg 6 *
* 5105 AUENSTEIN (SWITZERLAND) *
****************************************************************
* Module WINDOWS
****************************************************************
*
* USES ...
*
mcopy windows.macros
copy equates.asm
****************************************************************
*
* Window stuff
*
DrawToolWin start Tool window content draw defProc
using Globals
phd save caller's DP
phb save caller's Data Bank
phk Data Bank := Pgm Bank
plb
* ph4 #0
* ~LoadResource #rPicture,#kToolPicID
* pl4 toolPic
* ~DrawPicture toolPic,#destRect
~DrawControls gToolWin
lda gToolID
jsl HiliteSelection
plb restore caller's Data Bank
pld restore caller's DP
rtl
*ToolPic ds 4
*destRect dc i2'0' top 13
* dc i2'0' left 2
* dc i2'179' bottom 31 45 156
* dc i2'64' right 512 626
UpdateToolWin entry
~BeginUpdate gToolWin
jsl DrawToolWin
~EndUpdate gToolWin
rts
HiliteSelection entry
* ---------------------------------------
* Input : Tool Number in A
* Output: none
* Action: Invert Tool in Toolbar
* ---------------------------------------
stz xOffset initialize x offset for tool hilite
cmp #11
bcc left
ldy #32 it's in the right column
sty xOffset
sec
sbc #11
left asl a Tool number * 16 -> y coordinate
asl a
asl a
asl a
clc *** New:
adc TBOffset *** New: add title Bar offset
sta yOffset
clc
adc #15 hilight is 15 pixels high
sta bottom
lda xOffset
clc
adc #30 ...and 30 wide
sta right
~InvertRect #myRect
rtl
myrect anop
yOffset ds 2
xOffset ds 2
bottom ds 2
right ds 2
end
DrawEaster start
using Globals
~BeginUpdate gEasterWin
~DrawControls gEasterWin
~EndUpdate gEasterWin
rtl
end
DrawDataContent start Data Window content draw defProc
using Globals
phd save caller's DP
phb save caller's Data Bank
phk Data Bank := Pgm Bank
plb
jsr displayIt in 'TOOLS'
plb restore caller's Data Bank
pld restore caller's DP
rtl
end
DrawInfoBar start
using Globals
theWindow equ 6 Offset to the infoBar owner window
infoRefCon equ theWindow+4 Offset to the window's infoBarRefCon
infoRect equ infoRefCon+4 Offset to the infoBar's enclosing RECT
phd save current DP
tsc
tcd switch to DP in stack
ldy #0 *** new: save InfoRect into gInfoRect
lda [14],y
sta gInfoRect
iny
iny
lda [14],y
sta gInfoRect+2
iny
iny
lda [14],y
sta gInfoRect+4
iny
iny
lda [14],y
sta gInfoRect+6 *** end new
* ------------------- individual routine -----------------
* ph4 #0
* ~LoadResource #rPicture,#kButtonBarID
* pl4 btnPic besser in InfoRefCon speichern
* ~DrawPicture btnPic,#btnRect
* ------------------- Remove input parameters from stack
ply pull original DP, save in y
lda 2,s Move RTL addr down over inp parms
sta 14,s
lda 0,s
sta 12,s
tsc now move SP over inp parms
clc
adc #12 add number input parm bytes to SP
tcs and reset stack
tya restore original DP
tcd
rtl back to Window Mgr
btnRect dc i2'13,2,30,552' destRect for Button Bar (0,0,16,549)
btnPic ds 4
end
HandleInfo start
* using Globals
* ~StartInfoDrawing #gInfoRect,gDataWin
* ~EndInfoDrawing
rts
end
HandleRuler start
using Globals
* ~StartDrawing gEditWindow
move4 gMainEvt+owhere,myPoint
~GlobalToLocal #myPoint
pha
~PtInRect #myPoint,#XRect
pla
beq l1
~InvertRect #XRect
l1 pha
~PtInRect #myPoint,#OKRect
pla
beq l2
~InvertRect #OKRect
l2 pha
~PtInRect #myPoint,#EditRect
pla
beq l3
~InvertRect #EditRect
l3 pha
~PtInRect #myPoint,#DirRect
pla
beq l4
~InvertRect #DirRect
l4 pha
~PtInRect #myPoint,#PSRect
pla
beq l5
~InvertRect #PSRect
l5 pha
~PtInRect #myPoint,#CRect
pla
beq l6
~InvertRect #CRect
l6 pha
~PtInRect #myPoint,#HRect
pla
beq l7
~InvertRect #HRect
l7 pha
~PtInRect #myPoint,#O
|