Hi,
When you open TaskMenu.mnu to access the task menu editor you see the following inputs for each menu item: Constant, Item and Help. I understand Constant to be the text that defines a constant in the resourceIdenfiers and has the vpiDomains::menuTag; but what is item? Why is it important? What is its domain? How can I access it programmatically?
-
- VIP Member
- Posts: 147
- Joined: 5 Dec 2012 7:29
What is TaskMenu item?
Mutall Data Management Technical Support
-
- VIP Member
- Posts: 215
- Joined: 24 Apr 2007 12:26
Menu items
Peter,
Open the TaskMenu.mnu file.
There you can modify the Task menu.
Open the TaskWindow.win file,
There you can add menu handling predicates.
They look like this where clicking on a menu item
1) does a special action and
2) enables/disables other menu items.
I hope this helps.
Open the TaskMenu.mnu file.
There you can modify the Task menu.
Open the TaskWindow.win file,
There you can add menu handling predicates.
They look like this where clicking on a menu item
1) does a special action and
2) enables/disables other menu items.
Code: Select all
predicates
onLogSuspend : window::menuItemListener.
clauses
onLogSuspend(_Source, _MenuTag) :-
output_file_statistics:its_state=fileStatistics::active,
!,
output_file_statistics:its_state:=fileStatistics::suspended,
Task=getVpiWindow(),
vpi::menuEnable(Task,resourceIdentifiers::id_log_create,b_false),
vpi::menuEnable(Task,resourceIdentifiers::id_log_resume,b_true),
vpi::menuEnable(Task,resourceIdentifiers::id_log_suspend,b_false),
vpi::menuEnable(Task,resourceIdentifiers::id_log_close,b_true).
onLogSuspend(_Source, _MenuTag).
You do not have the required permissions to view the files attached to this post.
TIA, Regards,
Frank Nagy
Frank Nagy
-
- VIP Member
- Posts: 147
- Joined: 5 Dec 2012 7:29
Hi Frank,
Ok, so Item does what I thought Constant does. Then I should switch my question the other way round so that it reads:-
When you open TaskMenu.mnu to access the task menu editor you see the following inputs for each menu item: Constant, Item and Help. I understand Item to be the text that defines a constant in the resourceIdenfiers and has the vpiDomains::menuTag; but what is Constant?
I have seen that the Constant value is always the same as the Item value. In this example I have deliberately entered the two to be different. What purpose does the constant serve?
Ok, so Item does what I thought Constant does. Then I should switch my question the other way round so that it reads:-
When you open TaskMenu.mnu to access the task menu editor you see the following inputs for each menu item: Constant, Item and Help. I understand Item to be the text that defines a constant in the resourceIdenfiers and has the vpiDomains::menuTag; but what is Constant?
I have seen that the Constant value is always the same as the Item value. In this example I have deliberately entered the two to be different. What purpose does the constant serve?
You do not have the required permissions to view the files attached to this post.
Mutall Data Management Technical Support
-
- VIP Member
- Posts: 1466
- Joined: 28 Feb 2000 0:01
-
- VIP Member
- Posts: 458
- Joined: 5 Nov 2000 0:01
Re: Menu items
Question for Thomas:
Might it be possible in some future version of VIP 7.x to combine the functions of managing TaskMenu.mnu and TaskMenu.win using two different "experts" into a single "super-expert?"
To me, the current approach seems more awkward than it needs to be.
Might it be possible in some future version of VIP 7.x to combine the functions of managing TaskMenu.mnu and TaskMenu.win using two different "experts" into a single "super-expert?"
To me, the current approach seems more awkward than it needs to be.
-
- VIP Member
- Posts: 147
- Joined: 5 Dec 2012 7:29
Hello Harrison,
I agree with you. It was not intuitive when I first used the code experts that the use of the .win was to extend the functionality of the .mnu file.
Thomas wrote
1) Constant is where you place the string version of the id that is found in resourceIdentifiers and is added to the menu listener
2) Item is a place where you could enter some user specified data that the one would wish to associate with the menu item. The data would be any valid prolog expression as a string that would have to converted to the appropriate domain to be useful.
If such were case, then the following entry would be valid:-
Constant: id_open_file
Item: "C:\some_directory\somefile.txt"
... where the Item domain is filename (string) to be opened when you select the Open menu.
I agree with you. It was not intuitive when I first used the code experts that the use of the .win was to extend the functionality of the .mnu file.
Thomas wrote
When I initially found Constant and Item in the Task Menu this is how I thought they would be used:-I think the "constant" has lost it meaning/purpose at some point.
1) Constant is where you place the string version of the id that is found in resourceIdentifiers and is added to the menu listener
2) Item is a place where you could enter some user specified data that the one would wish to associate with the menu item. The data would be any valid prolog expression as a string that would have to converted to the appropriate domain to be useful.
If such were case, then the following entry would be valid:-
Constant: id_open_file
Item: "C:\some_directory\somefile.txt"
... where the Item domain is filename (string) to be opened when you select the Open menu.
Mutall Data Management Technical Support
-
- VIP Member
- Posts: 215
- Joined: 24 Apr 2007 12:26
Item and constant
Peter,
If you generate a deep menu structure the the sub-items inherit the constant of their parent menu branch and a simplified text of the item is added to it in order to form the equal constant and item resource identifiers.
This rule of formation results a logical naming mirroring the structure of menu tree of sub-sub-sub-menuitems but the resource identifiers may be very_very_loooooooooooooooooong.
You can however edit both fields to get shorter resource identifiers but you won't see their position on the menu tree.
The code generation for TaskWindow.win uses the string of "item".
If you generate a deep menu structure the the sub-items inherit the constant of their parent menu branch and a simplified text of the item is added to it in order to form the equal constant and item resource identifiers.
This rule of formation results a logical naming mirroring the structure of menu tree of sub-sub-sub-menuitems but the resource identifiers may be very_very_loooooooooooooooooong.
You can however edit both fields to get shorter resource identifiers but you won't see their position on the menu tree.
The code generation for TaskWindow.win uses the string of "item".
Code: Select all
predicates
onFileExit : window::menuItemListener.
clauses
onFileExit(_, _MenuTag) :-
close().
predicates
onDepth3item : window::menuItemListener.
clauses
onDepth3item(_Source, _MenuTag).
You do not have the required permissions to view the files attached to this post.
TIA, Regards,
Frank Nagy
Frank Nagy