gui2: more work on layout code.

This commit is contained in:
Martin Preuss
2026-03-07 00:44:56 +01:00
parent 0af5aed2f6
commit 2cf4e414d2
5 changed files with 424 additions and 74 deletions

View File

@@ -216,6 +216,38 @@ Layout_AddToTmpOfFillXChildren_done:
; ---------------------------------------------------------------------------
; @routine LayoutCountExpandableChildren
;
; @param Y pointer to widget
; @param r22 mask for OBJECT_OFFS_OPTS_LO (e.g. 1<<WIDGET_OPTSLO_FILLX_BIT)
; @return r16 number of children with opt WIDGET_OPTSLO_FILLX_BIT
; @clobbers r17, r18, r19
LayoutCountExpandableChildren:
clr r16
push yl
push yh
bigcall OBJ_GetFirstChild
LayoutCountExpandableChildren_loop:
brcc LayoutCountExpandableChildren_done
mov yl, r18
mov yh, r19
ldd r17, Y+OBJECT_OFFS_OPTS_LO
and r17, r22
breq LayoutCountExpandableChildren_next
inc r16
LayoutCountExpandableChildren_next:
rcall OBJ_GetNext
rjmp LayoutCountExpandableChildren_loop
LayoutCountExpandableChildren_done:
pop yh
pop yl
ret
; @end