gui2: more work (vlayout doesn't work, yet).
This commit is contained in:
@@ -33,8 +33,8 @@
|
||||
;
|
||||
; @return CFLAG set of okay, cleared otherwise
|
||||
; @return Y address of newly created object
|
||||
; @param r16 value for OBJECT_OFFS_OPTS_LO
|
||||
; @param r17 value for OBJECT_OFFS_OPTS_HI
|
||||
; @param r16 value for OBJECT_OFFS_OPTS
|
||||
; @param r17 value for WIDGET_OFFS_PACK
|
||||
; @param X pointer to GUIAPP
|
||||
; @clobbers any
|
||||
|
||||
@@ -56,8 +56,8 @@ RootWindow_new_ret:
|
||||
;
|
||||
; @return CFLAG set if okay, cleared otherwise
|
||||
; @param Y address of widget
|
||||
; @param r16 value for OBJECT_OFFS_OPTS_LO
|
||||
; @param r17 value for OBJECT_OFFS_OPTS_HI
|
||||
; @param r16 value for OBJECT_OFFS_OPTS
|
||||
; @param r17 value for WIDGET_OFFS_PACK
|
||||
; @param X pointer to GUIAPP
|
||||
; @clobbers r16, r17, X
|
||||
|
||||
@@ -68,21 +68,13 @@ RootWindow_Init:
|
||||
clr xh
|
||||
; call base class
|
||||
bigcall Widget_Init ; (r16, r17, X)
|
||||
|
||||
; clear widget-specific data
|
||||
mov xl, yl
|
||||
mov xh, yh
|
||||
adiw xh:xl, ROOTWINDOW_OFFS_BEGIN
|
||||
clr r16
|
||||
ldi r17, (ROOTWINDOW_SIZE-ROOTWINDOW_OFFS_BEGIN)
|
||||
bigcall Utils_FillSram ; (r17, X)
|
||||
pop xh
|
||||
pop xl
|
||||
|
||||
std Y+ROOTWINDOW_OFFS_GUIAPP_LO, xl
|
||||
std Y+ROOTWINDOW_OFFS_GUIAPP_HI, xh
|
||||
|
||||
bigcall Widget_SetFullScreen
|
||||
bigcall Widget_SetFullScreen ; (R16)
|
||||
|
||||
; set default signal map
|
||||
ldi r16, LOW(RootWindow_DefaultSignalmap*2)
|
||||
@@ -129,25 +121,26 @@ RootWindow_GetApp:
|
||||
; @clobbers any, !Y
|
||||
|
||||
RootWindow_OnLayout:
|
||||
ldd r20, Y+WIDGET_OFFS_WIDTH_LO
|
||||
ldd r21, Y+WIDGET_OFFS_WIDTH_HI
|
||||
ldd r22, Y+WIDGET_OFFS_HEIGHT_LO
|
||||
ldd r23, Y+WIDGET_OFFS_HEIGHT_HI
|
||||
|
||||
push yl
|
||||
push yh
|
||||
bigcall OBJ_GetFirstChild
|
||||
brcc RootWindow_OnLayout_done
|
||||
RootWindow_OnLayout_loop:
|
||||
brcc RootWindow_OnLayout_ret
|
||||
mov yl, r18
|
||||
mov yh, r19
|
||||
; all children are MainWindow, set to fullscreen
|
||||
bigcall Widget_SetFullScreen
|
||||
bigcall Widget_SetFullScreen ; (R16)
|
||||
rcall OBJ_GetNext
|
||||
rjmp RootWindow_OnLayout_loop
|
||||
RootWindow_OnLayout_ret:
|
||||
brcs RootWindow_OnLayout_loop
|
||||
RootWindow_OnLayout_done:
|
||||
pop yh
|
||||
pop yl
|
||||
|
||||
ldd r17, Y+OBJECT_OFFS_FLAGS
|
||||
cbr r17, (1<<WIDGET_FLAGS_LAYOUT_BIT)
|
||||
std Y+OBJECT_OFFS_FLAGS, r17
|
||||
sec
|
||||
sec
|
||||
ret
|
||||
; @end
|
||||
|
||||
@@ -160,10 +153,10 @@ RootWindow_OnLayout_ret:
|
||||
|
||||
RootWindow_DefaultSignalmap:
|
||||
; header
|
||||
.dw Widget_DefaultSignalmap ; next table to use
|
||||
.dw Widget_DefaultSignalmap*2 ; next table to use
|
||||
; entries
|
||||
; .db 0, WIDGET_SIGNAL_DRAW, LOW(Widget_OnDrawNop), HIGH(Widget_OnDrawNop)
|
||||
.db 0, WIDGET_SIGNAL_DRAW, LOW(Widget_OnDraw), HIGH(Widget_OnDraw)
|
||||
.db 0, WIDGET_SIGNAL_DRAW, LOW(Widget_OnDraw), HIGH(Widget_OnDraw)
|
||||
.db 0, WIDGET_SIGNAL_LAYOUT, LOW(RootWindow_OnLayout), HIGH(RootWindow_OnLayout)
|
||||
.db 0, 0, 0, 0 ; end of table
|
||||
|
||||
|
||||
Reference in New Issue
Block a user