I find the Source argument in the declaration and implementation of the menuItemListener superfluous in my application and would like to hear situations where This keyword would not suffice wherever the Source argument is needed.
The declaration in the window class is:-
Code: Select all
menuItemListener = (window Source, vpiDomains::menuTag MenuTAG).
Code: Select all
menuItemListener = (vpiDomains::menuTag MenuTAG).
Code: Select all
implement taskWindow
inherits applicationWindow
open core, vpiDomains
constants
mdiProperty : boolean = true.
clauses
new() :-
applicationWindow::new(),
generatedInitialize().
predicates
onShow : window::showListener.
clauses
onShow(_, _CreationData) :-
_MessageForm = messageForm::display(This). /*Case 1*/
class predicates
onDestroy : window::destroyListener.
clauses
onDestroy(_).
class predicates /*Case 2*/
onHelpAbout : window::menuItemListener.
clauses
onHelpAbout(TaskWin, _MenuTag) :-
_AboutDialog = aboutDialog::display(TaskWin).
predicates /*Case 3*/
onFileExit : window::menuItemListener.
clauses
onFileExit(_, _MenuTag) :-
close().
predicates
onSizeChanged : window::sizeListener.
clauses
onSizeChanged(_) :-
vpiToolbar::resize(getVPIWindow()).
% This code is maintained automatically, do not update it manually. 16:42:04-24.4.2013
predicates
generatedInitialize : ().
clauses
generatedInitialize():-
setText("dirty_code"),
setDecoration(titlebar([closeButton,maximizeButton,minimizeButton])),
setBorder(sizeBorder()),
setState([wsf_ClipSiblings]),
whenCreated({ :- projectToolbar::create(getVpiWindow()) }),
addSizeListener({ :- vpiToolbar::resize(getVpiWindow()) }),
setMdiProperty(mdiProperty),
menuSet(resMenu(resourceIdentifiers::id_TaskMenu)),
addShowListener(onShow),
addSizeListener(onSizeChanged),
addDestroyListener(onDestroy),
addMenuItemListener(resourceIdentifiers::id_help_about, onHelpAbout),
addMenuItemListener(resourceIdentifiers::id_file_exit, onFileExit).
% end of automatic code
end implement taskWindow