with Mcc.Common_Dialogs;

package body file_menu is
   Max_Name_Length : constant := 80;
   ----------
   -- open --
   ----------

   procedure open is
      Filename       : String(1..Max_Name_Length);
      Filename_Last  : Natural;

   begin
      Mcc.Common_Dialogs.Open_Dialog(
         File_Types => "{ ""Ada files"" {.adb .ads} } " &
                       "{ ""All files"" * }",
         Filename => Filename,
         File_Last => Filename_Last);
      if Filename_Last >= Filename'First then
         Mcc.Common_Dialogs.OK_Box(
            Message => "You selected to open:" & ASCII.LF &
               Filename(Filename'First..Filename_Last));
      end if;
   end open;

   ----------
   -- quit --
   ----------

   procedure quit is
   begin
      Mcc.Common_Dialogs.Quit_Dialog;
   end quit;

   ----------
   -- save --
   ----------

   procedure save is
      Filename       : String(1..Max_Name_Length);
      Filename_Last  : Natural;

   begin
      Mcc.Common_Dialogs.Save_Dialog(
         File_Types => "{ ""Ada files"" {.adb .ads} } " &
                       "{ ""All files"" * }",
         Filename => Filename,
         File_Last => Filename_Last);
      if Filename_Last >= Filename'First then
         Mcc.Common_Dialogs.OK_Box(
            Message => "You selected to save as:" & ASCII.LF &
               Filename(Filename'First..Filename_Last));
      end if;
   end save;

end file_menu;
