diff --git a/Documentation.md b/Documentation.md
index c783e29..38557ff 100644
--- a/Documentation.md
+++ b/Documentation.md
@@ -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)
&RADIO( View ID,
@@ -565,6 +565,18 @@ Not available
+####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.
+
+
+Assembly | Applesoft |
---|
+X: WGClearPendingClick
+ |
+Not available
+ |
+
+
+
####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
Assembly | Applesoft |
---|
X: WGSetState
-A: new value
+PARAM0: new value
|
&SETV(value)
|
+####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.
+
+
+Assembly | Applesoft |
---|
+X: WGGetState
+On exit, the value is in PARAM0
+ |
+Not available
+ |
+
+
+
####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
+####WGResetView
+Deletes the selected view but does not erase or repaint anything. The ID is now available for use by a new view.
+
+
+Assembly | Applesoft |
---|
+X: WGResetView
+ |
+Not available
+ |
+
+
+
- - -
diff --git a/WeeGUI_MLI.s b/WeeGUI_MLI.s
index fc614fc..86ce176 100644
--- a/WeeGUI_MLI.s
+++ b/WeeGUI_MLI.s
@@ -73,5 +73,9 @@ WGSetContentWidth = 78
WGSetContentHeight = 80
WGStrokeRoundRect = 82
WGCreateRadio = 84
-WGReset = 86
+WGResetAll = 86
+WGGetState = 88
+WGPendingClick = 90
+WGClearPendingClick = 92
+WGResetView = 94
diff --git a/views.s b/views.s
index 9c3daf4..0a0bef2 100644
--- a/views.s
+++ b/views.s
@@ -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
diff --git a/weegui.dsk b/weegui.dsk
index 9237211..9563c88 100644
Binary files a/weegui.dsk and b/weegui.dsk differ
diff --git a/weegui.s b/weegui.s
index 03c586f..448de79 100644
--- a/weegui.s
+++ b/weegui.s
@@ -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
|