mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-30 17:11:59 +02:00
LCL-CustomDrawn: Implements support for TCDEdit.ReadOnly
git-svn-id: trunk@39446 -
This commit is contained in:
parent
2860e13007
commit
8624b78a67
@ -199,6 +199,7 @@ type
|
||||
FCaretTimer: TTimer;
|
||||
FLines: TStrings;
|
||||
FOnChange: TNotifyEvent;
|
||||
FReadOnly: Boolean;
|
||||
function GetLeftTextMargin: Integer;
|
||||
function GetMultiLine: Boolean;
|
||||
function GetRightTextMargin: Integer;
|
||||
@ -253,6 +254,7 @@ type
|
||||
property Enabled;
|
||||
property Lines: TStrings read FLines write SetLines;
|
||||
property MultiLine: Boolean read GetMultiLine write SetMultiLine default False;
|
||||
property ReadOnly: Boolean read FReadOnly write FReadOnly default False;
|
||||
property TabStop default True;
|
||||
property OnChange: TNotifyEvent read FOnChange write FOnChange;
|
||||
end;
|
||||
@ -1868,6 +1870,9 @@ var
|
||||
begin
|
||||
inherited UTF8KeyPress(UTF8Key);
|
||||
|
||||
// ReadOnly disables key input
|
||||
if FReadOnly then Exit;
|
||||
|
||||
// LCL-Carbon sends Backspace as a UTF-8 Char
|
||||
// LCL-Qt sends arrow left,right,up,down (#28..#31), <enter>, ESC, etc
|
||||
// Don't handle any non-char keys here because they are already handled in KeyDown
|
||||
|
@ -1302,6 +1302,7 @@ begin
|
||||
ACDControlField.Caption := AWinControl.Caption;
|
||||
ACDControlField.Parent := AWinControl;
|
||||
ACDControlField.Align := alClient;
|
||||
TCDIntfEdit(ACDControlField).ReadOnly := TCustomEdit(AWinControl).ReadOnly;
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
|
Loading…
Reference in New Issue
Block a user