31.01.2014 Views

Version 5.0 The LEDA User Manual

Version 5.0 The LEDA User Manual

Version 5.0 The LEDA User Manual

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

int W.read mouse arc(double x 0 , double y 0 , double x 1 , double y 1 , double& x,<br />

double& y)<br />

displays an arc that starts in (x 0 , y 0 ), ends in (x 1 , y 1 ) and<br />

passes through the current cursor position. When a mouse<br />

button is pressed inside the drawing section of W , the<br />

current position is assigned to (x, y) and the number of<br />

the pressed button is returned.<br />

int W.read mouse arc(const point& p, const point& q, point& r)<br />

as above with (x0, y0) = p and (x1, y1) = q and the current<br />

position is assigned to r.<br />

int W.get mouse( ) non-blocking read operation, i.e., if a button was<br />

pressed its number is returned, otherwise the constant<br />

NO BUTTON is returned.<br />

int W.get mouse(double& x, double& y)<br />

if a mouse button was pressed the corresponding position<br />

is assigned to (x, y) and the button number is returned,<br />

otherwise the constant NO BUTTON is returned.<br />

int<br />

W.get mouse(point& p) if a mouse button was pressed the corresponding position is<br />

assigned to p and the button number is returned, otherwise<br />

the constant NO BUTTON is returned.<br />

int W.read mouse(double x 0 , double y 0 , int timeout1 , int timeout2 ,<br />

bool& double click, bool& drag)<br />

...<br />

int<br />

W.read mouse(const point& p, int timeout1 , int timeout2 , bool& double click,<br />

bool& drag)<br />

...<br />

3.5.2 Events<br />

int W.read event(int& val, double& x, double& y, unsigned long& t)<br />

waits for next event in window W and returns it. Assigns<br />

the button or key to val, the position in W to<br />

(x, y), and the time stamp of the event to t. Possible<br />

events are (cf. ):<br />

key press event, key release event, button press event,<br />

button release event, configure event, motion event, destroy<br />

event.<br />

int<br />

W.read event(int& val, double& x, double& y, unsigned long& t, int timeout)<br />

as above, but waits only timeout milliseconds; if no event<br />

occured the special event no event is returned.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!