c03: use DIALOG as base class for MenuWin
This commit is contained in:
@@ -14,7 +14,7 @@
|
|||||||
; ***************************************************************************
|
; ***************************************************************************
|
||||||
; defines
|
; defines
|
||||||
|
|
||||||
.equ MENUWIN_OFFS_BEGIN = MAINWINDOW_SIZE
|
.equ MENUWIN_OFFS_BEGIN = DIALOG_SIZE
|
||||||
.equ MENUWIN_SIZE = MENUWIN_OFFS_BEGIN+0
|
.equ MENUWIN_SIZE = MENUWIN_OFFS_BEGIN+0
|
||||||
|
|
||||||
|
|
||||||
@@ -77,7 +77,7 @@ MenuWin_Init:
|
|||||||
ldi r17, (WIDGET_PACK_FILLED<<WIDGET_PACK_HSELF0_BIT) | (WIDGET_PACK_FILLED<<WIDGET_PACK_VSELF0_BIT) ; PACK
|
ldi r17, (WIDGET_PACK_FILLED<<WIDGET_PACK_HSELF0_BIT) | (WIDGET_PACK_FILLED<<WIDGET_PACK_VSELF0_BIT) ; PACK
|
||||||
ldi r20, LOW(RESSOURCE_TXT_AQHOME)
|
ldi r20, LOW(RESSOURCE_TXT_AQHOME)
|
||||||
ldi r21, HIGH(RESSOURCE_TXT_AQHOME)
|
ldi r21, HIGH(RESSOURCE_TXT_AQHOME)
|
||||||
bigcall MainWindow_Init
|
bigcall Dialog_Init
|
||||||
brcc MenuWin_Init_ret
|
brcc MenuWin_Init_ret
|
||||||
|
|
||||||
; set default signal map
|
; set default signal map
|
||||||
@@ -190,67 +190,21 @@ menuWinCreateButton_ret:
|
|||||||
|
|
||||||
|
|
||||||
; ---------------------------------------------------------------------------
|
; ---------------------------------------------------------------------------
|
||||||
; @routine MenuWin_OnShow
|
; @routine MenuWin_OnMkContent
|
||||||
;
|
|
||||||
; @param Y MainWindow
|
|
||||||
|
|
||||||
MenuWin_OnShow:
|
MenuWin_OnMkContent:
|
||||||
; check visible flag
|
bigcall MainWindow_GetContentWidget ; r19:r18=content window
|
||||||
ldd r16, Y+OBJECT_OFFS_FLAGS
|
brcc MenuWin_OnMkContent_ret
|
||||||
sbrc r16, WIDGET_FLAGS_VISIBLE_BIT
|
mov xl, r18 ; use content window as parent
|
||||||
rjmp MenuWin_OnShow_ret
|
|
||||||
|
|
||||||
; create content
|
|
||||||
bigcall MainWindow_CreateContentWidget ; r19:r18=content window
|
|
||||||
brcc MenuWin_OnShow_ret
|
|
||||||
mov xl, r18 ; use content window as parent
|
|
||||||
mov xh, r19
|
mov xh, r19
|
||||||
|
|
||||||
; set VISIBLE flag
|
; Y=MainWindow, X=content window
|
||||||
ldd r16, Y+OBJECT_OFFS_FLAGS
|
push yl ; main window
|
||||||
sbr r16, (1<<WIDGET_FLAGS_VISIBLE_BIT)
|
|
||||||
std Y+OBJECT_OFFS_FLAGS, r16
|
|
||||||
|
|
||||||
rcall menuWinCreateContent
|
|
||||||
|
|
||||||
MenuWin_OnShow_ret:
|
|
||||||
sec
|
|
||||||
ret
|
|
||||||
; @end
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
; ---------------------------------------------------------------------------
|
|
||||||
; @routine MenuWin_OnHide @global
|
|
||||||
;
|
|
||||||
; @param Y pointer to dialog
|
|
||||||
; @return CFLAG set of okay, cleared otherwise
|
|
||||||
; @clobbers any, !Y
|
|
||||||
|
|
||||||
MenuWin_OnHide:
|
|
||||||
ldd r16, Y+OBJECT_OFFS_FLAGS
|
|
||||||
sbrs r16, WIDGET_FLAGS_VISIBLE_BIT
|
|
||||||
rjmp MenuWin_OnHide_ret
|
|
||||||
|
|
||||||
; prepare destruction of content
|
|
||||||
bigcall MainWindow_GetContentWidget
|
|
||||||
brcc MenuWin_OnHide_ret
|
|
||||||
push yl
|
|
||||||
push yh
|
push yh
|
||||||
mov yl, r18
|
rcall menuWinCreateContent
|
||||||
mov yh, r19
|
pop yh ; main window
|
||||||
ldd r16, Y+OBJECT_OFFS_FLAGS
|
|
||||||
sbr r16, (1<<OBJECT_FLAGS_DESTROY_BIT)
|
|
||||||
std Y+OBJECT_OFFS_FLAGS, r16
|
|
||||||
pop yh
|
|
||||||
pop yl
|
pop yl
|
||||||
|
MenuWin_OnMkContent_ret:
|
||||||
; clr VISIBLE flag
|
|
||||||
ldd r16, Y+OBJECT_OFFS_FLAGS
|
|
||||||
cbr r16, (1<<WIDGET_FLAGS_VISIBLE_BIT)
|
|
||||||
std Y+OBJECT_OFFS_FLAGS, r16
|
|
||||||
|
|
||||||
MenuWin_OnHide_ret:
|
|
||||||
sec
|
sec
|
||||||
ret
|
ret
|
||||||
; @end
|
; @end
|
||||||
@@ -320,15 +274,14 @@ MenuWin_OnCmdDebug:
|
|||||||
|
|
||||||
MenuWin_DefaultSignalmap:
|
MenuWin_DefaultSignalmap:
|
||||||
; header
|
; header
|
||||||
.dw MainWindow_DefaultSignalmap*2 ; next table to use
|
.dw Dialog_DefaultSignalmap*2 ; next table to use
|
||||||
; entries
|
; entries
|
||||||
.db 0, WIDGET_SIGNAL_SHOW, LOW(MenuWin_OnShow), HIGH(MenuWin_OnShow)
|
.db 0, DIALOG_SIGNAL_MKCONTENT, LOW(MenuWin_OnMkContent), HIGH(MenuWin_OnMkContent)
|
||||||
.db 0, WIDGET_SIGNAL_HIDE, LOW(MenuWin_OnHide), HIGH(MenuWin_OnHide)
|
.db MENUWIN_SEL_CLIMATE, WIDGET_SIGNAL_COMMAND, LOW(MenuWin_OnCmdClimate), HIGH(MenuWin_OnCmdClimate)
|
||||||
.db MENUWIN_SEL_CLIMATE, WIDGET_SIGNAL_COMMAND, LOW(MenuWin_OnCmdClimate), HIGH(MenuWin_OnCmdClimate)
|
.db MENUWIN_SEL_LIGHT, WIDGET_SIGNAL_COMMAND, LOW(MenuWin_OnCmdLight), HIGH(MenuWin_OnCmdLight)
|
||||||
.db MENUWIN_SEL_LIGHT, WIDGET_SIGNAL_COMMAND, LOW(MenuWin_OnCmdLight), HIGH(MenuWin_OnCmdLight)
|
.db MENUWIN_SEL_WINDOWS, WIDGET_SIGNAL_COMMAND, LOW(MenuWin_OnCmdWindows), HIGH(MenuWin_OnCmdWindows)
|
||||||
.db MENUWIN_SEL_WINDOWS, WIDGET_SIGNAL_COMMAND, LOW(MenuWin_OnCmdWindows), HIGH(MenuWin_OnCmdWindows)
|
.db MENUWIN_SEL_NETSTATS, WIDGET_SIGNAL_COMMAND, LOW(MenuWin_OnCmdNetStats), HIGH(MenuWin_OnCmdNetStats)
|
||||||
.db MENUWIN_SEL_NETSTATS, WIDGET_SIGNAL_COMMAND, LOW(MenuWin_OnCmdNetStats), HIGH(MenuWin_OnCmdNetStats)
|
.db MENUWIN_SEL_DEBUG, WIDGET_SIGNAL_COMMAND, LOW(MenuWin_OnCmdDebug), HIGH(MenuWin_OnCmdDebug)
|
||||||
.db MENUWIN_SEL_DEBUG, WIDGET_SIGNAL_COMMAND, LOW(MenuWin_OnCmdDebug), HIGH(MenuWin_OnCmdDebug)
|
|
||||||
|
|
||||||
.db 0, 0, 0, 0 ; end of table
|
.db 0, 0, 0, 0 ; end of table
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user