-
Notifications
You must be signed in to change notification settings - Fork 5
/
lea_gwin-input_boxes.adb
54 lines (49 loc) · 1.58 KB
/
lea_gwin-input_boxes.adb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
with LEA_Resource_GUI;
with GWindows.Application,
GWindows.Constants;
package body LEA_GWin.Input_Boxes is
procedure String_Input (
Parent : in out GWindows.Base.Base_Window_Type'Class;
Message : in GString;
User_Input : out GString_Unbounded;
Result : out GWindows.Message_Boxes.Message_Box_Result
)
is
use LEA_Resource_GUI;
--
box : String_Prompt_Type;
--
procedure Set_Data is
begin
box.String_Prompt_Label.Text (Message);
end Set_Data;
--
procedure Get_Data (Window : in out GWindows.Base.Base_Window_Type'Class) is
pragma Unreferenced (Window);
begin
User_Input := G2GU (box.String_Prompt_Edit_Box.Text);
end Get_Data;
--
begin
box.Create_Full_Dialog (Parent);
Set_Data;
box.Center (Parent);
box.String_Prompt_Edit_Box.Focus;
box.Text ("Get / Get_Immediate / Get_Line");
On_Destroy_Handler (box, Get_Data'Unrestricted_Access);
case GWindows.Application.Show_Dialog (box, Parent) is
when GWindows.Constants.IDOK => Result := GWindows.Message_Boxes.OK;
when others => Result := GWindows.Message_Boxes.Cancel;
end case;
end String_Input;
procedure Skip_Line (
Parent : in GWindows.Base.Base_Window_Type'Class;
Message : in GString;
Result : out GWindows.Message_Boxes.Message_Box_Result
)
is
use GWindows.Message_Boxes;
begin
Result := Message_Box (Parent, "Skip_Line", Message, OK_Cancel_Box);
end Skip_Line;
end LEA_GWin.Input_Boxes;