-
Notifications
You must be signed in to change notification settings - Fork 5
/
lea_gwin-mdi_child.ads
173 lines (132 loc) · 6.43 KB
/
lea_gwin-mdi_child.ads
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
with LEA_GWin.Editor.Streaming,
LEA_GWin.MDI_Main,
LEA_GWin.Sliding_Panels;
with LEA_Resource_GUI;
with LEA_Common;
with HAC_Sys.Builder;
with Office_Applications;
with GWindows.Common_Controls;
with GWindows.Drawing;
with GWindows.Packing_Boxes;
with GWindows.Panels;
with GWindows.Types;
with GWindows.Windows.MDI;
with Ada.Numerics.Float_Random;
package LEA_GWin.MDI_Child is
type MDI_Child_Type;
type MDI_Child_Access is access all MDI_Child_Type;
type MDI_Child_Status_bar_part is (directory_info, task_message);
type MDI_Child_Status_Bar_Type is
new GWindows.Common_Controls.Status_Bar_Type with null record;
-- Clicks on some some parts of the status bar have effects (like "Go to line")
overriding procedure On_Click (Bar : in out MDI_Child_Status_Bar_Type);
type MDI_Child_Tree_View_Control_Type is new GWindows.Common_Controls.Tree_View_Control_Type with null record;
-- overriding procedure On_Selection_Change (Control : in out MDI_Child_Tree_View_Control_Type);
-- overriding procedure On_Focus (Control : in out MDI_Child_Tree_View_Control_Type);
type MDI_Child_Packing_Box_Type is new GWindows.Packing_Boxes.Packing_Box_Type with null record;
overriding procedure On_Erase_Background
(Window : in out MDI_Child_Packing_Box_Type;
Canvas : in out GWindows.Drawing.Canvas_Type;
Area : in GWindows.Types.Rectangle_Type) is null;
overriding procedure On_Paint
(Window : in out MDI_Child_Packing_Box_Type;
Canvas : in out GWindows.Drawing.Canvas_Type;
Area : in GWindows.Types.Rectangle_Type) is null;
type MDI_Child_Panel_Type is new GWindows.Panels.Panel_Type with null record;
overriding procedure On_Erase_Background
(Window : in out MDI_Child_Panel_Type;
Canvas : in out GWindows.Drawing.Canvas_Type;
Area : in GWindows.Types.Rectangle_Type) is null;
overriding procedure On_Paint
(Window : in out MDI_Child_Panel_Type;
Canvas : in out GWindows.Drawing.Canvas_Type;
Area : in GWindows.Types.Rectangle_Type) is null;
type MDI_Child_Type is
new Office_Applications.Classic_Document_Window_Type with
record
ID : ID_Type;
-- Window title = ID.Short_Name & {""|" *"}
mdi_root : LEA_GWin.MDI_Main.MDI_Main_Access; -- -> access to the containing window
menu : LEA_Resource_GUI.Menu_MDI_Child_Type;
-- Tree_Bar_and_List: MDI_Child_Packing_Box_Type;
editor : LEA_GWin.Editor.LEA_Scintilla_Type;
-- Direct input stream from the editor widget:
current_editor_stream : aliased LEA_GWin.Editor.Streaming.Editor_Stream_Type;
context_menu : GWindows.Menus.Menu_Type := GWindows.Menus.Null_Menu;
Subprogram_Panel : Sliding_Panels.Subprogram_Panel_Type;
selected_path : GString_Unbounded := Null_GString_Unbounded;
-- opt : Option_Pack_Type; -- No per-child-window option in this app
Status_Bar : MDI_Child_Status_Bar_Type;
name_search : GString_Unbounded;
content_search : GString_Unbounded;
current_password : GString_Unbounded;
temp_name_gen : Ada.Numerics.Float_Random.Generator;
any_path_in_zip : Boolean;
extract_dir : GString_Unbounded;
refreshing_list : Boolean := False;
is_closing : Boolean := False; -- True only during and after On_Close
last_op_comment_1 : GString_Unbounded;
last_op_comment_2 : GString_Unbounded;
end record;
overriding procedure On_Create (Window : in out MDI_Child_Type);
procedure Create_LEA_MDI_Child
(Window : in out MDI_Child_Type;
Parent : in out MDI_Main.MDI_Main_Type;
ID : in ID_Type);
procedure Finish_subwindow_opening (Window : in out MDI_Child_Type);
procedure On_Save (Window : in out MDI_Child_Type);
overriding function Is_Document_Modified (Window : in MDI_Child_Type) return Boolean;
procedure On_Save_As (Window : in out MDI_Child_Type);
procedure On_Save_All (Window : in out MDI_Child_Type);
overriding procedure On_File_Drop (
Window : in out MDI_Child_Type;
File_Names : in GWindows.Windows.Array_Of_File_Names
);
overriding procedure On_Size (
Window : in out MDI_Child_Type;
Width : in Integer;
Height : in Integer
);
overriding procedure On_Erase_Background
(Window : in out MDI_Child_Type;
Canvas : in out GWindows.Drawing.Canvas_Type;
Area : in GWindows.Types.Rectangle_Type) is null;
overriding procedure On_Paint
(Window : in out MDI_Child_Type;
Canvas : in out GWindows.Drawing.Canvas_Type;
Area : in GWindows.Types.Rectangle_Type) is null;
overriding procedure On_Menu_Select (
Window : in out MDI_Child_Type;
Item : in Integer
);
overriding procedure On_Focus (Window : in out MDI_Child_Type);
overriding procedure On_Context_Menu
(Window : in out MDI_Child_Type;
X : in Integer;
Y : in Integer);
overriding procedure On_Close (
Window : in out MDI_Child_Type;
Can_Close : out Boolean
);
type Update_need is
(first_display, -- first display ever
status_bar, -- status bar, and topics listed below
toolbar_and_menu -- update enable/disable of toolbar items and menu items
);
procedure Apply_Options (Window : in out MDI_Child_Type);
procedure Update_Information
(Window : in out MDI_Child_Type;
need : Update_need);
-- This will update File menu of parent, itself, and all brothers and sisters
procedure Update_Common_Menus (Window : MDI_Child_Type;
top_entry_name : GString := "";
top_entry_line : Natural := 0 -- When unknown, 0; otherwise: last visited line
);
procedure Show_Search_Box (Window : in out MDI_Child_Type);
function Best_Name (Window : MDI_Child_Type) return GString;
procedure Switch_Current_Directory (Window : MDI_Child_Type);
-- Compile / Build actions
procedure Build (Window : in out MDI_Child_Type);
procedure Build_as_Main (Window : in out MDI_Child_Type);
procedure Build_and_run (Window : in out MDI_Child_Type);
end LEA_GWin.MDI_Child;