Hi,
I am very new to visual prolog and want to find out how I can get the X,Y coordinates of
a point from the contextMenuInput.
I am using this in the OnContextMenu event. onContextMenu(_Source, _INP) = window::defaultContextMenuHandling
contextMenuInput =
mouse(vpiDomains::pnt CursorPosition);
keyboard.
I see the point and its X,Y coordinates in the debugger, but I don't know how to extract these from the _INP variable.
-
- VIP Member
- Posts: 1466
- Joined: 28 Feb 2000 0:01
You extract/project the sub-values by matching a term containing variables against the value.
Here in context:
Code: Select all
window::mouse(vpiDomains::pnt(X, Y)) = Inp
Code: Select all
predicates
onContextMenu : contextMenuResponder.
clauses
onContextMenu(_Source, Inp) = window::defaultContextMenuHandling :-
if window::mouse(vpiDomains::pnt(X, Y)) = Inp then
stdio::writef("Context menu mouse press at X = %, Y = %\n", X, Y)
else
stdio::writef("Context menu invoked by keyboard")
end if.
Regards Thomas Linder Puls
PDC
PDC