gui2: started working on SensorWatch for GUI2. Works so far.
This commit is contained in:
@@ -244,7 +244,8 @@ hLayoutVertically_setHeight:
|
||||
std Y+WIDGET_OFFS_HEIGHT_HI, r13
|
||||
push yl
|
||||
push yh
|
||||
mov yl, xl
|
||||
ldd r17, Y+WIDGET_OFFS_PACK
|
||||
mov yl, xl ; use parent
|
||||
mov yh, xh
|
||||
rcall Widget_PackSelfY ; R7:R6=new pos (r17, r18, r19, r20, r21)
|
||||
pop yh
|
||||
|
||||
@@ -129,11 +129,12 @@ Label_OnDraw:
|
||||
|
||||
bigcall Widget_Clear
|
||||
rcall labelWriteText
|
||||
|
||||
ldd r16, Y+OBJECT_OFFS_OPTS
|
||||
andi r16, (1<<WIDGET_OPTS_BORDER_BIT)
|
||||
breq Label_OnDraw_done
|
||||
bigcall Widget_DrawBorder
|
||||
|
||||
; DEBUG
|
||||
; ldd r16, Y+OBJECT_OFFS_OPTS
|
||||
; andi r16, (1<<WIDGET_OPTS_BORDER_BIT)
|
||||
; breq Label_OnDraw_done
|
||||
; bigcall Widget_DrawBorder
|
||||
|
||||
Label_OnDraw_done:
|
||||
ldd r16, Y+OBJECT_OFFS_FLAGS
|
||||
|
||||
@@ -258,7 +258,8 @@ vLayoutHorizontally_setWidth:
|
||||
std Y+WIDGET_OFFS_WIDTH_HI, r13
|
||||
push yl
|
||||
push yh
|
||||
mov yl, xl
|
||||
ldd r17, Y+WIDGET_OFFS_PACK
|
||||
mov yl, xl ; use parent
|
||||
mov yh, xh
|
||||
rcall Widget_PackSelfX ; R5:R4=new pos (r17, r18, r19, r20, r21)
|
||||
pop yh
|
||||
|
||||
@@ -519,6 +519,11 @@ Widget_OnDraw:
|
||||
; clear widget background
|
||||
rcall Widget_Clear ; (any, !Y)
|
||||
|
||||
ldd r17, Y+OBJECT_OFFS_OPTS
|
||||
sbrs r17, WIDGET_OPTS_BORDER_BIT
|
||||
rjmp Widget_OnDraw_ret
|
||||
bigcall Widget_DrawBorder
|
||||
|
||||
Widget_OnDraw_ret:
|
||||
sec
|
||||
ret
|
||||
@@ -1051,13 +1056,13 @@ Widget_CalcStringWidthSDRAM_done:
|
||||
;
|
||||
; @param Y address of widget
|
||||
; @param R13:R12 width of object to align
|
||||
; @param r17 pack mode (see @ref WIDGET_PACK_BEGIN)
|
||||
; @return R5:R4 X
|
||||
; @clobbers r17, r18, r19, r20, r21
|
||||
|
||||
Widget_PackSelfX:
|
||||
ldd r18, Y+WIDGET_OFFS_WIDTH_LO
|
||||
ldd r19, Y+WIDGET_OFFS_WIDTH_HI
|
||||
ldd r17, Y+WIDGET_OFFS_PACK
|
||||
andi r17, 3 ; WIDGET_PACK_HSELF0_BIT = 0, no shift necessary
|
||||
rcall widgetPack ; r21:r20=new pos (r17, r18, r19)
|
||||
mov r4, r20
|
||||
@@ -1074,13 +1079,13 @@ Widget_PackSelfX:
|
||||
;
|
||||
; @param Y address of widget
|
||||
; @param R13:R12 height of object to align
|
||||
; @param r17 pack mode (see @ref WIDGET_PACK_BEGIN)
|
||||
; @return R7:R6 Y
|
||||
; @clobbers r17, r18, r19, r20, r21
|
||||
|
||||
Widget_PackSelfY:
|
||||
ldd r18, Y+WIDGET_OFFS_HEIGHT_LO
|
||||
ldd r19, Y+WIDGET_OFFS_HEIGHT_HI
|
||||
ldd r17, Y+WIDGET_OFFS_PACK
|
||||
lsr r17 ; WIDGET_PACK_VSELF0_BIT = 2 -> shift 2 times right
|
||||
lsr r17
|
||||
andi r17, 3
|
||||
|
||||
Reference in New Issue
Block a user