The screen widget is based on the canvas widget from the hush library. It also offers methods to add, move and remove items from the screen and to group items into a figure. The main difference is in the use of world coordinates, which makes it possible to scale the screen and therefore all the graphical widgets (which are derived from the screen widget). Adjusting the graphical widgets (and embedding it inside a screen or hypertext for example) is now done by simply adjusting the width and height of the widget (taking the world coordinates into account).
The screen widget has the following interface :
interface screen : public widget { screen(char* p,char* options = ""); screen(widget* w,char* p,char* options = ""); virtual ~screen(); // add item int line(int x1,int y1,int x2,int y2,char* options = ""); int line(char* linespec,char* options = ""); int oval(int x1,int y1,int x2,int y2,char* options = ""); int circle(int x,int y,int r,char* options = ""); int polygon(char* linespec,char* options = ""); int rectangle(int x1,int y1,int x2,int y2,char* options = ""); int square(int x,int y,int r,char* options = ""); int bitmap(int x,int y,char* bitmap,char* options = ""); int window(int x,int y,widget* w,char* options = ""); int text(int x,int y,char* txt,char* options = ""); void tag(int id,char* tg); // group items char* tags(int id); void move(int id,int x,int y); // move item / figure void move(char* tg,int x,int y); void del(int id); // remove item / figure void del(char* tg); int overlapping(int x,int y); // which items ? char* items(int x,int y); void postscript(char* fn); // generate postscript };The constructor takes the path and the options of the screen. The following options are provided :