mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-25 22:31:10 +02:00
LCL-GTK2: Fix TMaskEdit skipping chars. Eliminate delayed SetSelLength. Issue #34678, idea from Percy Van Den bylaardt.
git-svn-id: trunk@62806 -
This commit is contained in:
parent
47d77264ba
commit
e4a6fcf1af
@ -1285,18 +1285,6 @@ begin
|
||||
g_idle_remove_by_data(Data);
|
||||
end;
|
||||
|
||||
function gtk2WSDelayedSetSelLength(Data: Pointer): gboolean; cdecl;
|
||||
var
|
||||
Entry: PGtkEntry;
|
||||
begin
|
||||
Result := False;
|
||||
Entry := PGtkEntry(PWidgetInfo(Data)^.CoreWidget);
|
||||
gtk_entry_select_region(Entry,
|
||||
PWidgetInfo(Data)^.CursorPos,
|
||||
PWidgetInfo(Data)^.CursorPos + PWidgetInfo(Data)^.SelLength);
|
||||
g_idle_remove_by_data(Data);
|
||||
end;
|
||||
|
||||
class procedure TGtk2WSCustomEdit.SetCaretPos(const ACustomEdit: TCustomEdit;
|
||||
const NewPos: TPoint);
|
||||
var
|
||||
@ -1414,13 +1402,9 @@ begin
|
||||
if WidgetInfo^.CursorPos = 0 then
|
||||
WidgetInfo^.CursorPos := SelStart;
|
||||
WidgetInfo^.SelLength := NewLength;
|
||||
if LockOnChange(PgtkObject(Entry),0) > 0 then
|
||||
// delay setting of selection length. issue #20890
|
||||
g_idle_add(@gtk2WSDelayedSetSelLength, WidgetInfo)
|
||||
else
|
||||
gtk_entry_select_region(Entry,
|
||||
SelStart,
|
||||
SelStart + NewLength);
|
||||
gtk_entry_select_region(Entry,
|
||||
SelStart + NewLength,
|
||||
SelStart );
|
||||
end;
|
||||
|
||||
class procedure TGtk2WSCustomEdit.SetAlignment(const ACustomEdit: TCustomEdit;
|
||||
|
Loading…
Reference in New Issue
Block a user