From 245181112ae86646c3f0b07a70626e0145819804 Mon Sep 17 00:00:00 2001 From: Martin Preuss Date: Fri, 8 May 2026 00:31:31 +0200 Subject: [PATCH] gui: started with dialog NodeValueId - lets you input a node address and a value id - needed e.g. for light settings --- avr/modules/lcd2/gui/aqhome/d_nodevalueid.asm | 317 ++++++++++++++++++ 1 file changed, 317 insertions(+) create mode 100644 avr/modules/lcd2/gui/aqhome/d_nodevalueid.asm diff --git a/avr/modules/lcd2/gui/aqhome/d_nodevalueid.asm b/avr/modules/lcd2/gui/aqhome/d_nodevalueid.asm new file mode 100644 index 0000000..34d7787 --- /dev/null +++ b/avr/modules/lcd2/gui/aqhome/d_nodevalueid.asm @@ -0,0 +1,317 @@ +; *************************************************************************** +; 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_AQHOME_D_NODEVALUEID_ASM +#define AQH_AVR_GUI2_AQHOME_D_NODEVALUEID_ASM + + +; *************************************************************************** +; defines + + +; widget +.equ DLGNODEVALUEID_OFFS_BEGIN = CDIALOG_SIZE +.equ DLGNODEVALUEID_SIZE = DLGNODEVALUEID_OFFS_BEGIN+0 + + +; selectors +.equ DLGNODEVALUEID_SEL_DIALOG_OK = 1 +.equ DLGNODEVALUEID_SEL_DIALOG_ABORT = 2 +.equ DLGNODEVALUEID_SEL_NODEADDR = 3 +.equ DLGNODEVALUEID_SEL_VALUEID = 4 + + + + + +; *************************************************************************** +; code + +.cseg + + + +; --------------------------------------------------------------------------- +; @routine DlgNodeValueId_new @global +; +; @param Y pointer to GUIAPP +; @param r21:r20 ressource id for title +; @return CFLAG set of okay, cleared otherwise +; @return Y address of newly created object + +DlgNodeValueId_new: + bigcall GuiApp_GetRootWindow ; r19:r18=root window (none) + brcc DlgNodeValueId_new_ret + mov xl, r18 ; use root window as parent for main window + mov xh, r19 + ldi r24, LOW(DLGNODEVALUEID_SIZE) + ldi r25, HIGH(DLGNODEVALUEID_SIZE) + push r20 + push r21 + bigcall Object_Alloc ; Y=space (!r16, !r17, !X) + pop r21 + pop r20 + brcc DlgNodeValueId_new_ret + rcall DlgNodeValueId_Init +DlgNodeValueId_new_ret: + ret +; @end + + + +; --------------------------------------------------------------------------- +; @routine DlgNodeValueId_Init @global +; +; @param Y pointer to dialog +; @param X pointer to root window +; @param r21:r20 ressource id for title +; @return CFLAG set of okay, cleared otherwise +; @clobbers any, !Y + +DlgNodeValueId_Init: + ldi r16, 0 ; OPTS + ldi r17, (WIDGET_PACK_FILLED<