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

with File_Menu;
with File_Menu;
with File_Menu;
with Subwindow_Actions;
with Edit_Menu;
with Edit_Menu;
with Tools_Menu;
with Toolbar;
with Toolbar;
with Toolbar;
with Toolbar;
with Toolbar;
with Toolbar;
with Toolbar;
with toolbar;
with Toolbar;
with Toolbar;
with Toolbar;

with File_Menu;
with File_Menu;
with File_Menu;
with File_Menu;
with File_Menu;
with File_Menu;
with Edit_Menu;
with Edit_Menu;
with Edit_Menu;
with Tools_Menu;
with Help_Menu;

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  => 312,
         Height => 117);

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

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

      Mcc.Gui.Menu.Add_SubMenu(
         Obj         => File_SubMenu,
         Text        => "File",
         Underline   => 1,
         Parent_Menu => main_Menu);
      Mcc.Gui.Menu.Add_Choice(
         Obj         => New_Choice,
         To_Menu     => File_SubMenu,
         Text        => "New",
         Action      => File_Menu.New_Choice'access,
         Underline   => 1,
         Accelerator => "Ctrl+N");
      Mcc.Gui.Menu.Add_Choice(
         Obj         => Open_Choice,
         To_Menu     => File_SubMenu,
         Text        => "Open",
         Action      => File_Menu.Open_Choice'access,
         Underline   => 1,
         Accelerator => "Ctrl+O");
      Mcc.Gui.Menu.Add_Choice(
         Obj         => Close_Choice,
         To_Menu     => File_SubMenu,
         Text        => "Close",
         Action      => File_Menu.Close_Choice'access,
         Underline   => 1,
         Accelerator => "Ctrl+F4");
      Mcc.Gui.Menu.Add_Choice(
         Obj         => Save_Choice,
         To_Menu     => File_SubMenu,
         Text        => "Save",
         Action      => File_Menu.Save_Choice'access,
         Underline   => 1,
         Accelerator => "Ctrl+S");
      Mcc.Gui.Menu.Add_Choice(
         Obj         => Save_As_Choice,
         To_Menu     => File_SubMenu,
         Text        => "Save As",
         Action      => File_Menu.SaveAs_Choice'access,
         Underline   => 6,
         Accelerator => "");
      Mcc.Gui.Menu.Add_Choice(
         Obj         => Exit_Choice,
         To_Menu     => File_SubMenu,
         Text        => "Exit",
         Action      => File_Menu.Exit_Choice'access,
         Underline   => 2,
         Accelerator => "");
      Mcc.Gui.Menu.Add_SubMenu(
         Obj         => Edit_SubMenu,
         Text        => "Edit",
         Underline   => 1,
         Parent_Menu => main_Menu);
      Mcc.Gui.Menu.Add_Choice(
         Obj         => Modify_Window_Choice,
         To_Menu     => Edit_SubMenu,
         Text        => "Modify Window",
         Action      => Edit_Menu.Change_Window'access,
         Underline   => 1,
         Accelerator => "");
      Mcc.Gui.Menu.Add_Choice(
         Obj         => Delete_Choice,
         To_Menu     => Edit_SubMenu,
         Text        => "Delete",
         Action      => Edit_Menu.Delete_Choice'access,
         Underline   => 3,
         Accelerator => "Del");
      Mcc.Gui.Menu.Add_Choice(
         Obj         => Duplicate_Choice,
         To_Menu     => Edit_SubMenu,
         Text        => "Duplicate",
         Action      => Edit_Menu.Duplicate_Choice'access,
         Underline   => 3,
         Accelerator => "Ctrl+D");
      Mcc.Gui.Menu.Add_SubMenu(
         Obj         => Tools_SubMenu,
         Text        => "Tools",
         Underline   => 1,
         Parent_Menu => main_Menu);
      Mcc.Gui.Menu.Add_Choice(
         Obj         => Compile_Choice,
         To_Menu     => Tools_SubMenu,
         Text        => "Compile",
         Action      => Tools_Menu.Compile_Choice'access,
         Underline   => 1,
         Accelerator => "Ctrl+M");
      Mcc.Gui.Menu.Add_SubMenu(
         Obj         => Help_SubMenu,
         Text        => "Help",
         Underline   => 1,
         Parent_Menu => main_Menu);
      Mcc.Gui.Menu.Add_Choice(
         Obj         => About_Choice,
         To_Menu     => Help_SubMenu,
         Text        => "About",
         Action      => Help_Menu.About'access,
         Underline   => 1,
         Accelerator => "");

      Mcc.Gui.Image.Create(
         Obj  => new_gif_gif_Image,
         Name => "new_gif.gif");
      Mcc.Gui.Widget.Button.Picture.Create(
         Obj    => newButton,
         Parent => main_window,
         X      => 0,
         Y      => 0,
         Width  => 27,
         Height => 27,
         Image  => new_gif_gif_Image);
      Mcc.Gui.Widget.Button.Picture.Set_Tooltip_Text(
         Obj    => newButton,
         Text  => "New");
      Mcc.Gui.Widget.Button.Set_Push_Callback(
         Obj      => newButton'access,
         Callback => File_Menu.New_Choice'access);
      Mcc.Gui.Image.Create(
         Obj  => open_gif_gif_Image,
         Name => "open_gif.gif");
      Mcc.Gui.Widget.Button.Picture.Create(
         Obj    => openButton,
         Parent => main_window,
         X      => 27,
         Y      => 0,
         Width  => 27,
         Height => 27,
         Image  => open_gif_gif_Image);
      Mcc.Gui.Widget.Button.Picture.Set_Tooltip_Text(
         Obj    => openButton,
         Text  => "Open");
      Mcc.Gui.Widget.Button.Set_Push_Callback(
         Obj      => openButton'access,
         Callback => File_Menu.Open_Choice'access);
      Mcc.Gui.Image.Create(
         Obj  => save_gif_gif_Image,
         Name => "save_gif.gif");
      Mcc.Gui.Widget.Button.Picture.Create(
         Obj    => saveButton,
         Parent => main_window,
         X      => 54,
         Y      => 0,
         Width  => 27,
         Height => 27,
         Image  => save_gif_gif_Image);
      Mcc.Gui.Widget.Button.Picture.Set_Tooltip_Text(
         Obj    => saveButton,
         Text  => "Save");
      Mcc.Gui.Widget.Button.Set_Push_Callback(
         Obj      => saveButton'access,
         Callback => File_Menu.Save_Choice'access);
      Mcc.Gui.Image.Create(
         Obj  => menu_gif_gif_Image,
         Name => "menu_gif.gif");
      Mcc.Gui.Widget.Button.Picture.Create(
         Obj    => menubutton,
         Parent => main_window,
         X      => 91,
         Y      => 0,
         Width  => 27,
         Height => 27,
         Image  => menu_gif_gif_Image);
      Mcc.Gui.Widget.Button.Picture.Set_Tooltip_Text(
         Obj    => menubutton,
         Text  => "Edit menus");
      Mcc.Gui.Widget.Button.Set_Push_Callback(
         Obj      => menubutton'access,
         Callback => Subwindow_Actions.Edit_Menu'access);
      Mcc.Gui.Image.Create(
         Obj  => cut_gif_gif_Image,
         Name => "cut_gif.gif");
      Mcc.Gui.Widget.Button.Picture.Create(
         Obj    => cutButton,
         Parent => main_window,
         X      => 128,
         Y      => 0,
         Width  => 27,
         Height => 27,
         Image  => cut_gif_gif_Image);
      Mcc.Gui.Widget.Button.Picture.Set_Tooltip_Text(
         Obj    => cutButton,
         Text  => "Cut");
      Mcc.Gui.Widget.Button.Set_Push_Callback(
         Obj      => cutButton'access,
         Callback => Edit_Menu.Delete_Choice'access);
      Mcc.Gui.Image.Create(
         Obj  => copy_gif_gif_Image,
         Name => "copy_gif.gif");
      Mcc.Gui.Widget.Button.Picture.Create(
         Obj    => duplicatebutton,
         Parent => main_window,
         X      => 155,
         Y      => 0,
         Width  => 27,
         Height => 27,
         Image  => copy_gif_gif_Image);
      Mcc.Gui.Widget.Button.Picture.Set_Tooltip_Text(
         Obj    => duplicatebutton,
         Text  => "Duplicate");
      Mcc.Gui.Widget.Button.Set_Push_Callback(
         Obj      => duplicatebutton'access,
         Callback => Edit_Menu.Duplicate_Choice'access);
      Mcc.Gui.Image.Create(
         Obj  => compile_gif_gif_Image,
         Name => "compile_gif.gif");
      Mcc.Gui.Widget.Button.Picture.Create(
         Obj    => compileButton,
         Parent => main_window,
         X      => 182,
         Y      => 0,
         Width  => 27,
         Height => 27,
         Image  => compile_gif_gif_Image);
      Mcc.Gui.Widget.Button.Picture.Set_Tooltip_Text(
         Obj    => compileButton,
         Text  => "Compile");
      Mcc.Gui.Widget.Button.Set_Push_Callback(
         Obj      => compileButton'access,
         Callback => Tools_Menu.Compile_Choice'access);
      Mcc.Gui.Image.Create(
         Obj  => label_gif_gif_Image,
         Name => "label_gif.gif");
      Mcc.Gui.Widget.Button.Picture.Create(
         Obj    => labelButton,
         Parent => main_window,
         X      => 0,
         Y      => 29,
         Width  => 27,
         Height => 27,
         Image  => label_gif_gif_Image);
      Mcc.Gui.Widget.Button.Picture.Set_Tooltip_Text(
         Obj    => labelButton,
         Text  => "Text label");
      Mcc.Gui.Widget.Button.Set_Push_Callback(
         Obj      => labelButton'access,
         Callback => Toolbar.Select_Widget'access);
      Mcc.Gui.Image.Create(
         Obj  => text_button_gif_gif_Image,
         Name => "text_button_gif.gif");
      Mcc.Gui.Widget.Button.Picture.Create(
         Obj    => textBButton,
         Parent => main_window,
         X      => 27,
         Y      => 29,
         Width  => 27,
         Height => 27,
         Image  => text_button_gif_gif_Image);
      Mcc.Gui.Widget.Button.Picture.Set_Tooltip_Text(
         Obj    => textBButton,
         Text  => "Text button");
      Mcc.Gui.Widget.Button.Set_Push_Callback(
         Obj      => textBButton'access,
         Callback => Toolbar.Select_Widget'access);
      Mcc.Gui.Image.Create(
         Obj  => picture_button_gif_gif_Image,
         Name => "picture_button_gif.gif");
      Mcc.Gui.Widget.Button.Picture.Create(
         Obj    => pictureBButton,
         Parent => main_window,
         X      => 54,
         Y      => 29,
         Width  => 27,
         Height => 27,
         Image  => picture_button_gif_gif_Image);
      Mcc.Gui.Widget.Button.Picture.Set_Tooltip_Text(
         Obj    => pictureBButton,
         Text  => "Picture button");
      Mcc.Gui.Widget.Button.Set_Push_Callback(
         Obj      => pictureBButton'access,
         Callback => Toolbar.Select_Widget'access);
      Mcc.Gui.Image.Create(
         Obj  => text_entry_gif_gif_Image,
         Name => "text_entry_gif.gif");
      Mcc.Gui.Widget.Button.Picture.Create(
         Obj    => textEntryButton,
         Parent => main_window,
         X      => 81,
         Y      => 29,
         Width  => 27,
         Height => 27,
         Image  => text_entry_gif_gif_Image);
      Mcc.Gui.Widget.Button.Picture.Set_Tooltip_Text(
         Obj    => textEntryButton,
         Text  => "Text entry");
      Mcc.Gui.Widget.Button.Set_Push_Callback(
         Obj      => textEntryButton'access,
         Callback => Toolbar.Select_Widget'access);
      Mcc.Gui.Image.Create(
         Obj  => check_gif_gif_Image,
         Name => "check_gif.gif");
      Mcc.Gui.Widget.Button.Picture.Create(
         Obj    => check_button,
         Parent => main_window,
         X      => 108,
         Y      => 29,
         Width  => 27,
         Height => 27,
         Image  => check_gif_gif_Image);
      Mcc.Gui.Widget.Button.Picture.Set_Tooltip_Text(
         Obj    => check_button,
         Text  => "Check button");
      Mcc.Gui.Widget.Button.Set_Push_Callback(
         Obj      => check_button'access,
         Callback => Toolbar.Select_Widget'access);
      Mcc.Gui.Image.Create(
         Obj  => radio_button_gif_gif_Image,
         Name => "radio_button_gif.gif");
      Mcc.Gui.Widget.Button.Picture.Create(
         Obj    => radio_button,
         Parent => main_window,
         X      => 135,
         Y      => 29,
         Width  => 27,
         Height => 27,
         Image  => radio_button_gif_gif_Image);
      Mcc.Gui.Widget.Button.Picture.Set_Tooltip_Text(
         Obj    => radio_button,
         Text  => "Radio button");
      Mcc.Gui.Widget.Button.Set_Push_Callback(
         Obj      => radio_button'access,
         Callback => Toolbar.Select_Widget'access);
      Mcc.Gui.Image.Create(
         Obj  => picture_gif_gif_Image,
         Name => "picture_gif.gif");
      Mcc.Gui.Widget.Button.Picture.Create(
         Obj    => picture_select,
         Parent => main_window,
         X      => 162,
         Y      => 29,
         Width  => 27,
         Height => 27,
         Image  => picture_gif_gif_Image);
      Mcc.Gui.Widget.Button.Picture.Set_Tooltip_Text(
         Obj    => picture_select,
         Text  => "Picture");
      Mcc.Gui.Widget.Button.Set_Push_Callback(
         Obj      => picture_select'access,
         Callback => Toolbar.Select_Widget'access);
      Mcc.Gui.Image.Create(
         Obj  => listbox_gif_gif_Image,
         Name => "listbox_gif.gif");
      Mcc.Gui.Widget.Button.Picture.Create(
         Obj    => listboxButton,
         Parent => main_window,
         X      => 189,
         Y      => 29,
         Width  => 27,
         Height => 27,
         Image  => listbox_gif_gif_Image);
      Mcc.Gui.Widget.Button.Picture.Set_Tooltip_Text(
         Obj    => listboxButton,
         Text  => "Listbox");
      Mcc.Gui.Widget.Button.Set_Push_Callback(
         Obj      => listboxButton'access,
         Callback => toolbar.select_widget'access);
      Mcc.Gui.Image.Create(
         Obj  => scale_button_gif_gif_Image,
         Name => "scale_button_gif.gif");
      Mcc.Gui.Widget.Button.Picture.Create(
         Obj    => scaleButton,
         Parent => main_window,
         X      => 216,
         Y      => 29,
         Width  => 27,
         Height => 27,
         Image  => scale_button_gif_gif_Image);
      Mcc.Gui.Widget.Button.Picture.Set_Tooltip_Text(
         Obj    => scaleButton,
         Text  => "Scale slider");
      Mcc.Gui.Widget.Button.Set_Push_Callback(
         Obj      => scaleButton'access,
         Callback => Toolbar.Select_Widget'access);
      Mcc.Gui.Image.Create(
         Obj  => progress_button_gif_gif_Image,
         Name => "progress_button_gif.gif");
      Mcc.Gui.Widget.Button.Picture.Create(
         Obj    => progressbutton,
         Parent => main_window,
         X      => 243,
         Y      => 29,
         Width  => 27,
         Height => 27,
         Image  => progress_button_gif_gif_Image);
      Mcc.Gui.Widget.Button.Picture.Set_Tooltip_Text(
         Obj    => progressbutton,
         Text  => "Progress bar");
      Mcc.Gui.Widget.Button.Set_Push_Callback(
         Obj      => progressbutton'access,
         Callback => Toolbar.Select_Widget'access);
      Mcc.Gui.Image.Create(
         Obj  => dropdown_button_gif_gif_Image,
         Name => "dropdown_button_gif.gif");
      Mcc.Gui.Widget.Button.Picture.Create(
         Obj    => dropdownbutton,
         Parent => main_window,
         X      => 270,
         Y      => 29,
         Width  => 27,
         Height => 27,
         Image  => dropdown_button_gif_gif_Image);
      Mcc.Gui.Widget.Button.Picture.Set_Tooltip_Text(
         Obj    => dropdownbutton,
         Text  => "Dropdown list");
      Mcc.Gui.Widget.Button.Set_Push_Callback(
         Obj      => dropdownbutton'access,
         Callback => Toolbar.Select_Widget'access);
      Mcc.Gui.Widget.Label.Create(
         Obj     => name,
         Parent  => main_window,
         X       => 0,
         Y       => 59,
         Width   => 180,
         Height  => 23,
         Justify => Mcc.Gui.Widget.Label.left,
         Text    => "No Window Open");
      Mcc.Gui.Widget.Label.Set_Foreground_Color(
         Obj       => name,
         New_Color => Mcc.Gui.Colors.Named_Color(
            Mcc.Gui.Colors.black));

   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;
