From edb8e7b859b8dbaa83c5c1e65eb258c1c06ae662 Mon Sep 17 00:00:00 2001 From: Martin Preuss Date: Tue, 13 Jan 2026 00:00:19 +0100 Subject: [PATCH] texts inside labels now work. --- avr/devices/c03/main/main.asm | 6 ++-- avr/devices/c03/main/testwin.asm | 40 ++++++++++++++++++++--- avr/modules/lcd2/gui2/label.asm | 10 +++--- avr/modules/lcd2/gui2/widget.asm | 54 ++++++++++++++++++-------------- 4 files changed, 74 insertions(+), 36 deletions(-) diff --git a/avr/devices/c03/main/main.asm b/avr/devices/c03/main/main.asm index f8d6fd8..7588338 100644 --- a/avr/devices/c03/main/main.asm +++ b/avr/devices/c03/main/main.asm @@ -254,9 +254,8 @@ test: ;.include "modules/lcd2/font/font4.asm" ;.include "modules/lcd2/font/font12x16.asm" -;.include "modules/lcd2/ili9341/font12x16.asm" -;.include "modules/lcd2/ili9341/font12x16_1.asm" -.equ ili9341Font12x16_1 = 0 +.include "modules/lcd2/ili9341/font12x16.asm" +.include "modules/lcd2/ili9341/font12x16_1.asm" ;.include "modules/lcd2/ili9341/font12x20.asm" ;.include "modules/lcd2/ili9341/font12x20_1.asm" @@ -268,6 +267,7 @@ test: .include "modules/lcd2/gui2/style.asm" .include "modules/lcd2/gui2/object.asm" .include "modules/lcd2/gui2/widget.asm" +.include "modules/lcd2/gui2/label.asm" .include "modules/lcd2/gui2/guiapp.asm" .include "modules/lcd2/gui2/guicntrl.asm" diff --git a/avr/devices/c03/main/testwin.asm b/avr/devices/c03/main/testwin.asm index 37a82e7..59d2f4c 100644 --- a/avr/devices/c03/main/testwin.asm +++ b/avr/devices/c03/main/testwin.asm @@ -28,6 +28,8 @@ testApp_ramdata: testWin_ramdata: .byte WIDGET_SD_SIZE +testWinHeader_ramdata: + .byte WIDGET_SD_SIZE ; *************************************************************************** @@ -72,7 +74,7 @@ testWin_flashdata: ; OBJECT .dw 0 ; next .dw 0 ; parent - .dw 0 ; first child + .dw testWinHeader_flashdata*2 ; first child .dw 0 ; target .dw 0 ; selector (ony lower 8 bits used) .dw testWin_signalmap*2 ; signal map @@ -82,10 +84,9 @@ testWin_flashdata: .dw 0 ; Y .dw DISPLAY_WIDTH ; W .dw DISPLAY_HEIGHT ; H - .dw 0 ; front color - .dw DISPLAY_COLOR_PURPLE ; back color -; .dw STYLE_WIN_FONT*2 ; font - .dw 0 ; font + .dw STYLE_WIN_FOREGROUND ; front color + .dw STYLE_WIN_BACKGROUND ; back color + .dw STYLE_WIN_FONT*2 ; font .dw testWin_ramdata ; ptr to SDRAM testWin_signalmap: .db 0, OBJECT_SIGNAL_CREATE, LOW(Widget_OnCreate), HIGH(Widget_OnCreate) @@ -93,6 +94,35 @@ testWin_signalmap: .db 0, 0, 0, 0 ; end of table +testWinHeader_flashdata: + ; OBJECT + .dw 0 ; next + .dw testWin_flashdata*2 ; parent + .dw 0 ; first child + .dw 0 ; target + .dw 0 ; selector (ony lower 8 bits used) + .dw testWinHeader_signalmap*2 ; signal map + ; WIDGET + .db 0, 0 ; opts lo, hi + .dw 0 ; X + .dw 0 ; Y + .dw DISPLAY_WIDTH ; W + .dw STYLE_WIN_TITLE_HEIGHT ; H + .dw STYLE_WIN_TITLE_FOREGROUND ; front color + .dw STYLE_WIN_TITLE_BACKGROUND ; back color + .dw STYLE_WIN_FONT*2 ; font + .dw testWinHeader_ramdata ; ptr to SDRAM + ; LABEL + .dw testWinHeader_text*2 ; text + +testWinHeader_text: + .db "Test-Window", 0 +testWinHeader_signalmap: + .db 0, OBJECT_SIGNAL_CREATE, LOW(Widget_OnCreate), HIGH(Widget_OnCreate) + .db 0, WIDGET_SIGNAL_DRAW, LOW(Label_OnDraw), HIGH(Label_OnDraw) + .db 0, 0, 0, 0 ; end of table + + diff --git a/avr/modules/lcd2/gui2/label.asm b/avr/modules/lcd2/gui2/label.asm index 91f4b85..cdd37fe 100644 --- a/avr/modules/lcd2/gui2/label.asm +++ b/avr/modules/lcd2/gui2/label.asm @@ -42,7 +42,6 @@ Label_OnDraw: andi r16, (1<