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: Configuration block consists of five bytes:
0: View ID (0-15) 0: View ID (0-15)
1: X position of checkbox 1: X position of radio button
2: Y position of checkbox 2: Y position of radio button
3: Pointer to null-terminated string label (LSB) 3: Pointer to null-terminated string label (LSB)
4: Pointer to null-terminated string label (MSB) 4: Pointer to null-terminated string label (MSB)
</pre></td><td><pre> </pre></td><td><pre>
&RADIO( View ID, &RADIO( View ID,
@ -565,6 +565,18 @@ Not available
</table> </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 ####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. 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%"> <table width="100%">
<tr><th>Assembly</th><th>Applesoft</th></tr><tr><td><pre> <tr><th>Assembly</th><th>Applesoft</th></tr><tr><td><pre>
X: WGSetState X: WGSetState
A: new value PARAM0: new value
</td><td> </td><td>
&SETV(value) &SETV(value)
</td></tr> </td></tr>
</table> </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 ####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. 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> </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> <br><br>
- - - - - -

View File

@ -73,5 +73,9 @@ WGSetContentWidth = 78
WGSetContentHeight = 80 WGSetContentHeight = 80
WGStrokeRoundRect = 82 WGStrokeRoundRect = 82
WGCreateRadio = 84 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 ; WGCreateButton
; Creates a new button ; 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 ; WGPaintView
; Paints the current view ; Paints the current view
@ -995,11 +1028,14 @@ WGViewFocusAction_toggleRadioLoopNext:
dec dec
bpl WGViewFocusAction_toggleRadioLoop bpl WGViewFocusAction_toggleRadioLoop
LDY_FOCUSVIEW 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: 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 eor #%00000001
WGViewFocusAction_setStateAndRedraw:
sta WG_VIEWRECORDS+9,y sta WG_VIEWRECORDS+9,y
lda WG_FOCUSVIEW lda WG_FOCUSVIEW
jsr WGSelectView jsr WGSelectView
@ -1164,6 +1200,16 @@ WGPendingClick_done:
rts rts
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; WGClearPendingClick
; clear mouse coordinates
;
WGClearPendingClick:
stz WG_MOUSECLICK_X
dec WG_MOUSECLICK_X
rts
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; WGViewSetTitle ; WGViewSetTitle
; Sets the title of the active view ; Sets the title of the active view

Binary file not shown.

View File

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