how to retrieve the x, y coordinates of a point?
I saw but I do not know how to apply
Code: Select all
vpiDomains::pnt=pnt(integer X, integer Y)
thank you
Code: Select all
vpiDomains::pnt=pnt(integer X, integer Y)
Code: Select all
predicates
onMouseUp : window::mouseUpListener. % <== predicate for MouseUpListener event in Form
clauses
onMouseUp(_Source, PNT, _ShiftControlAlt, _Button) :-
PNT = pnt(X,Y),
% do something with X and Y here
!.
Code: Select all
gui_native::ptInRect/3->
ptInRect : (
vpiDomains::rct Rect,
integer PointX,
integer PointY)
-> booleanInt Result
language apicall.
Code: Select all
dbuToPix(FLAGRECTDBU,FLAGRECTPIX),
rectPntInside(rct(LPIX, TPIX, RPIX, BPIX),pnt(XCLICK, YCLICK)),
if YCLICK<(TPIX*2+BPIX) div 3 then
Color=color_white
elseif if YCLICK>(TPIX+BPIX*2) div 3 then
Color=color_red
else
Color = color_blue
end if
Stupid way may be, but works - just make 3 imaleControls (for 3 colors). And forget about coordinates - click happens on certain control with certain color.The stripes of the Russian flag are horizontal and have equal heights.
Code: Select all
vpi::getBaseUnits/2
getBaseUnits : (
integer DlgBaseWidth [out],
integer DlgBaseHeigth [out])
language c.
Returns the pixel equivalents of the horizontal (width) and vertical (height) dialog base units.