gui: fixed some bugs.
calling a dialog from another basically works now.
This commit is contained in:
@@ -388,6 +388,44 @@ OBJ_GetChildBySelector_ret:
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
; ---------------------------------------------------------------------------
|
||||||
|
; @routine OBJ_TreeDestroyMarked @global
|
||||||
|
;
|
||||||
|
; @param Y address of root object
|
||||||
|
; @clobbers any
|
||||||
|
|
||||||
|
OBJ_TreeDestroyMarked:
|
||||||
|
ldd r16, Y+OBJECT_OFFS_FLAGS
|
||||||
|
sbrc r16, OBJECT_FLAGS_DESTROY_BIT
|
||||||
|
rjmp OBJ_TreeDestroyMarked_destroy
|
||||||
|
|
||||||
|
rcall OBJ_GetFirstChild ; R19:R18=obj (none)
|
||||||
|
brcc OBJ_TreeDestroyMarked_ret
|
||||||
|
OBJ_TreeDestroyMarked_loop:
|
||||||
|
mov yl, r18
|
||||||
|
mov yh, r19
|
||||||
|
rcall OBJ_GetNext ; R19:R18=obj (none)
|
||||||
|
brcs OBJ_TreeDestroyMarked_handleChild
|
||||||
|
clr r18
|
||||||
|
clr r19
|
||||||
|
OBJ_TreeDestroyMarked_handleChild:
|
||||||
|
push r18
|
||||||
|
push r19
|
||||||
|
rcall OBJ_TreeDestroyMarked ; recursion
|
||||||
|
pop r19
|
||||||
|
pop r18
|
||||||
|
mov r16, r18
|
||||||
|
or r16, r19
|
||||||
|
breq OBJ_TreeDestroyMarked_ret
|
||||||
|
rjmp OBJ_TreeDestroyMarked_loop
|
||||||
|
OBJ_TreeDestroyMarked_destroy:
|
||||||
|
rcall OBJ_Free
|
||||||
|
OBJ_TreeDestroyMarked_ret:
|
||||||
|
ret
|
||||||
|
; @end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
; ---------------------------------------------------------------------------
|
; ---------------------------------------------------------------------------
|
||||||
; @routine OBJ_SkipObjects @global
|
; @routine OBJ_SkipObjects @global
|
||||||
;
|
;
|
||||||
@@ -484,15 +522,11 @@ objAddObjXAsChildToY_setParent:
|
|||||||
; @routine OBJ_Unlink @global
|
; @routine OBJ_Unlink @global
|
||||||
;
|
;
|
||||||
; @param Y object to unlink
|
; @param Y object to unlink
|
||||||
; @clobbers r16, r17, r18, r19, r20, r21, X
|
; @clobbers r16, r17, r18, r19, r20, r21
|
||||||
|
|
||||||
OBJ_Unlink:
|
OBJ_Unlink:
|
||||||
mov xl, yl
|
ldd r20, Y+OBJECT_OFFS_NEXT_LO ; r21:r20=next
|
||||||
mov xh, yh
|
ldd r21, Y+OBJECT_OFFS_NEXT_HI
|
||||||
adiw xh:xl, OBJECT_OFFS_NEXT_LO ; r21:r20=next
|
|
||||||
ld r20, X+
|
|
||||||
ld r21, X
|
|
||||||
sbiw xh:xl, (OBJECT_OFFS_NEXT_LO+1)
|
|
||||||
|
|
||||||
push yl
|
push yl
|
||||||
push yh
|
push yh
|
||||||
@@ -810,16 +844,17 @@ OBJ_TreeHandleSignalChildenFirst_loop:
|
|||||||
mov yl, r18
|
mov yl, r18
|
||||||
mov yh, r19
|
mov yh, r19
|
||||||
rcall OBJ_GetNext ; r19:r18=object (none)
|
rcall OBJ_GetNext ; r19:r18=object (none)
|
||||||
ldi r20, 0
|
brcs OBJ_TreeHandleSignalChildenFirst_handle
|
||||||
sbci r20, 0
|
clr r18
|
||||||
|
clr r19
|
||||||
|
OBJ_TreeHandleSignalChildenFirst_handle:
|
||||||
push r18
|
push r18
|
||||||
push r19
|
push r19
|
||||||
push r20
|
|
||||||
rcall OBJ_TreeHandleSignalChildenFirst ; recursion!
|
rcall OBJ_TreeHandleSignalChildenFirst ; recursion!
|
||||||
pop r20
|
|
||||||
pop r19
|
pop r19
|
||||||
pop r18
|
pop r18
|
||||||
tst r20 ; result of OBJ_GetNext (0=no next)
|
mov r20, r18
|
||||||
|
or r20, r19
|
||||||
brne OBJ_TreeHandleSignalChildenFirst_loop
|
brne OBJ_TreeHandleSignalChildenFirst_loop
|
||||||
OBJ_TreeHandleSignalChildenFirst_done:
|
OBJ_TreeHandleSignalChildenFirst_done:
|
||||||
pop yh
|
pop yh
|
||||||
@@ -1020,16 +1055,18 @@ objGetHandlerFromSignalMap_done:
|
|||||||
; @clobbers r16, r17, Y
|
; @clobbers r16, r17, Y
|
||||||
|
|
||||||
objGetPredecessor:
|
objGetPredecessor:
|
||||||
rcall OBJ_GetParent
|
mov r16, yl ; R17:R16=object whose predecessor we look for
|
||||||
brcc objGetPredecessor_ret
|
|
||||||
mov r16, yl
|
|
||||||
mov r17, yh
|
mov r17, yh
|
||||||
rcall OBJ_GetFirstChild ; R19:R18=obj
|
rcall OBJ_GetParent ; R19:R18=obj (none)
|
||||||
|
brcc objGetPredecessor_ret
|
||||||
|
mov yl, r18
|
||||||
|
mov yh, r19
|
||||||
|
rcall OBJ_GetFirstChild ; R19:R18=obj (none)
|
||||||
brcc objGetPredecessor_ret
|
brcc objGetPredecessor_ret
|
||||||
mov yl, r18
|
mov yl, r18
|
||||||
mov yh, r19
|
mov yh, r19
|
||||||
objGetPredecessor_loop:
|
objGetPredecessor_loop:
|
||||||
rcall OBJ_GetNext
|
rcall OBJ_GetNext ; R19:R18=obj (none)
|
||||||
brcc objGetPredecessor_ret
|
brcc objGetPredecessor_ret
|
||||||
cp r18, r16
|
cp r18, r16
|
||||||
brne objGetPredecessor_next
|
brne objGetPredecessor_next
|
||||||
|
|||||||
Reference in New Issue
Block a user