gui: implement DlgLightConns_OnCmdMotion2 and DlgLightConns_OnDlgEndMotion2
This commit is contained in:
@@ -254,6 +254,65 @@ dlgLightConnsGetValue_ret:
|
||||
|
||||
|
||||
|
||||
; ---------------------------------------------------------------------------
|
||||
; @routine dlgLightConnsEnterSubDialog
|
||||
; @param Y pointer to dialog
|
||||
; @param X pointer to new dialog to enter
|
||||
; @clobbers any, !Y
|
||||
|
||||
dlgLightConnsEnterSubDialog:
|
||||
std Y+DLGLIGHTCONNS_OFFS_CURRDLG_LO, xl
|
||||
std Y+DLGLIGHTCONNS_OFFS_CURRDLG_HI, xh
|
||||
|
||||
adiw xh:xl, OBJECT_OFFS_TARGET_LO
|
||||
st X+, yl
|
||||
st X, yh
|
||||
sbiw xh:xl, (OBJECT_OFFS_TARGET_LO+1)
|
||||
|
||||
push yl
|
||||
push yh
|
||||
bigcall Widget_GetApp ; R19:R18=gui (none)
|
||||
mov yl, r18
|
||||
mov yh, r19
|
||||
bigcall GuiApp_EnterWindow
|
||||
pop yh
|
||||
pop yl
|
||||
ret
|
||||
; @end
|
||||
|
||||
|
||||
|
||||
; ---------------------------------------------------------------------------
|
||||
; @routine dlgLightConnsLeaveSubDialog
|
||||
; @param Y pointer to dialog
|
||||
; @clobbers any, !Y
|
||||
|
||||
dlgLightConnsLeaveSubDialog:
|
||||
; leave sub-dialog
|
||||
push yl
|
||||
push yh
|
||||
bigcall Widget_GetApp ; R19:R18=gui
|
||||
mov yl, r18
|
||||
mov yh, r19
|
||||
bigcall GuiApp_LeaveWindow
|
||||
pop yh
|
||||
pop yl
|
||||
|
||||
; mark sub-dialog for destruction
|
||||
ldd xl, Y+DLGLIGHTCONNS_OFFS_CURRDLG_LO
|
||||
ldd xh, Y+DLGLIGHTCONNS_OFFS_CURRDLG_HI
|
||||
clr r16
|
||||
std Y+DLGLIGHTCONNS_OFFS_CURRDLG_LO, r16
|
||||
std Y+DLGLIGHTCONNS_OFFS_CURRDLG_HI, r16
|
||||
adiw xh:xl, OBJECT_OFFS_FLAGS
|
||||
ld r16, X
|
||||
sbr r16, (1<<OBJECT_FLAGS_DESTROY_BIT)
|
||||
st X, r16
|
||||
ret
|
||||
; @end
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -328,22 +387,8 @@ DlgLightConns_OnCmdMotion1:
|
||||
mov xh, yh
|
||||
pop yh
|
||||
pop yl
|
||||
std Y+DLGLIGHTCONNS_OFFS_CURRDLG_LO, xl
|
||||
std Y+DLGLIGHTCONNS_OFFS_CURRDLG_HI, xh
|
||||
|
||||
adiw xh:xl, OBJECT_OFFS_TARGET_LO
|
||||
st X+, yl
|
||||
st X, yh
|
||||
sbiw xh:xl, (OBJECT_OFFS_TARGET_LO+1)
|
||||
|
||||
push yl
|
||||
push yh
|
||||
bigcall Widget_GetApp ; R19:R18=gui (none)
|
||||
mov yl, r18
|
||||
mov yh, r19
|
||||
bigcall GuiApp_EnterWindow
|
||||
pop yh
|
||||
pop yl
|
||||
rcall dlgLightConnsEnterSubDialog
|
||||
|
||||
sec
|
||||
ret
|
||||
@@ -369,43 +414,15 @@ DlgLightConns_OnDlgEndMotion1:
|
||||
ldd r16, Y+DLGLIGHTCONNS_OFFS_CURRDLG_LO
|
||||
ldd yh, Y+DLGLIGHTCONNS_OFFS_CURRDLG_HI
|
||||
mov yl, r16
|
||||
push zl
|
||||
push zh
|
||||
bigcall DlgNodeValueId_GetNodeAddr
|
||||
pop zh
|
||||
pop zl
|
||||
bigcall DlgNodeValueId_GetNodeAddr
|
||||
std Z+LIGHTSETTINGS_OFFS_SOURCE1_NODEADDR, r18
|
||||
push zl
|
||||
push zh
|
||||
bigcall DlgNodeValueId_GetValueId
|
||||
pop zh
|
||||
pop zl
|
||||
bigcall DlgNodeValueId_GetValueId
|
||||
std Z+LIGHTSETTINGS_OFFS_SOURCE1_VALUEID, r18
|
||||
pop yh
|
||||
pop yl
|
||||
|
||||
DlgLightConns_OnDlgEndMotion1_leave:
|
||||
; leave sub-dialog
|
||||
push yl
|
||||
push yh
|
||||
bigcall Widget_GetApp ; R19:R18=gui
|
||||
mov yl, r18
|
||||
mov yh, r19
|
||||
bigcall GuiApp_LeaveWindow
|
||||
pop yh
|
||||
pop yl
|
||||
|
||||
; mark sub-dialog for destruction
|
||||
ldd xl, Y+DLGLIGHTCONNS_OFFS_CURRDLG_LO
|
||||
ldd xh, Y+DLGLIGHTCONNS_OFFS_CURRDLG_HI
|
||||
clr r16
|
||||
std Y+DLGLIGHTCONNS_OFFS_CURRDLG_LO, r16
|
||||
std Y+DLGLIGHTCONNS_OFFS_CURRDLG_HI, r16
|
||||
adiw xh:xl, OBJECT_OFFS_FLAGS
|
||||
ld r16, X
|
||||
sbr r16, (1<<OBJECT_FLAGS_DESTROY_BIT)
|
||||
st X, r16
|
||||
|
||||
rcall dlgLightConnsLeaveSubDialog
|
||||
sec
|
||||
ret
|
||||
; @end
|
||||
@@ -419,6 +436,38 @@ DlgLightConns_OnDlgEndMotion1_leave:
|
||||
; @clobbers any, !Y
|
||||
|
||||
DlgLightConns_OnCmdMotion2:
|
||||
push yl
|
||||
push yh
|
||||
ldd zl, Y+DLGLIGHTCONNS_OFFS_SETTINGS_LO
|
||||
ldd zh, Y+DLGLIGHTCONNS_OFFS_SETTINGS_HI
|
||||
bigcall Widget_GetApp ; R19:R18=gui
|
||||
mov yl, r18
|
||||
mov yh, r19
|
||||
ldi r20, LOW(RESSOURCE_TXT_LEDMOTIONSRC2)
|
||||
ldi r21, HIGH(RESSOURCE_TXT_LEDMOTIONSRC2)
|
||||
push zl
|
||||
push zh
|
||||
bigcall DlgNodeValueId_new
|
||||
pop zh
|
||||
pop zl
|
||||
|
||||
ldi r16, DLGLIGHTCONNS_SEL_DLG_MOTION2
|
||||
std Y+OBJECT_OFFS_SELECTOR, r16
|
||||
; set values
|
||||
ldd xl, Z+LIGHTSETTINGS_OFFS_SOURCE2_NODEADDR
|
||||
clr xh
|
||||
bigcall DlgNodeValueId_SetNodeAddr
|
||||
ldd xl, Z+LIGHTSETTINGS_OFFS_SOURCE2_VALUEID
|
||||
clr xh
|
||||
bigcall DlgNodeValueId_SetValueId
|
||||
|
||||
mov xl, yl
|
||||
mov xh, yh
|
||||
pop yh
|
||||
pop yl
|
||||
|
||||
rcall dlgLightConnsEnterSubDialog
|
||||
|
||||
sec
|
||||
ret
|
||||
; @end
|
||||
@@ -432,6 +481,26 @@ DlgLightConns_OnCmdMotion2:
|
||||
; @clobbers any, !Y
|
||||
|
||||
DlgLightConns_OnDlgEndMotion2:
|
||||
cpi xl, DIALOG_RESULT_OK
|
||||
brne DlgLightConns_OnDlgEndMotion2_leave
|
||||
|
||||
; get values
|
||||
ldd zl, Y+DLGLIGHTCONNS_OFFS_SETTINGS_LO
|
||||
ldd zh, Y+DLGLIGHTCONNS_OFFS_SETTINGS_HI
|
||||
push yl
|
||||
push yh
|
||||
ldd r16, Y+DLGLIGHTCONNS_OFFS_CURRDLG_LO
|
||||
ldd yh, Y+DLGLIGHTCONNS_OFFS_CURRDLG_HI
|
||||
mov yl, r16
|
||||
bigcall DlgNodeValueId_GetNodeAddr
|
||||
std Z+LIGHTSETTINGS_OFFS_SOURCE2_NODEADDR, r18
|
||||
bigcall DlgNodeValueId_GetValueId
|
||||
std Z+LIGHTSETTINGS_OFFS_SOURCE2_VALUEID, r18
|
||||
pop yh
|
||||
pop yl
|
||||
|
||||
DlgLightConns_OnDlgEndMotion2_leave:
|
||||
rcall dlgLightConnsLeaveSubDialog
|
||||
sec
|
||||
ret
|
||||
; @end
|
||||
@@ -643,7 +712,7 @@ DlgLightConns_Config:
|
||||
; signal map
|
||||
DlgLightConns_DefaultSignalmap:
|
||||
; header
|
||||
.dw Dialog_DefaultSignalmap*2 ; next table to use
|
||||
.dw CDialog_DefaultSignalmap*2 ; next table to use
|
||||
; entries
|
||||
.db 0, DIALOG_SIGNAL_TOGUI, LOW(DlgLightConns_OnToGui), HIGH(DlgLightConns_OnToGui)
|
||||
.db 0, DIALOG_SIGNAL_FROMGUI, LOW(DlgLightConns_OnFromGui), HIGH(DlgLightConns_OnFromGui)
|
||||
|
||||
Reference in New Issue
Block a user