WIN_IO

A simple set of packages for graphical input and output


Universidad de Cantabria, SPAIN

Author: Michael Gonzalez  mgh@unican.es

Win_IO is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation.
 

1. Graphics_Window Example



File : test_graphics_window.adb


with Ada.Text_IO; use Ada.Text_IO;
with Graphics_Windows;
use Graphics_Windows;

procedure Test_Graphics_Window is
   Display : Canvas_Type:=Canvas(400,450,"Test Graphics");
   Points : Point_List:=((60,10),(80,50),(130,20));
   Other_Points : Point_List:=((140,10),(160,50),(210,20));
   My_Photo : Image_Type;
begin
   -- Picture
   My_Photo:=Image(Display,"ciencias1.xpm");
   Draw_Image(Display,(100,300),My_Photo);
   -- Lines
   Draw_Line(Display,(230,280),(200,340));
   Draw_Line_List(Display,Points);
   -- Polygon
   Set_Fill(Display,Blue);
   Draw_Polygon(Display,Other_Points);
   -- Circle and ellipses
   Draw_Circle(Display,(200,200),100);
   Set_Fill(Display,False);
   Draw_Ellipse(Display,(250,130),(290,230));
   Set_Colour(Display,Red);
   Set_Fill(Display,Cyan);
   Draw_Ellipse(Display,(350,150),40,60);
   -- Rectangles
   Draw_Rectangle(Display,(50,200),(80,300));
   Set_Fill(Display,False);
   Set_Pen(Display,Color_Type'(120,34,59),4);
   Draw_Rectangle(Display,(90,200),10,50);
   -- Arc
   Set_Fill(Display,Dark(Green));
   Draw_Arc(Display,(350,40),60,100,0,135);
   -- Texts
   Set_Font_Size (Display,18);
   Draw_Text(Display,(220,20),"The Title");
   Set_Font_Size (Display,12);
   Set_Colour(Display,Magenta);
   Draw_Text(Display,(200,270),"This is my school");
   -- Wait for OK button
   Wait(Display);
   Put_Line("Test Completed");
end Test_Graphics_Window;