diff --git a/avr/devices/c03/test/main.asm b/avr/devices/c03/test/main.asm index ec11125..4f2248a 100644 --- a/avr/devices/c03/test/main.asm +++ b/avr/devices/c03/test/main.asm @@ -287,6 +287,11 @@ test: .include "modules/lcd2/gui2/base/object.asm" .include "modules/lcd2/gui2/base/widget.asm" .include "modules/lcd2/gui2/base/guiapp.asm" +.include "modules/lcd2/gui2/base/mainwindow.asm" +.include "modules/lcd2/gui2/base/rootwindow.asm" +.include "modules/lcd2/gui2/base/label.asm" +.include "modules/lcd2/gui2/base/layout.asm" +.include "modules/lcd2/gui2/base/hlayout.asm" diff --git a/avr/modules/lcd2/gui2/base/hlayout.asm b/avr/modules/lcd2/gui2/base/hlayout.asm new file mode 100644 index 0000000..f59b145 --- /dev/null +++ b/avr/modules/lcd2/gui2/base/hlayout.asm @@ -0,0 +1,344 @@ +; *************************************************************************** +; copyright : (C) 2026 by Martin Preuss +; email : martin@libchipcard.de +; +; *************************************************************************** +; * This file is part of the project "AqHome". * +; * Please see toplevel file COPYING of that project for license details. * +; *************************************************************************** + +#ifndef AQH_AVR_GUI2_HLAYOUT_ASM +#define AQH_AVR_GUI2_HLAYOUT_ASM + + +; *************************************************************************** +; defines + +.equ HLAYOUT_OFFS_BEGIN = WIDGET_SIZE +; no data for now +.equ HLAYOUT_SIZE = HLAYOUT_OFFS_BEGIN+0 + + + + +; *************************************************************************** +; code + +.cseg + + + +; --------------------------------------------------------------------------- +; @routine HLayout_new @global +; +; @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 r21:r20 ressource id for title +; @clobbers any + +HLayout_new: + push r20 + push r21 + ldi r24, LOW(HLAYOUT_SIZE) + ldi r25, HIGH(HLAYOUT_SIZE) + bigcall Object_Alloc ; (!r16, !r17, !X) + pop r21 + pop r20 + brcc HLayout_new_ret + rcall HLayout_Init ; (r16, r17, X) + sec +HLayout_new_ret: + ret +; @end + + + +; --------------------------------------------------------------------------- +; @routine HLayout_Init @global +; +; @param Y address of widget +; @param X parent widget (if any) +; @clobbers r16, r17, X + +HLayout_Init: + push r20 + push r21 + ; call base class + bigcall Widget_Init ; (r16, r17, X) + pop r21 + pop r20 + + ; set default signal map + ldi r16, LOW(HLayout_DefaultSignalmap*2) + std Y+OBJECT_OFFS_SIGNALMAP_LO, r16 + ldi r16, HIGH(HLayout_DefaultSignalmap*2) + std Y+OBJECT_OFFS_SIGNALMAP_HI, r16 + + ret +; @end + + + +; --------------------------------------------------------------------------- +; @routine HLayout_OnLayout +; +; @param Y pointer to widget +; @clobbers any, !Y + +HLayout_OnLayout: + rcall hLayoutHorizontally + rcall hLayoutVerticalAdjust + ; force re-drawing of this widget + ldd r16, Y+OBJECT_OFFS_FLAGS + ori r16, (1<