This commit is contained in:
blondie7575 2018-07-22 09:24:46 -05:00
commit a59dea9d11
5 changed files with 103 additions and 13 deletions

View File

@ -436,9 +436,9 @@ PARAM1: Pointer to configuration block (MSB)
Configuration block consists of five bytes:
0: View ID (0-15)
1: X position of checkbox
2: Y position of checkbox
3: Pointer to null-terminated string label (LSB)
1: X position of radio button
2: Y position of radio button
3: Pointer to null-terminated string label (LSB)
4: Pointer to null-terminated string label (MSB)
</pre></td><td><pre>
&RADIO( View ID,
@ -565,6 +565,18 @@ Not available
</table>
####WGClearPendingClick
Clear the currently pending click, if any. Most programs shouldn't need this, but you can use it to do your own low-level click handling if you wish.
<table width="100%">
<tr><th>Assembly</th><th>Applesoft</th></tr><tr><td><pre>
X: WGClearPendingClick
</td><td>
Not available
</td></tr>
</table>
####WGViewFocus
Focus is shifted to the currently selected view. This will highlight the view visually, as needed, and any affected views are redrawn as needed.
@ -732,13 +744,26 @@ Sets the currently selected view's value. For progress bar views, this is the pr
<table width="100%">
<tr><th>Assembly</th><th>Applesoft</th></tr><tr><td><pre>
X: WGSetState
A: new value
PARAM0: new value
</td><td>
&SETV(value)
</td></tr>
</table>
####WGGetState
Gets the currently selected view's value. For progress bar views, this is the progress value. For checkboxes and radio buttons, 1 is checked and 0 is unchecked.
<table width="100%">
<tr><th>Assembly</th><th>Applesoft</th></tr><tr><td><pre>
X: WGGetState
On exit, the value is in PARAM0
</td><td>
Not available
</td></tr>
</table>
####WGViewSetRawTitle
Sets the currently selected view's title to be rendered in raw bytes (or not). This allows some advanced tricks with using Mousetext and mixed inversion in view titles.
@ -1133,6 +1158,18 @@ Not available
</table>
####WGResetView
Deletes the selected view but does not erase or repaint anything. The ID is now available for use by a new view.
<table width="100%">
<tr><th>Assembly</th><th>Applesoft</th></tr><tr><td><pre>
X: WGResetView
</pre></td><td><pre>
Not available
</pre></td></tr>
</table>
<br><br>
- - -

View File

@ -73,5 +73,9 @@ WGSetContentWidth = 78
WGSetContentHeight = 80
WGStrokeRoundRect = 82
WGCreateRadio = 84
WGReset = 86
WGResetAll = 86
WGGetState = 88
WGPendingClick = 90
WGClearPendingClick = 92
WGResetView = 94

50
views.s
View File

@ -270,6 +270,27 @@ WGSetState_done:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; WGGetState
; Gets state field in view record
; on exit, PARAM0 contains the state value, stripped of the high
; bit
;
WGGetState:
SAVE_AY
LDY_ACTIVEVIEW
lda WG_VIEWRECORDS+9,y
and #%01111111
sta PARAM0
WGGetState_done:
RESTORE_AY
rts
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; WGCreateButton
; Creates a new button
@ -367,6 +388,18 @@ WGDeleteView_done:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; WGResetView
; Deletes the current view but does not erase or repaint anything
;
WGResetView:
SAVE_AX
LDX_ACTIVEVIEW
stz WG_VIEWRECORDS+2,x
RESTORE_AX
rts
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; WGPaintView
; Paints the current view
@ -995,11 +1028,14 @@ WGViewFocusAction_toggleRadioLoopNext:
dec
bpl WGViewFocusAction_toggleRadioLoop
LDY_FOCUSVIEW
; execution falls through here
lda WG_VIEWRECORDS+9,y ; Set the radio button's state and redraw
ora #%00000001
bra WGViewFocusAction_setStateAndRedraw
WGViewFocusAction_toggleCheckbox:
lda WG_VIEWRECORDS+9,y ; Change the checkbox's state and redraw
lda WG_VIEWRECORDS+9,y ; Toggle the checkbox's state and redraw
eor #%00000001
WGViewFocusAction_setStateAndRedraw:
sta WG_VIEWRECORDS+9,y
lda WG_FOCUSVIEW
jsr WGSelectView
@ -1164,6 +1200,16 @@ WGPendingClick_done:
rts
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; WGClearPendingClick
; clear mouse coordinates
;
WGClearPendingClick:
stz WG_MOUSECLICK_X
dec WG_MOUSECLICK_X
rts
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; WGViewSetTitle
; Sets the title of the active view

Binary file not shown.

View File

@ -76,8 +76,11 @@ WGEntryPointTable:
.addr WGSetContentHeight
.addr WGStrokeRoundRect
.addr WGCreateRadio
.addr WGReset
.addr WGResetAll
.addr WGGetState
.addr WGPendingClick
.addr WGClearPendingClick
.addr WGResetView
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; WGInit
@ -97,16 +100,16 @@ WGInit:
RESTORE_AXY
jmp WGReset
jmp WGResetAll
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; WGReset
; Reset views and strings. Called from WGInit during app startup.
; WGResetAll
; Reset all views and strings. Called from WGInit during app startup.
; Can also be called at any time to "start over" with no views.
; (Does not clear screen or repaint.)
;
WGReset:
WGResetAll:
SAVE_AXY
ldy #15 ; Clear our block allocators