mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-15 17:59:26 +02:00
Gtk: update GtkEntry cursorpos in changed event for gtk too. issue #7243
git-svn-id: trunk@24031 -
This commit is contained in:
parent
3066ad5a51
commit
9444dd3460
@ -451,16 +451,18 @@ begin
|
||||
EventTrace('changed_editbox', data);
|
||||
{$ENDIF}
|
||||
|
||||
{TODO: test this with gtk1}
|
||||
{$ifdef gtk2}
|
||||
if GTK_IS_ENTRY(Widget) then
|
||||
begin
|
||||
{cheat GtkEditable to update cursor pos in gtkEntry. issue #7243}
|
||||
{$ifdef gtk1}
|
||||
GStart := PGtkOldEditable(Widget)^.selection_start_pos;
|
||||
GEnd := PGtkOldEditable(Widget)^.selection_end_pos;
|
||||
{$else}
|
||||
gtk_editable_get_selection_bounds(PGtkEditable(Widget), @GStart, @GEnd);
|
||||
{$endif}
|
||||
if GStart = GEnd then
|
||||
gtk_editable_set_position(PGtkEditable(Widget), -1);
|
||||
end;
|
||||
{$endif}
|
||||
|
||||
FillByte(Mess,SizeOf(Mess),0);
|
||||
Mess.Msg := CM_TEXTCHANGED;
|
||||
|
Loading…
Reference in New Issue
Block a user