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.

18. <strong>The</strong> buttons per line parameter (default ∞) defines the maximal number of buttons<br />

in one line of the panel section.<br />

19. <strong>The</strong> precision parameter (default 16) defines the precision that is used for representing<br />

window coordinates, more precisely, all x and y coordinates generated by window<br />

input operations are doubles whose mantissa are truncated after precision − 1 bits<br />

after the binary point.<br />

In addition to call-back (handler) functions <strong>LEDA</strong> windows now also support the usage<br />

of function objects. Function object classes have to be derived from the window handler<br />

base class.<br />

class window_handler {<br />

...<br />

virtual void operator()() { }<br />

// parameter access functions<br />

double get_double(int nr) const;<br />

int get_int() const;<br />

window* get_window_ptr() const;<br />

char* get_char_ptr() const;<br />

};<br />

Derived classes have to implement the handling function in the definition of the operator( )<br />

method. <strong>The</strong> different get methods can be called to retrieve parameters.<br />

If both, a handler function and an object for the same action is supplied the object has<br />

higher priority.<br />

#include < <strong>LEDA</strong>/graphics/window.h ><br />

2. Creation<br />

window W ;<br />

creates a squared window with maximal possible edge length (minimum<br />

of width and height of the display).<br />

window W (const char ∗ label);<br />

window W (int w, int h);<br />

creates a maximal squared window with frame label label.<br />

creates a window W of physical size w pixels × h pixels .<br />

window W (int w, int h, const char ∗ label);<br />

creates a window W of physical size w pixels × h pixels and frame<br />

label label.

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

Saved successfully!

Ooh no, something went wrong!