-- Auto generated by RAPID
-- By: Martin C. Carlisle and W. Blair Watkinson II

with Actions;
with Actions;

with Actions;
with Actions;

with Mcc.Gui.Fonts;

package body main_window is

   procedure Generate_Window is
   begin

      if Mcc.Gui.Container.Window.Is_Open(Mcc.Gui.Container.Window.Window(main_window)) then
         raise Already_Open;
      end if;

      Mcc.Gui.Container.Window.Create(
         Obj    => main_window,
         X      => 0,
         Y      => 0,
         Width  => 300,
         Height => 300);

      Mcc.Gui.Container.Window.Set_Title(
         Obj   => main_window,
         Title => "main");

      Mcc.Gui.Menu.Create(
         Obj    => main_Menu,
         Window => main_window);

      Mcc.Gui.Menu.Add_SubMenu(
         Obj         => Actions_SubMenu,
         Text        => "Actions",
         Underline   => 0,
         Parent_Menu => main_Menu);
      Mcc.Gui.Menu.Add_Choice(
         Obj         => Action1_Choice,
         To_Menu     => Actions_SubMenu,
         Text        => "Action1",
         Action      => Actions.Action1'access,
         Underline   => 6,
         Accelerator => "Ctrl+1");
      Mcc.Gui.Menu.Add_Choice(
         Obj         => Action2_Choice,
         To_Menu     => Actions_SubMenu,
         Text        => "Action2",
         Action      => Actions.Action2'access,
         Underline   => 6,
         Accelerator => "Ctrl+2");

      Mcc.Gui.Widget.Button.Text.Create(
         Obj    => action1,
         Parent => main_window,
         X      => 38,
         Y      => 44,
         Width  => 95,
         Height => 21,
         Text   => "Action number 1");
      Mcc.Gui.Widget.Button.Set_Push_Callback(
         Obj      => action1'access,
         Callback => Actions.action1'access);
      Mcc.Gui.Image.Create(
         Obj  => cut_gif_gif_Image,
         Name => "cut_gif.gif");
      Mcc.Gui.Widget.Button.Picture.Create(
         Obj    => cut,
         Parent => main_window,
         X      => 50,
         Y      => 89,
         Width  => 53,
         Height => 20,
         Image  => cut_gif_gif_Image);
      Mcc.Gui.Widget.Button.Set_Push_Callback(
         Obj      => cut'access,
         Callback => Actions.Action2'access);

   end Generate_Window;


   procedure Fill_Window is
   begin
      null; -- in case there aren't any widgets to fill

   end Fill_Window;

   procedure Generate_and_Fill_Window is
   begin
       Generate_Window;
       Fill_Window;
   end Generate_and_Fill_Window;

   procedure Read_Window(
         Success         :    out Boolean;
         Highlight_Error : in     Boolean := True;
         Beep_On_Error   : in     Boolean := True) is
   begin
      Success := True;
   exception when others =>
      Success := False;
      if Beep_On_Error then
         Mcc.Gui.Bell;
      end if;
   end Read_Window;

   procedure Close_Window is
   begin
      Mcc.Gui.Destroy(Mcc.Gui.Object(main_window));
   end Close_Window;


end main_window;
