mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-12 18:39:52 +02:00
lcl: The cursor is not positioned correctly when a date separator is found in MaskEdit (from Luiz Americo, bug #0012878)
git-svn-id: trunk@17971 -
This commit is contained in:
parent
8af15edac9
commit
4f720e7193
@ -83,7 +83,7 @@ type
|
|||||||
|
|
||||||
procedure SetMask(Value : String);
|
procedure SetMask(Value : String);
|
||||||
function ClearChar(Position : Integer) : Char;
|
function ClearChar(Position : Integer) : Char;
|
||||||
procedure SetCursorPos;
|
procedure SetCursorPos(InsertingChar: Boolean = False);
|
||||||
function GetIsMasked : Boolean;
|
function GetIsMasked : Boolean;
|
||||||
procedure InsertChar(Ch : Char);
|
procedure InsertChar(Ch : Char);
|
||||||
procedure DeleteSelected(AlsoOnePosition : Boolean);
|
procedure DeleteSelected(AlsoOnePosition : Boolean);
|
||||||
@ -358,7 +358,7 @@ begin
|
|||||||
Inherited Text := S;
|
Inherited Text := S;
|
||||||
CurrentText := S;
|
CurrentText := S;
|
||||||
Inc(FPosition);
|
Inc(FPosition);
|
||||||
SetCursorPos;
|
SetCursorPos(True);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -541,7 +541,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
// Set the cursor position
|
// Set the cursor position
|
||||||
procedure TCustomMaskEdit.SetCursorPos;
|
procedure TCustomMaskEdit.SetCursorPos(InsertingChar: Boolean);
|
||||||
Var
|
Var
|
||||||
Ok : Boolean;
|
Ok : Boolean;
|
||||||
I, C : Integer;
|
I, C : Integer;
|
||||||
@ -558,6 +558,9 @@ begin
|
|||||||
begin
|
begin
|
||||||
Inc(C);
|
Inc(C);
|
||||||
Ok := (C = FPosition);
|
Ok := (C = FPosition);
|
||||||
|
if Ok and InsertingChar then
|
||||||
|
while (CharToMask(FMask[I]) in [Char_DateSeparator, Char_HourSeparator]) do
|
||||||
|
Inc(I);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
if Not Ok then Inc(I);
|
if Not Ok then Inc(I);
|
||||||
|
Loading…
Reference in New Issue
Block a user