gui: add routine CDialog_CreateWidgets (to be used outside CDIALOG).
This commit is contained in:
@@ -174,6 +174,39 @@ CDialog_GetChildBySelector_popRet:
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
; ---------------------------------------------------------------------------
|
||||||
|
; @routine CDialog_CreateWidgets @global
|
||||||
|
;
|
||||||
|
; @param Y pointer to target window for signals emitted by created widgets
|
||||||
|
; @param X pointer to window to become parent to created widgets
|
||||||
|
; @param Z pointer to dialog configuration
|
||||||
|
; @return CFLAG set of okay, cleared otherwise
|
||||||
|
; @clobbers any, !X, !Y
|
||||||
|
|
||||||
|
CDialog_CreateWidgets:
|
||||||
|
CDialog_CreateWidgets_loop:
|
||||||
|
lpm r16, Z
|
||||||
|
tst r16
|
||||||
|
breq CDialog_CreateWidgets_done
|
||||||
|
push yl
|
||||||
|
push yh
|
||||||
|
push xl
|
||||||
|
push xh
|
||||||
|
rcall cDialogMkChildWidget
|
||||||
|
pop xh
|
||||||
|
pop xl
|
||||||
|
pop yh
|
||||||
|
pop yl
|
||||||
|
brcc CDialog_CreateWidgets_ret
|
||||||
|
adiw zh:zl, CDIALOGCFG_WIDGET_SIZE
|
||||||
|
rjmp CDialog_CreateWidgets_loop
|
||||||
|
CDialog_CreateWidgets_done:
|
||||||
|
sec
|
||||||
|
CDialog_CreateWidgets_ret:
|
||||||
|
ret
|
||||||
|
; @end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
; ---------------------------------------------------------------------------
|
; ---------------------------------------------------------------------------
|
||||||
; @routine cDialogCreateContent
|
; @routine cDialogCreateContent
|
||||||
@@ -195,24 +228,7 @@ cDialogCreateContent:
|
|||||||
brcc cDialogCreateContent_ret
|
brcc cDialogCreateContent_ret
|
||||||
|
|
||||||
adiw zh:zl, CDIALOGCFG_HEADER_SIZE ; go to first child widget
|
adiw zh:zl, CDIALOGCFG_HEADER_SIZE ; go to first child widget
|
||||||
cDialogCreateContent_loop:
|
rcall CDialog_CreateWidgets
|
||||||
lpm r16, Z
|
|
||||||
tst r16
|
|
||||||
breq cDialogCreateContent_done
|
|
||||||
push yl
|
|
||||||
push yh
|
|
||||||
push xl
|
|
||||||
push xh
|
|
||||||
rcall cDialogMkChildWidget
|
|
||||||
pop xh
|
|
||||||
pop xl
|
|
||||||
pop yh
|
|
||||||
pop yl
|
|
||||||
brcc cDialogCreateContent_ret
|
|
||||||
adiw zh:zl, CDIALOGCFG_WIDGET_SIZE
|
|
||||||
rjmp cDialogCreateContent_loop
|
|
||||||
cDialogCreateContent_done:
|
|
||||||
sec
|
|
||||||
cDialogCreateContent_ret:
|
cDialogCreateContent_ret:
|
||||||
ret
|
ret
|
||||||
; @end
|
; @end
|
||||||
|
|||||||
Reference in New Issue
Block a user