gui2: added default Layout handler to widget class.

This commit is contained in:
Martin Preuss
2026-03-07 01:17:38 +01:00
parent 283738f4f3
commit f88745c3fd

View File

@@ -206,6 +206,11 @@ Widget_Init_setDefaultSize:
breq Widget_Init_ret
bigcall OBJ_AddChild ; (r18, r19)
; preset flags
ldd r16, Y+OBJECT_OFFS_FLAGS
sbr r16, (1<<WIDGET_FLAGS_DIRTY_BIT) | (1<<WIDGET_FLAGS_LAYOUT_BIT)
std Y+OBJECT_OFFS_FLAGS, r16
Widget_Init_ret:
ret
; @end
@@ -360,6 +365,23 @@ Widget_OnDrawNop:
; ---------------------------------------------------------------------------
; @routine Widget_OnLayout @global
;
; @param Y address of widget
; @return CFLAG set if signal handled
; @clobbers any, !Y
Widget_OnLayout:
ldd r17, Y+OBJECT_OFFS_FLAGS
; only clear layout bit
cbr r17, (1<<WIDGET_FLAGS_LAYOUT_BIT)
std Y+OBJECT_OFFS_FLAGS, r17
sec
ret
; @end
; ---------------------------------------------------------------------------
; @routine Widget_OnGetValue @global
;
@@ -1002,6 +1024,7 @@ Widget_DefaultSignalmap:
.dw Object_DefaultSignalmap ; next table to use
; entries
.db 0, WIDGET_SIGNAL_DRAW, LOW(Widget_OnDraw), HIGH(Widget_OnDraw)
.db 0, WIDGET_SIGNAL_LAYOUT, LOW(Widget_OnLayout), HIGH(Widget_OnLayout)
.db 0, WIDGET_SIGNAL_GETVALUE, LOW(Widget_OnGetValue), HIGH(Widget_OnGetValue) ; handle any value here
.db 0, 0, 0, 0 ; end of table