diff --git a/Documentation.md b/Documentation.md index 2f405a8..754bf61 100644 --- a/Documentation.md +++ b/Documentation.md @@ -732,13 +732,26 @@ Sets the currently selected view's value. For progress bar views, this is the pr
AssemblyApplesoft
 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. + + + +
AssemblyApplesoft
+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. diff --git a/WeeGUI_MLI.s b/WeeGUI_MLI.s index fc614fc..543d8f4 100644 --- a/WeeGUI_MLI.s +++ b/WeeGUI_MLI.s @@ -74,4 +74,5 @@ WGSetContentHeight = 80 WGStrokeRoundRect = 82 WGCreateRadio = 84 WGReset = 86 +WGGetState = 88 diff --git a/views.s b/views.s index 9c3daf4..30c8b53 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 diff --git a/weegui.dsk b/weegui.dsk index 9237211..94b7cdc 100644 Binary files a/weegui.dsk and b/weegui.dsk differ diff --git a/weegui.s b/weegui.s index 03c586f..386d7bd 100644 --- a/weegui.s +++ b/weegui.s @@ -77,6 +77,8 @@ WGEntryPointTable: .addr WGStrokeRoundRect .addr WGCreateRadio .addr WGReset +.addr WGGetState + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;