refactor out SimulateClick

This commit is contained in:
4am 2018-04-02 15:26:05 -04:00
parent 84cafe4c7f
commit 94b54cf04e
3 changed files with 27 additions and 20 deletions

View File

@ -9,6 +9,7 @@
; - CreateButton
; - PaintTitleBar
; - PrintAt
; - SimulateClick
;
; Public constants
; - kStringOK
@ -95,18 +96,18 @@ PaintTitleBar
ldx #WGSetGlobalCursor
jsr WeeGUI
ldx #WGPlot
lda .stringTitle,y
lda kStringGlobalTitle,y
jsr WeeGUI
dey
bpl -
ldx #WGSyncGlobalCursor
jmp WeeGUI
.stringTitle
kStringGlobalTitle
!raw " "
!byte 16
!byte 16 ; inverse P
!raw "itch "
!byte 4
!byte 4 ; inverse D
!raw "ark ",0
}
@ -135,3 +136,23 @@ PrintAt
ldx #WGPrint
jmp WeeGUI
}
;------------------------------------------------------------------------------
; SimulateClick
; select, focus, activate, and unfocus a WeeGUI view
;
; in: WeeGUI loaded and initialized
; A contains WeeGUI view ID
; out: X clobbered
;------------------------------------------------------------------------------
!zone {
SimulateClick
ldx #WGSelectView
jsr WeeGUI
ldx #WGViewFocus
jsr WeeGUI
ldx #WGViewFocusAction
jsr WeeGUI
ldx #WGViewUnfocus
jmp WeeGUI
}

View File

@ -99,15 +99,8 @@ HandleKey
tax
ldy gViewInUse,x
beq .notFound
ldx #WGSelectView
jsr WeeGUI
.focusAndDoAction
ldx #WGViewFocus
jsr WeeGUI
ldx #WGViewFocusAction
jsr WeeGUI
ldx #WGViewUnfocus
jmp WeeGUI
jmp SimulateClick
.y
lda .xyzzy
cmp #1

View File

@ -127,14 +127,7 @@ HandleOptionsKey
jmp SoftBell
.foundKey
lda .keys+1,x
ldx #WGSelectView
jsr WeeGUI
ldx #WGViewFocus
jsr WeeGUI
ldx #WGViewFocusAction
jsr WeeGUI
ldx #WGViewUnfocus
jmp WeeGUI
jmp SimulateClick
callback_options_ok
jsr SetPrefByCheckbox