mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-24 06:29:48 +02:00
LCL: implemented TCustomMaskEdit.GetSel and SetSel form Ts. Petrov (issue #11655)
git-svn-id: trunk@15789 -
This commit is contained in:
parent
3285b40fa7
commit
5b3c40da89
@ -319,6 +319,9 @@ Begin
|
|||||||
Char_AllDownCase : Result := True;
|
Char_AllDownCase : Result := True;
|
||||||
Char_AllFixedUpCase : Result := True;
|
Char_AllFixedUpCase : Result := True;
|
||||||
Char_AllFixedDownCase : Result := True;
|
Char_AllFixedDownCase : Result := True;
|
||||||
|
Char_Space : Result := Ch in [' ', '_'];
|
||||||
|
Char_HourSeparator : Result := Ch in [TimeSeparator];
|
||||||
|
Char_DateSeparator : Result := Ch in [DateSeparator];
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -422,13 +425,15 @@ End;
|
|||||||
// Get the current selection
|
// Get the current selection
|
||||||
procedure TCustomMaskEdit.GetSel(var _SelStart: Integer; var _SelStop: Integer);
|
procedure TCustomMaskEdit.GetSel(var _SelStart: Integer; var _SelStop: Integer);
|
||||||
begin
|
begin
|
||||||
// SendMessage(Handle, EM_GETSEL, Integer(@_SelStart), Integer(@_SelStop));
|
_SelStart:= GetSelStart();
|
||||||
|
_SelStop:= _SelStart + GetSelLength();
|
||||||
end;
|
end;
|
||||||
|
|
||||||
// Set the current selection
|
// Set the current selection
|
||||||
procedure TCustomMaskEdit.SetSel(_SelStart: Integer; _SelStop: Integer);
|
procedure TCustomMaskEdit.SetSel(_SelStart: Integer; _SelStop: Integer);
|
||||||
begin
|
begin
|
||||||
// SendMessage(Handle, EM_SETSEL, _SelStart, _SelStop);
|
SetSelStart(_SelStart);
|
||||||
|
SetSelLength(_SelStop - _SelStart);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCustomMaskEdit.ValidateEdit;
|
procedure TCustomMaskEdit.ValidateEdit;
|
||||||
@ -465,7 +470,6 @@ begin
|
|||||||
Key := 0;
|
Key := 0;
|
||||||
SetCursorPos;
|
SetCursorPos;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
Exit;
|
Exit;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -473,7 +477,7 @@ begin
|
|||||||
if (Key = VK_HOME) or (Key = VK_end) then
|
if (Key = VK_HOME) or (Key = VK_end) then
|
||||||
begin
|
begin
|
||||||
if Key = VK_HOME then FPosition := 1
|
if Key = VK_HOME then FPosition := 1
|
||||||
else FPosition := FMaxChars-1;
|
else FPosition := FMaxChars;
|
||||||
SetCursorPos;
|
SetCursorPos;
|
||||||
Key := 0;
|
Key := 0;
|
||||||
Exit;
|
Exit;
|
||||||
@ -500,8 +504,8 @@ begin
|
|||||||
DeleteSelected(False);
|
DeleteSelected(False);
|
||||||
SetCharToPos;
|
SetCharToPos;
|
||||||
InsertChar(Char(Lo(Key)));
|
InsertChar(Char(Lo(Key)));
|
||||||
Key := 0;
|
|
||||||
end;
|
end;
|
||||||
|
Key := 0;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
// Delete a single char from position
|
// Delete a single char from position
|
||||||
|
Loading…
Reference in New Issue
Block a user