@@ -2060,8 +2060,6 @@ package body Gtkada.MDI is
20602060 Free (C.Icon_Name);
20612061 Free (C.Title);
20622062 Free (C.Short_Title);
2063- Free (C.Title_Markup);
2064- Free (C.Short_Title_Markup);
20652063 Free (C.XML_Node_Name);
20662064
20672065 if C.State = Invisible then
@@ -3164,48 +3162,16 @@ package body Gtkada.MDI is
31643162 end if ;
31653163 end Get_Title ;
31663164
3167- -- --------------------
3168- -- Get_Title_Markup --
3169- -- --------------------
3170-
3171- function Get_Title_Markup
3172- (Child : not null access MDI_Child_Record) return UTF8_String is
3173- begin
3174- if Child.Title_Markup = null then
3175- return " " ;
3176- else
3177- return Child.Title_Markup.all ;
3178- end if ;
3179- end Get_Title_Markup ;
3180-
31813165 -- -------------------
31823166 -- Get_Short_Title --
31833167 -- -------------------
31843168
31853169 function Get_Short_Title
31863170 (Child : not null access MDI_Child_Record) return UTF8_String is
31873171 begin
3188- if Child.Short_Title = null then
3189- return " " ;
3190- else
3191- return Child.Short_Title.all ;
3192- end if ;
3172+ return Child.Short_Title.all ;
31933173 end Get_Short_Title ;
31943174
3195- -- --------------------------
3196- -- Get_Short_Title_Markup --
3197- -- --------------------------
3198-
3199- function Get_Short_Title_Markup
3200- (Child : not null access MDI_Child_Record) return UTF8_String is
3201- begin
3202- if Child.Short_Title_Markup = null then
3203- return " " ;
3204- else
3205- return Child.Short_Title_Markup.all ;
3206- end if ;
3207- end Get_Short_Title_Markup ;
3208-
32093175 -- ------------
32103176 -- Set_Icon --
32113177 -- ------------
@@ -3339,11 +3305,9 @@ package body Gtkada.MDI is
33393305 -- -------------
33403306
33413307 procedure Set_Title
3342- (Child : not null access MDI_Child_Record;
3343- Title : String;
3344- Short_Title : String := " " ;
3345- Markup_Title : String := " " ;
3346- Markup_Short_Title : String := " " )
3308+ (Child : not null access MDI_Child_Record;
3309+ Title : String;
3310+ Short_Title : String := " " )
33473311 is
33483312 function To_UTF8 (Str : String) return String;
33493313 -- Ensure the output string is valid UTF8
@@ -3377,79 +3341,46 @@ package body Gtkada.MDI is
33773341 end if ;
33783342 end To_UTF8 ;
33793343
3380- T : constant String := To_UTF8 (Title);
3381- S : constant String := To_UTF8 (Short_Title);
3382- MT : constant String := To_UTF8 (Markup_Title);
3383- MS : constant String := To_UTF8 (Markup_Short_Title);
3384-
3385- Title_Changed : constant Boolean :=
3386- (Child.Title = null
3387- or else Child.Title.all /= T)
3388- or else
3389- ((Child.Title_Markup = null and then MT /= " " )
3390- or else (Child.Title_Markup /= null
3391- and then Child.Title_Markup.all /= MT));
3392-
3393- Short_Title_Changed : constant Boolean :=
3394- (Child.Short_Title = null
3395- or else Child.Short_Title.all /= S)
3396- or else
3397- ((Child.Short_Title_Markup = null and then MS /= " " )
3398- or else (Child.Short_Title_Markup /= null
3399- and then Child.Short_Title_Markup.all /= MS));
3344+ T : constant String := To_UTF8 (Title);
3345+ S : constant String := To_UTF8 (Short_Title);
3346+
3347+ Title_Changed : constant Boolean := Child.Title = null
3348+ or else Child.Title.all /= T;
3349+ Short_Title_Changed : constant Boolean := Child.Short_Title = null
3350+ or else Child.Short_Title.all /= S;
3351+
34003352 begin
34013353 if Title_Changed then
34023354 Free (Child.Title);
3403- Free (Child.Title_Markup);
3404-
34053355 Child.Title := new UTF8_String'(T);
3406-
3407- if MT /= " " then
3408- Child.Title_Markup := new UTF8_String'(MT);
3409- end if ;
34103356 end if ;
34113357
34123358 if Short_Title_Changed then
34133359 Free (Child.Short_Title);
3414- Free (Child.Short_Title_Markup);
3415-
34163360 if S /= " " then
34173361 Child.Short_Title := new UTF8_String'(S);
34183362 else
34193363 Child.Short_Title := new UTF8_String'(T);
34203364 end if ;
3421-
3422- if MS /= " " then
3423- Child.Short_Title_Markup := new UTF8_String'(MS);
3424- end if ;
34253365 end if ;
34263366
34273367 if Child.MDI /= null
34283368 and then Child.MDI.Use_Short_Titles_For_Floats
34293369 then
3430- if Child.Short_Title_Markup = null then
3431- Child.Title_Label.Set_Text (Child.Get_Short_Title);
3432- else
3433- Child.Title_Label.Set_Markup (Child.Short_Title_Markup.all );
3434- end if ;
3435-
3370+ Child.Title_Label.Set_Text (Child.Short_Title.all );
34363371 else
3437- if Child.Title_Markup = null then
3438- Child.Title_Label.Set_Text (Child.Get_Title);
3439- else
3440- Child.Title_Label.Set_Markup (Child.Title_Markup.all );
3441- end if ;
3372+ Child.Title_Label.Set_Text (Child.Title.all );
34423373 end if ;
34433374
34443375 if Title_Changed and then Child.State = Floating then
34453376 if Child.MDI.Use_Short_Titles_For_Floats then
34463377 Set_Title
34473378 (Gtk_Window (Get_Toplevel (Child.Initial)),
3448- Locale_From_UTF8 (Child.Get_Short_Title ));
3379+ Locale_From_UTF8 (Child.Short_Title. all ));
34493380 else
34503381 Set_Title
34513382 (Gtk_Window (Get_Toplevel (Child.Initial)),
3452- Locale_From_UTF8 (Child.Get_Title ));
3383+ Locale_From_UTF8 (Child.Title. all ));
34533384 end if ;
34543385 end if ;
34553386
@@ -3611,10 +3542,8 @@ package body Gtkada.MDI is
36113542 loop
36123543 Child := Get (Iter);
36133544 exit when Child = null
3614- or else Child.Get_Title = Name
3615- or else Child.Get_Title_Markup = Name
3616- or else Child.Get_Short_Title = Name
3617- or else Child.Get_Short_Title_Markup = Name;
3545+ or else Child.Title.all = Name
3546+ or else Child.Short_Title.all = Name;
36183547 Next (Iter);
36193548 end loop ;
36203549
@@ -4208,9 +4137,9 @@ package body Gtkada.MDI is
42084137 Child.Set_Default_Size_For_Floating_Window (Win, W, H);
42094138
42104139 if Child.MDI.Use_Short_Titles_For_Floats then
4211- Set_Title (Win, Locale_From_UTF8 (Child.Get_Short_Title ));
4140+ Set_Title (Win, Locale_From_UTF8 (Child.Short_Title. all ));
42124141 else
4213- Set_Title (Win, Locale_From_UTF8 (Child.Get_Title ));
4142+ Set_Title (Win, Locale_From_UTF8 (Child.Title. all ));
42144143 end if ;
42154144
42164145 -- Memorize the MDI_Child associated with the window, for faster
@@ -4442,16 +4371,11 @@ package body Gtkada.MDI is
44424371 MItem := new Child_Menu_Item_Record;
44434372 MItem.Child := Widget;
44444373 Gtk.Image_Menu_Item.Initialize
4445- (MItem, Label => Widget.Get_Short_Title );
4374+ (MItem, Label => Widget.Short_Title. all );
44464375
44474376 if P - 1 = Current then
4448- if Widget.Short_Title_Markup = null then
4449- Gtk_Label (MItem.Get_Child).Set_Markup
4450- (" <b>" & Widget.Get_Short_Title & " </b>" );
4451- else
4452- Gtk_Label (MItem.Get_Child).Set_Markup
4453- (" <b>" & Widget.Short_Title_Markup.all & " </b>" );
4454- end if ;
4377+ Gtk_Label (MItem.Get_Child).Set_Markup
4378+ (" <b>" & Widget.Short_Title.all & " </b>" );
44554379 end if ;
44564380
44574381 if Widget.Tab_Icon /= null then
@@ -4973,26 +4897,14 @@ package body Gtkada.MDI is
49734897
49744898 procedure Add_Label is
49754899 begin
4976- Gtk_New (Child.Tab_Label);
4977- if Child.Short_Title_Markup = null then
4978- Child.Tab_Label.Set_Text (Child.Get_Short_Title);
4979- else
4980- Child.Tab_Label.Set_Markup (Child.Short_Title_Markup.all );
4981- end if ;
4982-
4900+ Gtk_New (Child.Tab_Label, Child.Short_Title.all );
49834901 Box.Pack_Start (Child.Tab_Label, Expand => True, Fill => True);
49844902
49854903 declare
49864904 Tooltip : constant String := Child.Get_Tooltip;
49874905 begin
49884906 if Tooltip = " " then
4989- if Child.Title_Markup = null then
4990- Child.Tab_Label.Set_Tooltip_Text (Child.Get_Title);
4991- else
4992- Child.Tab_Label.Set_Tooltip_Markup
4993- (Child.Title_Markup.all );
4994- end if ;
4995-
4907+ Child.Tab_Label.Set_Tooltip_Text (Child.Title.all );
49964908 elsif Child.Get_Tooltip_Is_Markup then
49974909 Child.Tab_Label.Set_Tooltip_Markup (Tooltip);
49984910 else
@@ -5177,7 +5089,7 @@ package body Gtkada.MDI is
51775089 Set_State (Child, Normal);
51785090
51795091 Append_Page (Note, Child);
5180- Note.Set_Menu_Label_Text (Child, Child.Get_Short_Title );
5092+ Note.Set_Menu_Label_Text (Child, Child.Short_Title. all );
51815093
51825094 Configure_Notebook_Tabs (MDI, Note);
51835095
@@ -5446,17 +5358,12 @@ package body Gtkada.MDI is
54465358 Child := MDI_Child (Get_Data (List));
54475359
54485360 declare
5449- T : constant String := Child.Get_Title;
5450- S : constant String := Child.Get_Short_Title;
5451- MT : constant String := Child.Get_Title_Markup;
5452- MS : constant String := Child.Get_Short_Title_Markup;
5361+ T : constant String := Child.Title.all ;
5362+ S : constant String := Child.Short_Title.all ;
54535363 begin
54545364 Free (Child.Title); -- Force a refresh
54555365 Free (Child.Short_Title);
5456- Free (Child.Title_Markup);
5457- Free (Child.Short_Title_Markup);
5458-
5459- Child.Set_Title (T, S, MT, MS);
5366+ Child.Set_Title (T, S);
54605367 end ;
54615368
54625369 List := Next (List);
@@ -5918,7 +5825,7 @@ package body Gtkada.MDI is
59185825
59195826 It.Set_Accel_Path
59205827 (Child.MDI.Accel_Path_Prefix.all
5921- & " /window/child/" & Child.Get_Short_Title ,
5828+ & " /window/child/" & Child.Short_Title. all ,
59225829 Child.MDI.Group);
59235830 end Internal_Add_Child_Menu ;
59245831
@@ -5944,12 +5851,7 @@ package body Gtkada.MDI is
59445851 Box.Pack_Start (Icon, Expand => False);
59455852 end if ;
59465853
5947- Gtk_New (Label, " " );
5948- if Child.Short_Title_Markup = null then
5949- Label.Set_Text (Child.Get_Short_Title);
5950- else
5951- Label.Set_Markup (Child.Short_Title_Markup.all );
5952- end if ;
5854+ Gtk_New (Label, Child.Short_Title.all );
59535855 Label.Set_Alignment (0.0 , 0.5 );
59545856 Label.Set_Accel_Widget (It);
59555857 Box.Pack_Start (Label, Expand => True, Fill => True);
0 commit comments