------------------------------------------------------------------------------ -- -- -- Nom du fichier : Test.ads -- -- -- -- Auteur(s) : Livio Righetti -- -- -- -- Date de creation : 26-MARS-97 -- -- -- -- But : Mettre a disposition des fonctions graphiques -- -- minimales. -- -- -- -- Date de modif. : 18-SEPT-97 (G.corbaz) -- -- Raison : Utilisation du paquetage Adagraph -- -- -- -- Date de modif. : 7-AVRIL-99 (P.Girardet) -- -- Raison : Pour creer une librairie -- -- -- -- Date de modif. : 28 avril 2000 (SALAMIN Michel) -- -- Raison : Suppression de AdaGraph et utilisation d'une DLL -- -- faisant des appels directs aux API de Windows. -- -- -- -- Modules appeles : -- -- Mat. particulier : Graphmin.dll -- -- -- -- Compilateur : -- -- -- ------------------------------------------------------------------------------ with Ada.Text_Io; use Ada.Text_IO; with Spider; with Spider.Draw; with Spider.User; procedure Test is car_Temp : Character; car : Character := ' '; tailleX : Natural; color : Spider.Draw.tColor; X : Integer := 0; Y : Integer := 0; AX : Integer := 0; AY : Integer := 0; Clic : Boolean := false; begin Spider.Init_Window("Programme de test"); Spider.move_To(700,700); Spider.move_To( 50, 50); Spider.Draw.display_Text("0"); Spider.move_To(100,100); Spider.Draw.display_Text("1"); Spider.move_To(150, 50); Spider.Draw.display_Text("2"); Spider.move_To(200,100); Spider.Draw.display_Text("3"); Spider.move_To(250, 50); Spider.Draw.display_Text("4"); Spider.move_To(300,100); Spider.Draw.display_Text("5"); Spider.move_To(350, 50); Spider.Draw.display_Text("6"); Spider.move_To(400,100); Spider.Draw.display_Text("7"); Spider.move_To(450, 50); Spider.Draw.display_Text("8"); Spider.move_To(500,100); Spider.Draw.display_Text("9"); color.r := 0; color.g := 0; color.b := 0; for I in 0..255 loop color.r := I; Spider.Draw.set_Color_Pen(color); Spider.line_To(50+I,250, 50+I,300); end loop; color.r := 0; color.g := 0; color.b := 0; for I in 0..255 loop color.g := I; Spider.Draw.set_Color_Pen(color); Spider.line_To(50+I,300, 50+I,350); end loop; color.r := 0; color.g := 0; color.b := 0; for I in 0..255 loop color.b := I; Spider.Draw.set_Color_Pen(color); Spider.line_To(50+I,350, 50+I,400); end loop; color.r := 255; color.g := 255; color.b := 0; Spider.Draw.set_Color_Pen(color); Spider.move_To(260,300); Spider.Draw.circle(10,Spider.Draw.noFill); Spider.move_To(260,350); Spider.Draw.circle(10,Spider.Draw.fill); color.r := 0; color.g := 255; color.b := 255; Spider.Draw.set_Color_Pen(color); while true loop Spider.User.key_Pressed(car_Temp,Clic); if Clic then Car := Car_Temp; end if; Spider.User.left_Clic(x,y,Clic); if Clic then Spider.line_To(ax,ay,x,y); Spider.Draw.Display_Text((1=>Car)); Put("Ajout du point ("); Put(Integer'image(X)); Put(","); Put(Integer'image(Y)); Put_Line(")."); ax := x; ay := y; else Spider.User.Sleep(50); end if; end loop; Spider.close_Window; end Test;