mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-10 22:39:18 +02:00
Merged revision(s) 53099 #7fc07f3753, 53590 #3ca728a0e7, 53653 #273d60e1e3, 53705 #bc9a802ce1 from trunk:
LCL-GTK2: Remove tests for "(gtk_major_version = 2) and (gtk_minor_version < 17)". Caused error with backspace on TEdit. Issue #30596. ........ LCL-Gtk2: Simplify TGtk2WSCustomListView.ItemSetState. Nil as Path param does not work for old GTK versions. Reported by Luca Olivetti. ........ LCL-GTK2: Fix a cursor move error when selected text was replaced by typing. Issue #30596. ........ GTK2/GTK3: Fix TOpenDialog.Files if ofAllowMultiSelect is not in Options. Issue #0031133. ........ git-svn-id: branches/fixes_1_6@53786 -
This commit is contained in:
parent
6587e40850
commit
bfd7b1a813
@ -456,21 +456,16 @@ begin
|
||||
begin
|
||||
// if we change selstart in OnChange event new cursor pos need to
|
||||
// be postponed in TGtk2WSCustomEdit.SetSelStart
|
||||
NeedCursorCheck := True;
|
||||
if g_object_get_data(PGObject(Widget),'lcl-gtkentry-pasted-data') <> nil then
|
||||
begin
|
||||
NeedCursorCheck := True;
|
||||
g_object_set_data(PGObject(Widget),'lcl-gtkentry-pasted-data',nil);
|
||||
gtk_editable_set_position(PGtkEditable(Widget), GStart);
|
||||
end else
|
||||
begin
|
||||
//NeedCursorCheck := True;
|
||||
if gtk_minor_version < 17 then
|
||||
begin
|
||||
g_object_set_data(PGObject(Widget),'lcl-gtkentry-pasted-data',Widget);
|
||||
g_idle_add(@GtkEntryDelayCursorPos, Widget);
|
||||
exit;
|
||||
end else
|
||||
gtk_editable_set_position(PGtkEditable(Widget), GStart + 1);
|
||||
g_object_set_data(PGObject(Widget),'lcl-gtkentry-pasted-data',Widget);
|
||||
g_idle_add(@GtkEntryDelayCursorPos, Widget);
|
||||
exit;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
@ -601,11 +596,8 @@ begin
|
||||
begin
|
||||
{mark as invalid event for gtkchanged_editbox, so
|
||||
it doesn't update cursor pos or we have a mess.}
|
||||
if (gtk_major_version = 2) and (gtk_minor_version < 17) then
|
||||
begin
|
||||
Info := GetWidgetInfo(Widget, False);
|
||||
include(Info^.Flags, wwiInvalidEvent);
|
||||
end;
|
||||
Info := GetWidgetInfo(Widget, False);
|
||||
include(Info^.Flags, wwiInvalidEvent);
|
||||
PGtkEntry(Widget)^.current_pos := GStart - 1;
|
||||
end;
|
||||
end;
|
||||
@ -2800,14 +2792,10 @@ var
|
||||
Info: PWidgetInfo;
|
||||
begin
|
||||
EventTrace('Cut to clip', data);
|
||||
if (Widget=nil) then ;
|
||||
if (gtk_major_version = 2) and (gtk_minor_version < 17) then
|
||||
if (Widget <> nil) and (GTK_IS_ENTRY(Widget)) then
|
||||
begin
|
||||
if (Widget <> nil) and (GTK_IS_ENTRY(Widget)) then
|
||||
begin
|
||||
Info := GetWidgetInfo(Widget, False);
|
||||
include(Info^.Flags, wwiInvalidEvent);
|
||||
end;
|
||||
Info := GetWidgetInfo(Widget, False);
|
||||
include(Info^.Flags, wwiInvalidEvent);
|
||||
end;
|
||||
Mess.msg := LM_CUT;
|
||||
Result:= DeliverMessage(Data, Mess) = 0;
|
||||
|
@ -465,8 +465,7 @@ begin
|
||||
if GTK_IS_ENTRY(gObject) then
|
||||
begin
|
||||
ConnectSenderSignal(gObject,'backspace', @gtkchanged_editbox_backspace);
|
||||
if (gtk_major_version = 2) and (gtk_minor_version < 17) then
|
||||
ConnectSenderSignal(gObject,'delete-from-cursor', @gtkchanged_editbox_delete);
|
||||
ConnectSenderSignal(gObject,'delete-from-cursor', @gtkchanged_editbox_delete);
|
||||
end;
|
||||
ConnectSenderSignal(gObject, 'changed', @gtkchanged_editbox);
|
||||
{$ENDIF}
|
||||
|
@ -1499,17 +1499,7 @@ begin
|
||||
//gtk2 iter has no focus??
|
||||
Path := gtk_tree_path_new_from_string(PChar(IntToStr(AIndex)));
|
||||
if GTK_IS_TREE_VIEW(MainView) then
|
||||
begin
|
||||
if AIsSet then
|
||||
gtk_tree_view_set_cursor(PGtkTreeView(MainView), Path, nil, False)
|
||||
else
|
||||
begin
|
||||
if (gtk_major_version = 2) and (gtk_minor_version < 14) then
|
||||
gtk_tree_view_set_cursor(PGtkTreeView(MainView), nil, nil, False)
|
||||
else
|
||||
gtk_tree_view_set_cursor(PGtkTreeView(MainView), Path, nil, False);
|
||||
end;
|
||||
end
|
||||
gtk_tree_view_set_cursor(PGtkTreeView(MainView), Path, nil, False)
|
||||
else
|
||||
if GTK_IS_ICON_VIEW(MainView) then
|
||||
gtk_icon_view_set_cursor(PGtkIconView(MainView), Path, nil, False);
|
||||
|
@ -228,7 +228,9 @@ begin
|
||||
end;
|
||||
g_slist_free(cFilenames);
|
||||
end;
|
||||
end;
|
||||
end
|
||||
else
|
||||
TheDialog.Files.Clear;
|
||||
end;
|
||||
|
||||
cFilename := gtk_file_chooser_get_filename(widget);
|
||||
@ -241,6 +243,8 @@ begin
|
||||
else
|
||||
TheDialog.FileName := cFilename;
|
||||
g_free(cFilename);
|
||||
if (TheDialog is TOpenDialog) and (not (ofAllowMultiSelect in TOpenDialog(theDialog).Options)) then
|
||||
TheDialog.Files.Add(TheDialog.FileName);
|
||||
end;
|
||||
|
||||
//?? StoreCommonDialogSetup(theDialog);
|
||||
|
@ -478,7 +478,9 @@ begin
|
||||
end;
|
||||
g_slist_free(cFilenames);
|
||||
end;
|
||||
end;
|
||||
end
|
||||
else
|
||||
TheDialog.Files.Clear;
|
||||
end;
|
||||
|
||||
cFilename := gtk_file_chooser_get_filename(widget);
|
||||
@ -490,6 +492,8 @@ begin
|
||||
else
|
||||
TheDialog.FileName := cFilename;
|
||||
g_free(cFilename);
|
||||
if (TheDialog is TOpenDialog) and (not (ofAllowMultiSelect in TOpenDialog(theDialog).Options)) then
|
||||
TheDialog.Files.Add(TheDialog.FileName);
|
||||
end;
|
||||
|
||||
//?? StoreCommonDialogSetup(theDialog);
|
||||
|
Loading…
Reference in New Issue
Block a user