gui2: more work. SensorWatch doesn't fully work, yet (also red background).

This commit is contained in:
Martin Preuss
2026-03-12 00:37:44 +01:00
parent 092c667291
commit 2f570ea110
10 changed files with 454 additions and 57 deletions

View File

@@ -22,7 +22,7 @@
.equ VLABEL_VALUE = WIDGET_VALUE_NEXTFREE+0
.equ VLABEL_VALUE_NEXTFREE = VLABEL_VALUE+1
.equ VLABEL_VALUE_NEXTFREE = WIDGET_VALUE_NEXTFREE+1
@@ -93,6 +93,7 @@ ValueLabel_Init:
; @routine ValueLabel_OnSetValue @global
;
; @param Y address of widget
; @param X new value
; @return CFLAG set if signal handled
; @clobbers r17
@@ -103,6 +104,7 @@ ValueLabel_OnSetValue:
ldd r17, Y+OBJECT_OFFS_FLAGS
ori r17, (1<<WIDGET_FLAGS_DIRTY_BIT)
std Y+OBJECT_OFFS_FLAGS, r17
sec
ret
; @end
@@ -209,13 +211,17 @@ valueLabelWriteValue:
; @clobbers r8, r9, r10, r11, r12, r13, r14, r15, r16, r17, r18, r19, r20, r21, r22, r23, r24, r25
valueLabelAlignTextXY:
rcall valueLabelCalcTextWidth ; X=ptr to text in SDRAM, R13:R12=text width (r16, r17, r18)
rcall Widget_PackContentX ; R5:R4=X (r17, r18, r19, r20, r21)
rcall Widget_GetCharHeight ; R16=char height
mov r12, r16
clr r13
rcall Widget_PackContentY ; R7:R6=Y (r17, r18, r19, r20, r21)
rcall valueLabelCalcTextWidth ; X=ptr to text in SDRAM, R13:R12=text width (r16, r17, r18)
push xl
push xh
rcall Widget_PackContentX ; R5:R4=X (r17, r18, r19, r20, r21)
rcall Widget_GetCharHeight ; R16=char height
mov r12, r16
clr r13
rcall Widget_PackContentY ; R7:R6=Y (r17, r18, r19, r20, r21)
pop xh
pop xl
ret
; @end