-----------------------------------------------------------------------
--                              Mast                                 --
--     Modelling and Analysis Suite for Real-Time Applications       --
--                                                                   --
--                           GMastEditor                             --
--          Graphical Editor for Modelling and Analysis              --
--                    of Real-Time Applications                      --
--                                                                   --
--                       Copyright (C) 2001-2019                     --
--                 Universidad de Cantabria, SPAIN                   --
--                                                                   --
-- Authors : Pilar del Rio                                           --
--           Michael Gonzalez Harbour                                --
--                                                                   --
-- Contact info: Michael Gonzalez       mgh@unican.es                --
--                                                                   --
-- This program is free software; you can redistribute it and/or     --
-- modify it under the terms of the GNU General Public               --
-- License as published by the Free Software Foundation; either      --
-- version 2 of the License, or (at your option) any later version.  --
--                                                                   --
-- This program is distributed in the hope that it will be useful,   --
-- but WITHOUT ANY WARRANTY; without even the implied warranty of    --
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU --
-- General Public License for more details.                          --
--                                                                   --
-- You should have received a copy of the GNU General Public         --
-- License along with this program; if not, write to the             --
-- Free Software Foundation, Inc., 59 Temple Place - Suite 330,      --
-- Boston, MA 02111-1307, USA.                                       --
--                                                                   --
-----------------------------------------------------------------------
with Glib;                              use Glib;
with Gtk;                               use Gtk;
with Gdk.Types;                         use Gdk.Types;
with Gtk.Widget;                        use Gtk.Widget;
with Gtk.Enums;                         use Gtk.Enums;
with Gtkada.Handlers;                   use Gtkada.Handlers;
with Gtk.Window;                           use Gtk.Window;
with Mast_Editor_Window_Pkg;
with Utilities;                         use Utilities;
with Callbacks_Mast_Editor;             use Callbacks_Mast_Editor;
with Mast_Editor_Intl;                  use Mast_Editor_Intl;
with Second_Sched_Dialog_Pkg.Callbacks; use Second_Sched_Dialog_Pkg.Callbacks;

with Mast;                    use Mast;
with Mast.IO;                 use Mast.IO;
with Mast.Scheduling_Servers; use Mast.Scheduling_Servers;
with Var_Strings;             use Var_Strings;
with Editor_Actions;          use Editor_Actions;

package body Second_Sched_Dialog_Pkg is

   procedure Gtk_New (Second_Sched_Dialog : out Second_Sched_Dialog_Access) is
   begin
      Second_Sched_Dialog := new Second_Sched_Dialog_Record;
      Second_Sched_Dialog_Pkg.Initialize (Second_Sched_Dialog);
   end Gtk_New;

   procedure Initialize
     (Second_Sched_Dialog : access Second_Sched_Dialog_Record'Class)
   is
      pragma Suppress (All_Checks);
      Pixmaps_Dir             : constant String := "pixmaps/";
      Server_Combo_Items      : String_List.Glist;
      Policy_Type_Combo_Items : String_List.Glist;

      Ser_Ref   : Mast.Scheduling_Servers.Scheduling_Server_Ref;
      Ser_Index : Mast.Scheduling_Servers.Lists.Index;
      Ser_Name  : Var_Strings.Var_String;

   begin
      -- We search System Servers and show them in Server_Combo
      Mast.Scheduling_Servers.Lists.Rewind
        (The_System.Scheduling_Servers,
         Ser_Index);
      for I in
        1 ..
        Mast.Scheduling_Servers.Lists.Size
        (The_System.Scheduling_Servers)
      loop
         Mast.Scheduling_Servers.Lists.Get_Next_Item
           (Ser_Ref,
            The_System.Scheduling_Servers,
            Ser_Index);
         Ser_Name := Mast.Scheduling_Servers.Name (Ser_Ref);
         String_List.Append (Server_Combo_Items, To_String (Ser_Name));
      end loop;

      --  Gtk.Dialog.Initialize (Second_Sched_Dialog);
      --  Set_Title (Second_Sched_Dialog, -"Secondary Scheduler Parameters");
      --  Set_Position (Second_Sched_Dialog, Win_Pos_Center_Always);
      --  Set_Modal (Second_Sched_Dialog, False);
      --  Set_Policy (Second_Sched_Dialog, False, False, False);
      Gtk.Dialog.Initialize 
	(Dialog => Second_Sched_Dialog,
	 Title => -"Secondary Scheduler Parameters",
	 Parent => Gtk_Window(Mast_Editor_Window_Pkg.Mast_Editor_Window),
	 Flags => Gtk.Dialog.Modal);
      
      Gtk_New_Hbox (Second_Sched_Dialog.Hbox103, True, 100);
      Pack_Start
        (Get_Action_Area (Second_Sched_Dialog),
         Second_Sched_Dialog.Hbox103);

      Gtk_New (Second_Sched_Dialog.Ok_Button, -"OK");
      Set_Relief (Second_Sched_Dialog.Ok_Button, Relief_Normal);
      Pack_Start
        (Second_Sched_Dialog.Hbox103,
         Second_Sched_Dialog.Ok_Button,
         Expand  => True,
         Fill    => True,
         Padding => 30);

      Gtk_New (Second_Sched_Dialog.Cancel_Button, -"Cancel");
      Set_Relief (Second_Sched_Dialog.Cancel_Button, Relief_Normal);
      Pack_End
        (Second_Sched_Dialog.Hbox103,
         Second_Sched_Dialog.Cancel_Button,
         Expand  => True,
         Fill    => True,
         Padding => 30);
      --     Button_Callback.Connect
      --       (Second_Sched_Dialog.Cancel_Button, "clicked",
      --        Button_Callback.To_Marshaller
      --(On_Cancel_Button_Clicked'Access), False);

      Dialog_Callback.Object_Connect
        (Second_Sched_Dialog.Cancel_Button,
         "clicked",
         Dialog_Callback.To_Marshaller (On_Cancel_Button_Clicked'Access),
         Second_Sched_Dialog);

      Gtk_New_Vbox (Second_Sched_Dialog.Vbox25, False, 0);
      Pack_Start
        (Get_Content_Area (Second_Sched_Dialog),
         Second_Sched_Dialog.Vbox25,
         Expand  => False,
         Fill    => True,
         Padding => 0);

      Gtk_New (Second_Sched_Dialog.Table36, 4, 2, True);
      Set_Border_Width (Second_Sched_Dialog.Table36, 5);
      Set_Row_Spacings (Second_Sched_Dialog.Table36, 3);
      Set_Col_Spacings (Second_Sched_Dialog.Table36, 3);
      Pack_Start
        (Second_Sched_Dialog.Vbox25,
         Second_Sched_Dialog.Table36,
         Expand  => False,
         Fill    => False,
         Padding => 5);

      Gtk_New (Second_Sched_Dialog.Label358, -("Name"));
      Set_Alignment (Second_Sched_Dialog.Label358, 0.95, 0.5);
      Set_Padding (Second_Sched_Dialog.Label358, 0, 0);
      Set_Justify (Second_Sched_Dialog.Label358, Justify_Center);
      Set_Line_Wrap (Second_Sched_Dialog.Label358, False);
      Set_Selectable (Second_Sched_Dialog.Label358, False);
      Set_Use_Markup (Second_Sched_Dialog.Label358, False);
      Set_Use_Underline (Second_Sched_Dialog.Label358, False);
      Attach
        (Second_Sched_Dialog.Table36,
         Second_Sched_Dialog.Label358,
         Left_Attach   => 0,
         Right_Attach  => 1,
         Top_Attach    => 0,
         Bottom_Attach => 1,
         Xoptions      => Fill,
         Xpadding      => 0,
         Ypadding      => 0);

      Gtk_New (Second_Sched_Dialog.Second_Sched_Name_Entry);
      Set_Editable (Second_Sched_Dialog.Second_Sched_Name_Entry, True);
      Set_Max_Length (Second_Sched_Dialog.Second_Sched_Name_Entry, 0);
      Set_Text (Second_Sched_Dialog.Second_Sched_Name_Entry, -(""));
      Set_Visibility (Second_Sched_Dialog.Second_Sched_Name_Entry, True);
      Set_Invisible_Char
        (Second_Sched_Dialog.Second_Sched_Name_Entry,
         UTF8_Get_Char ("*"));
      Attach
        (Second_Sched_Dialog.Table36,
         Second_Sched_Dialog.Second_Sched_Name_Entry,
         Left_Attach   => 1,
         Right_Attach  => 2,
         Top_Attach    => 0,
         Bottom_Attach => 1,
         Xpadding      => 0,
         Ypadding      => 0);

      Gtk_New (Second_Sched_Dialog.Label359, -("Server"));
      Set_Alignment (Second_Sched_Dialog.Label359, 0.95, 0.5);
      Set_Padding (Second_Sched_Dialog.Label359, 0, 0);
      Set_Justify (Second_Sched_Dialog.Label359, Justify_Center);
      Set_Line_Wrap (Second_Sched_Dialog.Label359, False);
      Set_Selectable (Second_Sched_Dialog.Label359, False);
      Set_Use_Markup (Second_Sched_Dialog.Label359, False);
      Set_Use_Underline (Second_Sched_Dialog.Label359, False);
      Attach
        (Second_Sched_Dialog.Table36,
         Second_Sched_Dialog.Label359,
         Left_Attach   => 0,
         Right_Attach  => 1,
         Top_Attach    => 1,
         Bottom_Attach => 2,
         Xoptions      => Fill,
         Xpadding      => 0,
         Ypadding      => 0);

      Gtk_New (Second_Sched_Dialog.Server_Combo);
      --Set_Value_In_List (Second_Sched_Dialog.Server_Combo, False);
      --Set_Use_Arrows (Second_Sched_Dialog.Server_Combo, True);
      --Set_Case_Sensitive (Second_Sched_Dialog.Server_Combo, False);
      --Set_Editable (Get_Entry (Second_Sched_Dialog.Server_Combo), False);
      --Set_Has_Frame (Get_Entry (Second_Sched_Dialog.Server_Combo), True);
      --Set_Max_Length (Get_Entry (Second_Sched_Dialog.Server_Combo), 0);
      --Set_Invisible_Char
      --  (Get_Entry (Second_Sched_Dialog.Server_Combo),
      --   UTF8_Get_Char ("*"));
      --Set_Has_Frame (Get_Entry (Second_Sched_Dialog.Server_Combo), True);
      String_List.Append (Server_Combo_Items, -("(NONE)"));
      Utilities.Set_Popdown_Strings
        (Second_Sched_Dialog.Server_Combo,
         Server_Combo_Items);
      Set_Text_In_Combo_Box (Second_Sched_Dialog.Server_Combo, -("(NONE)"));
      Free_String_List (Server_Combo_Items);
      Attach
        (Second_Sched_Dialog.Table36,
         Second_Sched_Dialog.Server_Combo,
         Left_Attach   => 1,
         Right_Attach  => 2,
         Top_Attach    => 1,
         Bottom_Attach => 2,
         Xpadding      => 0,
         Ypadding      => 0);

      Gtk_New (Second_Sched_Dialog.Label362, -("SCHEDULING POLICY :"));
      Set_Alignment (Second_Sched_Dialog.Label362, 0.5, 0.5);
      Set_Padding (Second_Sched_Dialog.Label362, 0, 5);
      Set_Justify (Second_Sched_Dialog.Label362, Justify_Center);
      Set_Line_Wrap (Second_Sched_Dialog.Label362, False);
      Set_Selectable (Second_Sched_Dialog.Label362, False);
      Set_Use_Markup (Second_Sched_Dialog.Label362, False);
      Set_Use_Underline (Second_Sched_Dialog.Label362, False);
      Attach
        (Second_Sched_Dialog.Table36,
         Second_Sched_Dialog.Label362,
         Left_Attach   => 0,
         Right_Attach  => 2,
         Top_Attach    => 2,
         Bottom_Attach => 3,
         Xoptions      => Fill,
         Xpadding      => 0,
         Ypadding      => 0);

      Gtk_New (Second_Sched_Dialog.Label363, -("Policy Type"));
      Set_Alignment (Second_Sched_Dialog.Label363, 1.0, 0.5);
      Set_Padding (Second_Sched_Dialog.Label363, 0, 0);
      Set_Justify (Second_Sched_Dialog.Label363, Justify_Center);
      Set_Line_Wrap (Second_Sched_Dialog.Label363, False);
      Set_Selectable (Second_Sched_Dialog.Label363, False);
      Set_Use_Markup (Second_Sched_Dialog.Label363, False);
      Set_Use_Underline (Second_Sched_Dialog.Label363, False);
      Attach
        (Second_Sched_Dialog.Table36,
         Second_Sched_Dialog.Label363,
         Left_Attach   => 0,
         Right_Attach  => 1,
         Top_Attach    => 3,
         Bottom_Attach => 4,
         Xoptions      => Fill,
         Xpadding      => 0,
         Ypadding      => 0);

      Gtk_New (Second_Sched_Dialog.Policy_Type_Combo);
      --Set_Value_In_List (Second_Sched_Dialog.Policy_Type_Combo, False);
      --Set_Use_Arrows (Second_Sched_Dialog.Policy_Type_Combo, True);
      --Set_Case_Sensitive (Second_Sched_Dialog.Policy_Type_Combo, False);
      --Set_Editable (Get_Entry (Second_Sched_Dialog.Policy_Type_Combo), False);
      --Set_Has_Frame (Get_Entry (Second_Sched_Dialog.Policy_Type_Combo), True);
      --Set_Max_Length (Get_Entry (Second_Sched_Dialog.Policy_Type_Combo), 0);
      --Set_Invisible_Char
      --  (Get_Entry (Second_Sched_Dialog.Policy_Type_Combo),
      --   UTF8_Get_Char ("*"));
      --Set_Has_Frame (Get_Entry (Second_Sched_Dialog.Policy_Type_Combo), True);

      String_List.Append (Policy_Type_Combo_Items, -("(NONE)"));
      String_List.Append (Policy_Type_Combo_Items, -("Fixed Priority"));
      String_List.Append
        (Policy_Type_Combo_Items,
         -("Earliest Deadline First"));
      Utilities.Set_Popdown_Strings
        (Second_Sched_Dialog.Policy_Type_Combo,
         Policy_Type_Combo_Items);
      Set_Text_In_Combo_Box
        (Second_Sched_Dialog.Policy_Type_Combo,
         -("(NONE)"));
      Free_String_List (Policy_Type_Combo_Items);
      Attach
        (Second_Sched_Dialog.Table36,
         Second_Sched_Dialog.Policy_Type_Combo,
         Left_Attach   => 1,
         Right_Attach  => 2,
         Top_Attach    => 3,
         Bottom_Attach => 4,
         Xpadding      => 0,
         Ypadding      => 0);

      Gtk_New (Second_Sched_Dialog.Priority_Table, 2, 2, True);
      Set_Border_Width (Second_Sched_Dialog.Priority_Table, 5);
      Set_Row_Spacings (Second_Sched_Dialog.Priority_Table, 5);
      Set_Col_Spacings (Second_Sched_Dialog.Priority_Table, 3);
      Pack_Start
        (Second_Sched_Dialog.Vbox25,
         Second_Sched_Dialog.Priority_Table,
         Expand  => False,
         Fill    => False,
         Padding => 0);

      Gtk_New (Second_Sched_Dialog.Max_Prior_Entry);
      Set_Editable (Second_Sched_Dialog.Max_Prior_Entry, True);
      Set_Max_Length (Second_Sched_Dialog.Max_Prior_Entry, 0);
      Set_Text
        (Second_Sched_Dialog.Max_Prior_Entry,
         Priority'Image (Priority'Last));
      Set_Visibility (Second_Sched_Dialog.Max_Prior_Entry, True);
      Set_Invisible_Char
        (Second_Sched_Dialog.Max_Prior_Entry,
         UTF8_Get_Char ("*"));
      Attach
        (Second_Sched_Dialog.Priority_Table,
         Second_Sched_Dialog.Max_Prior_Entry,
         Left_Attach   => 1,
         Right_Attach  => 2,
         Top_Attach    => 0,
         Bottom_Attach => 1,
         Xpadding      => 0,
         Ypadding      => 0);

      Gtk_New (Second_Sched_Dialog.Min_Prior_Entry);
      Set_Editable (Second_Sched_Dialog.Min_Prior_Entry, True);
      Set_Max_Length (Second_Sched_Dialog.Min_Prior_Entry, 0);
      Set_Text
        (Second_Sched_Dialog.Min_Prior_Entry,
         Priority'Image (Priority'First));
      Set_Visibility (Second_Sched_Dialog.Min_Prior_Entry, True);
      Set_Invisible_Char
        (Second_Sched_Dialog.Min_Prior_Entry,
         UTF8_Get_Char ("*"));
      Attach
        (Second_Sched_Dialog.Priority_Table,
         Second_Sched_Dialog.Min_Prior_Entry,
         Left_Attach   => 1,
         Right_Attach  => 2,
         Top_Attach    => 1,
         Bottom_Attach => 2,
         Xpadding      => 0,
         Ypadding      => 0);

      Gtk_New (Second_Sched_Dialog.Label364, -("Max Priority"));
      Set_Alignment (Second_Sched_Dialog.Label364, 0.95, 0.5);
      Set_Padding (Second_Sched_Dialog.Label364, 0, 0);
      Set_Justify (Second_Sched_Dialog.Label364, Justify_Center);
      Set_Line_Wrap (Second_Sched_Dialog.Label364, False);
      Set_Selectable (Second_Sched_Dialog.Label364, False);
      Set_Use_Markup (Second_Sched_Dialog.Label364, False);
      Set_Use_Underline (Second_Sched_Dialog.Label364, False);
      Attach
        (Second_Sched_Dialog.Priority_Table,
         Second_Sched_Dialog.Label364,
         Left_Attach   => 0,
         Right_Attach  => 1,
         Top_Attach    => 0,
         Bottom_Attach => 1,
         Xoptions      => Fill,
         Xpadding      => 0,
         Ypadding      => 0);

      Gtk_New (Second_Sched_Dialog.Label365, -("Min Priority"));
      Set_Alignment (Second_Sched_Dialog.Label365, 0.95, 0.5);
      Set_Padding (Second_Sched_Dialog.Label365, 0, 0);
      Set_Justify (Second_Sched_Dialog.Label365, Justify_Center);
      Set_Line_Wrap (Second_Sched_Dialog.Label365, False);
      Set_Selectable (Second_Sched_Dialog.Label365, False);
      Set_Use_Markup (Second_Sched_Dialog.Label365, False);
      Set_Use_Underline (Second_Sched_Dialog.Label365, False);
      Attach
        (Second_Sched_Dialog.Priority_Table,
         Second_Sched_Dialog.Label365,
         Left_Attach   => 0,
         Right_Attach  => 1,
         Top_Attach    => 1,
         Bottom_Attach => 2,
         Xoptions      => Fill,
         Xpadding      => 0,
         Ypadding      => 0);

      Gtk_New (Second_Sched_Dialog.Context_Table, 3, 2, True);
      Set_Border_Width (Second_Sched_Dialog.Context_Table, 5);
      Set_Row_Spacings (Second_Sched_Dialog.Context_Table, 5);
      Set_Col_Spacings (Second_Sched_Dialog.Context_Table, 3);
      Pack_Start
        (Second_Sched_Dialog.Vbox25,
         Second_Sched_Dialog.Context_Table,
         Expand  => False,
         Fill    => False,
         Padding => 0);

      Gtk_New (Second_Sched_Dialog.Label366, 
	       -("Best Context Switch (exec. time)"));
      Set_Alignment (Second_Sched_Dialog.Label366, 0.95, 0.5);
      Set_Padding (Second_Sched_Dialog.Label366, 0, 0);
      Set_Justify (Second_Sched_Dialog.Label366, Justify_Center);
      Set_Line_Wrap (Second_Sched_Dialog.Label366, False);
      Set_Selectable (Second_Sched_Dialog.Label366, False);
      Set_Use_Markup (Second_Sched_Dialog.Label366, False);
      Set_Use_Underline (Second_Sched_Dialog.Label366, False);
      Attach
        (Second_Sched_Dialog.Context_Table,
         Second_Sched_Dialog.Label366,
         Left_Attach   => 0,
         Right_Attach  => 1,
         Top_Attach    => 2,
         Bottom_Attach => 3,
         Xoptions      => Fill,
         Xpadding      => 0,
         Ypadding      => 0);

      Gtk_New (Second_Sched_Dialog.Worst_Context_Entry);
      Set_Editable (Second_Sched_Dialog.Worst_Context_Entry, True);
      Set_Max_Length (Second_Sched_Dialog.Worst_Context_Entry, 0);
      Set_Text (Second_Sched_Dialog.Worst_Context_Entry, -("0.0"));
      Set_Visibility (Second_Sched_Dialog.Worst_Context_Entry, True);
      Set_Invisible_Char
        (Second_Sched_Dialog.Worst_Context_Entry,
         UTF8_Get_Char ("*"));
      Attach
        (Second_Sched_Dialog.Context_Table,
         Second_Sched_Dialog.Worst_Context_Entry,
         Left_Attach   => 1,
         Right_Attach  => 2,
         Top_Attach    => 0,
         Bottom_Attach => 1,
         Xpadding      => 0,
         Ypadding      => 0);

      Gtk_New (Second_Sched_Dialog.Avg_Context_Entry);
      Set_Editable (Second_Sched_Dialog.Avg_Context_Entry, True);
      Set_Max_Length (Second_Sched_Dialog.Avg_Context_Entry, 0);
      Set_Text (Second_Sched_Dialog.Avg_Context_Entry, -("0.0"));
      Set_Visibility (Second_Sched_Dialog.Avg_Context_Entry, True);
      Set_Invisible_Char
        (Second_Sched_Dialog.Avg_Context_Entry,
         UTF8_Get_Char ("*"));
      Attach
        (Second_Sched_Dialog.Context_Table,
         Second_Sched_Dialog.Avg_Context_Entry,
         Left_Attach   => 1,
         Right_Attach  => 2,
         Top_Attach    => 1,
         Bottom_Attach => 2,
         Xpadding      => 0,
         Ypadding      => 0);

      Gtk_New (Second_Sched_Dialog.Best_Context_Entry);
      Set_Editable (Second_Sched_Dialog.Best_Context_Entry, True);
      Set_Max_Length (Second_Sched_Dialog.Best_Context_Entry, 0);
      Set_Text (Second_Sched_Dialog.Best_Context_Entry, -("0.0"));
      Set_Visibility (Second_Sched_Dialog.Best_Context_Entry, True);
      Set_Invisible_Char
        (Second_Sched_Dialog.Best_Context_Entry,
         UTF8_Get_Char ("*"));
      Attach
        (Second_Sched_Dialog.Context_Table,
         Second_Sched_Dialog.Best_Context_Entry,
         Left_Attach   => 1,
         Right_Attach  => 2,
         Top_Attach    => 2,
         Bottom_Attach => 3,
         Xpadding      => 0,
         Ypadding      => 0);

      Gtk_New (Second_Sched_Dialog.Label367, 
	       -("Worst Context Switch (exec. time)"));
      Set_Alignment (Second_Sched_Dialog.Label367, 0.95, 0.5);
      Set_Padding (Second_Sched_Dialog.Label367, 0, 0);
      Set_Justify (Second_Sched_Dialog.Label367, Justify_Center);
      Set_Line_Wrap (Second_Sched_Dialog.Label367, False);
      Set_Selectable (Second_Sched_Dialog.Label367, False);
      Set_Use_Markup (Second_Sched_Dialog.Label367, False);
      Set_Use_Underline (Second_Sched_Dialog.Label367, False);
      Attach
        (Second_Sched_Dialog.Context_Table,
         Second_Sched_Dialog.Label367,
         Left_Attach   => 0,
         Right_Attach  => 1,
         Top_Attach    => 0,
         Bottom_Attach => 1,
         Xoptions      => Fill,
         Xpadding      => 0,
         Ypadding      => 0);

      Gtk_New (Second_Sched_Dialog.Label368, 
	       -("Avg Context Switch (exec. time)"));
      Set_Alignment (Second_Sched_Dialog.Label368, 0.95, 0.5);
      Set_Padding (Second_Sched_Dialog.Label368, 0, 0);
      Set_Justify (Second_Sched_Dialog.Label368, Justify_Center);
      Set_Line_Wrap (Second_Sched_Dialog.Label368, False);
      Set_Selectable (Second_Sched_Dialog.Label368, False);
      Set_Use_Markup (Second_Sched_Dialog.Label368, False);
      Set_Use_Underline (Second_Sched_Dialog.Label368, False);
      Attach
        (Second_Sched_Dialog.Context_Table,
         Second_Sched_Dialog.Label368,
         Left_Attach   => 0,
         Right_Attach  => 1,
         Top_Attach    => 1,
         Bottom_Attach => 2,
         Xoptions      => Fill,
         Xpadding      => 0,
         Ypadding      => 0);

      --     Entry_Callback.Connect
      --       (Get_Entry (Second_Sched_Dialog.Policy_Type_Combo), "changed",
      --        Entry_Callback.To_Marshaller
      --(On_Policy_Type_Entry_Changed'Access), False);

      Second_Sched_Dialog_Callback.Object_Connect
        (Second_Sched_Dialog.Policy_Type_Combo,
         "changed",
         Second_Sched_Dialog_Callback.To_Marshaller
           (On_Policy_Type_Entry_Changed'Access),
         Second_Sched_Dialog);

   end Initialize;

end Second_Sched_Dialog_Pkg;
