1
-----------------------------------------------------------------------
2
-----------------------------------------------------------------------
7
with Gtk.Main; use Gtk.Main;
8
with Gtk.Enums; use Gtk.Enums;
10
with Gtkada.Dialogs; use Gtkada.Dialogs;
12
with Ada.Text_IO; use Ada.Text_IO;
13
with Ada.Command_Line; use Ada.Command_Line;
14
with Ada.Strings.Fixed; use Ada.Strings.Fixed;
15
with Ada.Strings.Maps.Constants; use Ada.Strings.Maps.Constants;
17
with GNAT.OS_Lib; use GNAT.OS_Lib;
20
Button : Message_Dialog_Buttons;
21
pragma Warnings (Off, Button);
23
Buffer : String (1 .. 8192);
25
Kind : Message_Dialog_Type := Information;
26
Justification : Gtk_Justification := Justify_Center;
31
if Argument_Count > 0 then
33
Kind := Message_Dialog_Type'Value (Argument (1));
35
when Constraint_Error =>
36
Put_Line (Standard_Error, "Wrong message dialog type: " &
38
Put_Line (Standard_Error, "Possible values are:");
40
for J in Message_Dialog_Type'Range loop
41
Put_Line (Standard_Error,
42
Translate (Message_Dialog_Type'Image (J), Lower_Case_Map));
49
if Argument_Count > 1 then
51
Justification := Gtk_Justification'Value (Argument (2));
53
when Constraint_Error =>
54
Put_Line (Standard_Error, "Wrong justification value: " &
56
Put_Line (Standard_Error, "Possible values are:");
58
for J in Gtk_Justification'Range loop
59
Put_Line (Standard_Error,
60
Translate (Gtk_Justification'Image (J), Lower_Case_Map));
69
Get_Line (Buffer (Last + 1 .. Buffer'Last), Last);
71
Buffer (Last) := ASCII.LF;
78
Button := Message_Dialog
79
(Buffer (1 .. Last), Kind, Button_OK,
80
Justification => Justification);