mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-16 17:29:31 +02:00
mapped DirectInput to the negation of ReadOnly of the Edit (issue #1406)
git-svn-id: trunk@8115 -
This commit is contained in:
parent
0bddd9fc6c
commit
a8d697bb9e
@ -38,13 +38,14 @@ type
|
|||||||
private
|
private
|
||||||
FButton: TSpeedButton;
|
FButton: TSpeedButton;
|
||||||
FButtonNeedsFocus: Boolean;
|
FButtonNeedsFocus: Boolean;
|
||||||
FDirectInput : Boolean;
|
|
||||||
FOnButtonClick : TNotifyEvent;
|
FOnButtonClick : TNotifyEvent;
|
||||||
function GetButtonWidth: Integer;
|
function GetButtonWidth: Integer;
|
||||||
|
function GetDirectInput: Boolean;
|
||||||
function GetFlat: Boolean;
|
function GetFlat: Boolean;
|
||||||
Procedure CheckButtonVisible;
|
Procedure CheckButtonVisible;
|
||||||
procedure SetButtonNeedsFocus(const AValue: Boolean);
|
procedure SetButtonNeedsFocus(const AValue: Boolean);
|
||||||
procedure SetButtonWidth(const AValue: Integer);
|
procedure SetButtonWidth(const AValue: Integer);
|
||||||
|
procedure SetDirectInput(const AValue: Boolean);
|
||||||
procedure SetFlat(const AValue: Boolean);
|
procedure SetFlat(const AValue: Boolean);
|
||||||
procedure SetGlyph(Pic: TBitmap);
|
procedure SetGlyph(Pic: TBitmap);
|
||||||
function GetGlyph : TBitmap;
|
function GetGlyph : TBitmap;
|
||||||
@ -64,7 +65,7 @@ type
|
|||||||
procedure CMEnabledChanged(var Msg: TLMessage); message CM_ENABLEDCHANGED;
|
procedure CMEnabledChanged(var Msg: TLMessage); message CM_ENABLEDCHANGED;
|
||||||
// New properties.
|
// New properties.
|
||||||
Property ButtonWidth : Integer Read GetButtonWidth write SetButtonWidth;
|
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 Glyph : TBitmap read GetGlyph write SetGlyph;
|
||||||
property NumGlyphs : Integer read GetNumGlyphs write SetNumGlyphs;
|
property NumGlyphs : Integer read GetNumGlyphs write SetNumGlyphs;
|
||||||
property OnButtonClick : TNotifyEvent read FOnButtonClick write FOnButtonClick;
|
property OnButtonClick : TNotifyEvent read FOnButtonClick write FOnButtonClick;
|
||||||
@ -461,7 +462,6 @@ begin
|
|||||||
FButton.Cursor := crArrow;
|
FButton.Cursor := crArrow;
|
||||||
FButton.ControlStyle := FButton.ControlStyle + [csNoDesignSelectable];
|
FButton.ControlStyle := FButton.ControlStyle + [csNoDesignSelectable];
|
||||||
ControlStyle := ControlStyle - [csSetCaption];
|
ControlStyle := ControlStyle - [csSetCaption];
|
||||||
FDirectInput := True;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
destructor TCustomEditButton.Destroy;
|
destructor TCustomEditButton.Destroy;
|
||||||
@ -481,6 +481,11 @@ begin
|
|||||||
Result:=FButton.Width;
|
Result:=FButton.Width;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TCustomEditButton.GetDirectInput: Boolean;
|
||||||
|
begin
|
||||||
|
Result := not ReadOnly;
|
||||||
|
end;
|
||||||
|
|
||||||
function TCustomEditButton.GetFlat: Boolean;
|
function TCustomEditButton.GetFlat: Boolean;
|
||||||
begin
|
begin
|
||||||
If Assigned(FButton) then
|
If Assigned(FButton) then
|
||||||
@ -510,6 +515,11 @@ begin
|
|||||||
FButton.Width:=AValue;
|
FButton.Width:=AValue;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TCustomEditButton.SetDirectInput(const AValue: Boolean);
|
||||||
|
begin
|
||||||
|
ReadOnly := not AValue;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TCustomEditButton.SetFlat(const AValue: Boolean);
|
procedure TCustomEditButton.SetFlat(const AValue: Boolean);
|
||||||
begin
|
begin
|
||||||
If Assigned(FButton) then
|
If Assigned(FButton) then
|
||||||
|
Loading…
Reference in New Issue
Block a user