mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-08 02:19:57 +02:00
LCL-GTK2: Fix CheckBox/RadioButton '_' escaping. Issue #34882, patch from Alexey Tor.
git-svn-id: trunk@60466 -
This commit is contained in:
parent
c53f302067
commit
70a3929a41
@ -9162,6 +9162,11 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
function EscapeUnderscores(const Str: String): String;
|
||||
begin
|
||||
Result := StringReplace(Str, '_', '__', [rfReplaceAll]);
|
||||
end;
|
||||
|
||||
{-------------------------------------------------------------------------------
|
||||
function RemoveAmpersands(Src: PChar; LineLength : Longint) : PChar;
|
||||
|
||||
|
@ -591,6 +591,7 @@ procedure ConnectInternalWidgetsSignals(AWidget: PGtkWidget;
|
||||
function DeleteAmpersands(var Str: String): Longint;
|
||||
function Ampersands2Underscore(Src: PChar): PChar;
|
||||
function Ampersands2Underscore(const ASource: String): String;
|
||||
function EscapeUnderscores(const Str: String): String; inline;
|
||||
function RemoveAmpersands(Src: PChar; LineLength: Longint): PChar;
|
||||
function RemoveAmpersands(const ASource: String): String;
|
||||
procedure LabelFromAmpersands(var AText, APattern: String; var AAccelChar: Char);
|
||||
|
@ -991,9 +991,7 @@ begin
|
||||
|
||||
GtkColumn := gtk_tree_view_get_column(PGtkTreeView(Widgets^.MainView), AIndex);
|
||||
if GtkColumn <> nil then
|
||||
gtk_tree_view_column_set_title(GtkColumn, PChar(
|
||||
StringReplace(ACaption, '_', '__', [rfReplaceAll]) // Must replace single '_' to double
|
||||
));
|
||||
gtk_tree_view_column_set_title(GtkColumn, PChar(EscapeUnderscores(ACaption)));
|
||||
end;
|
||||
|
||||
class procedure TGtk2WSCustomListView.ColumnSetImage(const ALV: TCustomListView;
|
||||
|
@ -1029,7 +1029,7 @@ begin
|
||||
P := gtk_label_get_text(PGtkLabel(PGtkBin(BoxWidget)^.child));
|
||||
B := (StrPas(P) <> AText);
|
||||
gtk_widget_show(PGtkBin(BoxWidget)^.child);
|
||||
gtk_button_set_label(PGtkButton(BoxWidget), PChar(Ampersands2Underscore(AText)));
|
||||
gtk_button_set_label(PGtkButton(BoxWidget), PChar(Ampersands2Underscore(EscapeUnderscores(AText))));
|
||||
gtk_button_set_use_underline(PGtkButton(BoxWidget), True);
|
||||
if B then
|
||||
begin
|
||||
|
Loading…
Reference in New Issue
Block a user