mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-20 12:19:31 +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);
|
||||
function ClearChar(Position : Integer) : Char;
|
||||
procedure SetCursorPos;
|
||||
procedure SetCursorPos(InsertingChar: Boolean = False);
|
||||
function GetIsMasked : Boolean;
|
||||
procedure InsertChar(Ch : Char);
|
||||
procedure DeleteSelected(AlsoOnePosition : Boolean);
|
||||
@ -358,7 +358,7 @@ begin
|
||||
Inherited Text := S;
|
||||
CurrentText := S;
|
||||
Inc(FPosition);
|
||||
SetCursorPos;
|
||||
SetCursorPos(True);
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -541,7 +541,7 @@ begin
|
||||
end;
|
||||
|
||||
// Set the cursor position
|
||||
procedure TCustomMaskEdit.SetCursorPos;
|
||||
procedure TCustomMaskEdit.SetCursorPos(InsertingChar: Boolean);
|
||||
Var
|
||||
Ok : Boolean;
|
||||
I, C : Integer;
|
||||
@ -558,6 +558,9 @@ begin
|
||||
begin
|
||||
Inc(C);
|
||||
Ok := (C = FPosition);
|
||||
if Ok and InsertingChar then
|
||||
while (CharToMask(FMask[I]) in [Char_DateSeparator, Char_HourSeparator]) do
|
||||
Inc(I);
|
||||
end;
|
||||
|
||||
if Not Ok then Inc(I);
|
||||
|
Loading…
Reference in New Issue
Block a user