mapped DirectInput to the negation of ReadOnly of the Edit (issue #1406)

git-svn-id: trunk@8115 -
This commit is contained in:
vincents 2005-11-09 08:36:01 +00:00
parent 0bddd9fc6c
commit a8d697bb9e

View File

@ -38,13 +38,14 @@ type
private
FButton: TSpeedButton;
FButtonNeedsFocus: Boolean;
FDirectInput : Boolean;
FOnButtonClick : TNotifyEvent;
function GetButtonWidth: Integer;
function GetDirectInput: Boolean;
function GetFlat: Boolean;
Procedure CheckButtonVisible;
procedure SetButtonNeedsFocus(const AValue: Boolean);
procedure SetButtonWidth(const AValue: Integer);
procedure SetDirectInput(const AValue: Boolean);
procedure SetFlat(const AValue: Boolean);
procedure SetGlyph(Pic: TBitmap);
function GetGlyph : TBitmap;
@ -64,7 +65,7 @@ type
procedure CMEnabledChanged(var Msg: TLMessage); message CM_ENABLEDCHANGED;
// New properties.
Property ButtonWidth : Integer Read GetButtonWidth write SetButtonWidth;
property DirectInput : Boolean read FDirectInput write FDirectInput Default True;
property DirectInput : Boolean read GetDirectInput write SetDirectInput stored False Default True;
property Glyph : TBitmap read GetGlyph write SetGlyph;
property NumGlyphs : Integer read GetNumGlyphs write SetNumGlyphs;
property OnButtonClick : TNotifyEvent read FOnButtonClick write FOnButtonClick;
@ -461,7 +462,6 @@ begin
FButton.Cursor := crArrow;
FButton.ControlStyle := FButton.ControlStyle + [csNoDesignSelectable];
ControlStyle := ControlStyle - [csSetCaption];
FDirectInput := True;
end;
destructor TCustomEditButton.Destroy;
@ -481,6 +481,11 @@ begin
Result:=FButton.Width;
end;
function TCustomEditButton.GetDirectInput: Boolean;
begin
Result := not ReadOnly;
end;
function TCustomEditButton.GetFlat: Boolean;
begin
If Assigned(FButton) then
@ -510,6 +515,11 @@ begin
FButton.Width:=AValue;
end;
procedure TCustomEditButton.SetDirectInput(const AValue: Boolean);
begin
ReadOnly := not AValue;
end;
procedure TCustomEditButton.SetFlat(const AValue: Boolean);
begin
If Assigned(FButton) then