with mcc.gui.container.window;
with mcc.gui.widget.label;
with mcc.gui.widget.picture;
with ada.text_io;
use ada.text_io;
with mcc.gui.colors;
with mcc.gui.image;

procedure static_test is
   Window  : aliased mcc.gui.container.window.main_window;
   label1  : aliased mcc.gui.widget.label.label;
   image1  : aliased mcc.gui.image.external_image;
   image2  : aliased mcc.gui.image.external_image;
   picture1: aliased mcc.gui.widget.picture.picture;
   
   
   procedure Key_Listener (
      Obj   : in out mcc.gui.Sized_Object'Class;
      Event : in     mcc.gui.Key_Event) is
   begin
      put_line("key " &
         mcc.gui.key_action_type'image(event.action) &
         mcc.gui.key_type'image(event.key));
   end Key_Listener;

   procedure Mouse_Listener (
      Obj   : in out mcc.gui.Sized_Object'Class;
      Event : in     mcc.gui.Mouse_Event) is
   begin
      put_line(
         mcc.gui.mouse_action_type'image(event.action) & " " &
         mcc.gui.mouse_button'image(event.button) &
         natural'image(event.x) & natural'image(event.y));
   end Mouse_Listener;

begin
   -- test window functions
   mcc.gui.container.window.create(window,
      100,100,300,300);
   mcc.gui.container.window.set_title(window,"Fr""ed");


   -- test label functions
   mcc.gui.widget.label.create(label1,
      window,28,20,103,28,mcc.gui.widget.label.right,"b\\o}b""]{is");
   mcc.gui.widget.label.set_background_color(
      label1,mcc.gui.colors.named_color(
         mcc.gui.colors.red));
   put_line("past background");
   mcc.gui.widget.label.set_foreground_color(
      label1,mcc.gui.colors.to_color("FF00FF"));
--   mcc.gui.widget.label.set_text(
--      label1,"Changed! bo\\o}b""]{is");
--   mcc.gui.set_key_listener(label1'unchecked_access,
--      key_listener'unrestricted_access);
--   mcc.gui.set_mouse_listener(label1'unchecked_access,
--      mouse_listener'unrestricted_access);
--   mcc.gui.widget.label.set_tooltip_text(
--      label1,"Tool1");
      
   -- test picture
   mcc.gui.image.create(image1,"label_gif.gif");
   mcc.gui.image.create(image2,"listbox_gif.gif");
   mcc.gui.widget.picture.create(picture1,window,
      212,62,48,32,mcc.gui.image.image(image1));
   mcc.gui.widget.picture.set_image(picture1,image2);
   mcc.gui.widget.picture.set_tooltip_text(
      picture1,"Tool picture");
   mcc.gui.set_key_listener(picture1'unchecked_access,
      key_listener'unrestricted_access);
   mcc.gui.set_mouse_listener(picture1'unchecked_access,
      mouse_listener'unrestricted_access);

   mcc.gui.container.window.event_loop;
end static_test;
