gui2: more work (vlayout doesn't work, yet).

This commit is contained in:
Martin Preuss
2026-03-09 02:08:33 +01:00
parent 92efebccf1
commit 0758579b43
11 changed files with 657 additions and 523 deletions

View File

@@ -10,8 +10,6 @@
#ifndef AQH_AVR_GUI2_MAINWINDOW_ASM
#define AQH_AVR_GUI2_MAINWINDOW_ASM
; TODO: base on VLayout!
; ***************************************************************************
; defines
@@ -35,8 +33,8 @@
; @return CFLAG set of okay, cleared otherwise
; @return Y address of newly created object
; @param X parent widget
; @param r16 value for OBJECT_OFFS_OPTS_LO
; @param r17 value for OBJECT_OFFS_OPTS_HI
; @param r16 value for OBJECT_OFFS_OPTS
; @param r17 value for WIDGET_OFFS_PACK
; @param r21:r20 ressource id for title
; @clobbers any
@@ -62,6 +60,8 @@ MainWindow_new_ret:
;
; @param Y address of widget
; @param X parent widget (if any)
; @param r16 value for OBJECT_OFFS_OPTS
; @param r17 value for WIDGET_OFFS_PACK
; @param r21:r20 ressource id for title
; @clobbers r16, r17, X
@@ -81,14 +81,14 @@ MainWindow_Init:
; set style which has no spacing and no borders so needs no drawing because
; the children fill the screen completely
ldi r16, LOW(MainWindow_DefaultStyle)
ldi r16, LOW(MainWindow_DefaultStyle*2)
std Y+WIDGET_OFFS_STYLE_LO, r16
ldi r16, HIGH(MainWindow_DefaultStyle)
ldi r16, HIGH(MainWindow_DefaultStyle*2)
std Y+WIDGET_OFFS_STYLE_HI, r16
; create sub widgets
rcall mainWindowCreateTitleWidget
rcall mainWindowCreateContentWidget
; rcall mainWindowCreateContentWidget
ret
; @end
@@ -168,8 +168,9 @@ mainWindowCreateTitleWidget:
push yh
mov xl, yl
mov xh, yh
ldi r16, (1<<WIDGET_OPTSLO_FILLX_BIT)
ldi r17, (WIDGET_XALIGN_LEFT<<WIDGET_OPTSHI_CONTENT_XALIGN0_BIT) | (WIDGET_YALIGN_CENTER<<WIDGET_OPTSHI_CONTENT_YALIGN0_BIT)
ldi r16, 0
ldi r17, (WIDGET_PACK_FILLED<<WIDGET_PACK_HSELF0_BIT) | (WIDGET_PACK_BEGIN<<WIDGET_PACK_VSELF0_BIT) | \
(WIDGET_PACK_BEGIN <<WIDGET_PACK_HCONTENT0_BIT) | (WIDGET_PACK_CENTER<<WIDGET_PACK_VCONTENT0_BIT)
bigcall Label_new
brcc mainWindowCreateTitleWidget_done
; set style for title widget
@@ -199,9 +200,9 @@ mainWindowCreateContentWidget:
push yh
mov xl, yl
mov xh, yh
ldi r16, (1<<WIDGET_OPTSLO_FILLX_BIT) | (1<<WIDGET_OPTSLO_FILLY_BIT)
ldi r17, 0 ; opts hi
bigcall Widget_new
ldi r16, 0 ; OPTS
ldi r17, (WIDGET_PACK_FILLED<<WIDGET_PACK_HSELF0_BIT) | (WIDGET_PACK_FILLED<<WIDGET_PACK_VSELF0_BIT) ; PACK
bigcall VLayout_new
brcc mainWindowCreateContentWidget_done
; set style for title widget
ldi r16, LOW(MainWindow_ContentStyle*2)
@@ -223,7 +224,7 @@ mainWindowCreateContentWidget_done:
MainWindow_DefaultSignalmap:
; header
.dw VLayout_DefaultSignalmap ; next table to use
.dw VLayout_DefaultSignalmap*2 ; next table to use
; entries
.db 0, WIDGET_SIGNAL_DRAW, LOW(Widget_OnDraw), HIGH(Widget_OnDraw)
.db WIDGET_VALUE_DEFAULT_WIDTH, WIDGET_SIGNAL_GETVALUE, LOW(MainWindow_OnGetDefaultWidth), HIGH(MainWindow_OnGetDefaultWidth)