gui2: added mclayout (matrix layout ordering by column).

This commit is contained in:
Martin Preuss
2026-04-12 01:31:23 +02:00
parent 7d556c0f26
commit 66be348ecd
6 changed files with 1152 additions and 285 deletions

View File

@@ -268,6 +268,207 @@ DEBUG_STOP3:
DEBUG_DUMPCTX:
lds yl, guiApp
lds yh, guiApp+1
bigcall GuiApp_GetRootWindow
mov yl, r18
mov yh, r19
bigcall Widget_Clear
clr r4
clr r5
clr r6
clr r7
adiw xh:xl, LAYOUT_CTX_OFFS_NUMITEMS
ld r24, X+
DEBUG_DUMPCTX_loop:
clr r4
clr r5
rcall DEBUG_DUMPCTXITEM
ldi r16, 20
clr r17
add r6, r16
adc r7, r17
dec r24
brne DEBUG_DUMPCTX_loop
bigjmp DEBUG3
DEBUG_DUMPONEITEM:
lds yl, guiApp
lds yh, guiApp+1
bigcall GuiApp_GetRootWindow
mov yl, r18
mov yh, r19
bigcall Widget_Clear
clr r4
clr r5
clr r6
clr r7
rjmp DEBUG_DUMPCTXITEM
DEBUG_DUMPCTXITEM:
adiw xh:xl, LAYOUT_CTX_ITEM_OFFS_POS_LO
ld r20, X+ ; pos
ld r21, X+
rcall DEBUG_WRITE_INT
ldi r16, 65
clr r17
add r4, r16
adc r5, r17
ld r20, X+ ; size
ld r21, X+
rcall DEBUG_WRITE_INT
ldi r16, 65
clr r17
add r4, r16
adc r5, r17
ld r20, X+ ; flags
clr r21
rcall DEBUG_WRITE_INT
ldi r16, 65
clr r17
add r4, r16
adc r5, r17
ret
DEBUG_DUMPWDG:
lds yl, guiApp
lds yh, guiApp+1
bigcall GuiApp_GetRootWindow
mov yl, r18
mov yh, r19
push zl
push zh
bigcall Widget_Clear
pop zh
pop zl
clr r4
clr r5
clr r6
clr r7
push yl
push yh
mov yl, zl
mov yh, zh
bigcall OBJ_GetFirstChild
pop yh
pop yl
mov zl, r18
mov zh, r19
ldi r24, 11
DEBUG_DUMPWDG_loop:
rcall DEBUG_DUMPCWDG
ldi r16, 20
clr r17
add r6, r16
adc r7, r17
dec r24
breq DEBUG_DUMPWDG_end
push yl
push yh
mov yl, zl
mov yh, zh
bigcall OBJ_GetNext
pop yh
pop yl
mov zl, r18
mov zh, r19
brcc DEBUG_DUMPWDG_end
rjmp DEBUG_DUMPWDG_loop
DEBUG_DUMPWDG_end:
bigjmp DEBUG3
DEBUG_DUMPCWDG:
clr r4
clr r5
ldd r20, Z+WIDGET_OFFS_X_LO
ldd r21, Z+WIDGET_OFFS_X_HI
rcall DEBUG_WRITE_INT
ldi r16, 65
clr r17
add r4, r16
adc r5, r17
ldd r20, Z+WIDGET_OFFS_Y_LO
ldd r21, Z+WIDGET_OFFS_Y_HI
rcall DEBUG_WRITE_INT
ldi r16, 65
clr r17
add r4, r16
adc r5, r17
ldd r20, Z+WIDGET_OFFS_WIDTH_LO
ldd r21, Z+WIDGET_OFFS_WIDTH_HI
rcall DEBUG_WRITE_INT
ldi r16, 65
clr r17
add r4, r16
adc r5, r17
ldd r20, Z+WIDGET_OFFS_HEIGHT_LO
ldd r21, Z+WIDGET_OFFS_HEIGHT_HI
rcall DEBUG_WRITE_INT
ldi r16, 65
clr r17
add r4, r16
adc r5, r17
ldd r20, Z+WIDGET_OFFS_TMP_LO
ldd r21, Z+WIDGET_OFFS_TMP_HI
rcall DEBUG_WRITE_INT
ldi r16, 65
clr r17
add r4, r16
adc r5, r17
ret
; @param r21:r20: number
DEBUG_WRITE_INT:
push r24
push zl
push zh
ldi r24, 0
push xl
push xh
bigcall IntToAscii ; X=pointer to text
push r4
push r5
bigcall Widget_DrawTextRam ; (any, !Y)
pop r5
pop r4
pop xh
pop xl
pop zh
pop zl
pop r24
ret
; @end
Debug_Style:
.dw DISPLAY_COLOR_BLACK ; frontCol_norm
.dw DISPLAY_COLOR_GREEN ; backCol_norm
@@ -334,6 +535,7 @@ GUI2_MODULE_BEGIN:
.include "modules/lcd2/gui2/aqhome/sensorwatch.asm"
.include "modules/lcd2/gui2/base/layout2.asm"
.include "modules/lcd2/gui2/base/hlayout2.asm"
.include "modules/lcd2/gui2/base/mclayout.asm"
GUI2_MODULE_END:
.equ MODULE_SIZE_GUI2 = GUI2_MODULE_END-GUI2_MODULE_BEGIN

View File

@@ -96,9 +96,9 @@ ClimateWin_Init_ret:
climateWinCreateSensorWatches:
ldi r16, 0 ; OPTS
ldi r17, (WIDGET_PACK_FILLED<<WIDGET_PACK_HSELF0_BIT) | (WIDGET_PACK_FILLED<<WIDGET_PACK_VSELF0_BIT) ; PACK
ldi r20, HLAYOUT_MODE_SPREAD
; ldi r20, HLAYOUT_MODE_EXPAND
bigcall HLayout_new
; ldi r20, HLAYOUT2_MODE_SPREAD
ldi r20, HLAYOUT2_MODE_EXPAND
bigcall HLayout2_new
brcc climateWinCreateSensorWatches_ret
mov xl, yl ; use HLayout as parent

View File

@@ -152,9 +152,8 @@ netStatWinCreateContent:
; create MLayout
ldi r16, 0 ; OPTS
ldi r17, (WIDGET_PACK_FILLED<<WIDGET_PACK_HSELF0_BIT) | (WIDGET_PACK_FILLED<<WIDGET_PACK_VSELF0_BIT) ; PACK
ldi r20, MLAYOUT_MODE_COLUMNS
ldi r21, 2 ; columns per row
bigcall MLayout_new
ldi r20, 2 ; columns per row
bigcall MCLayout_new
brcc netStatWinCreateContent_ret
mov xl, yl ; use MLayout as parent