mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2026-01-06 17:00:32 +01:00
Improves TBitmappedButton
git-svn-id: trunk@26793 -
This commit is contained in:
parent
296303b61b
commit
7b6e736a6c
@ -159,6 +159,8 @@ procedure TCustomBitmappedButton.DoButtonDown();
|
||||
var
|
||||
NewState: TBitmappedButtonState;
|
||||
begin
|
||||
NewState := FState;
|
||||
|
||||
case FState of
|
||||
bbsNormal, bbsFocused: NewState := bbsDown;
|
||||
// bbsChecked, bbsCheckedSelected: NewState := bbsCheckedDown;
|
||||
@ -175,6 +177,8 @@ procedure TCustomBitmappedButton.DoButtonUp();
|
||||
var
|
||||
NewState: TBitmappedButtonState;
|
||||
begin
|
||||
NewState := FState;
|
||||
|
||||
case FState of
|
||||
bbsDown:
|
||||
begin
|
||||
@ -199,13 +203,15 @@ constructor TCustomBitmappedButton.Create(AOwner: TComponent);
|
||||
begin
|
||||
inherited Create(AOwner);
|
||||
|
||||
FOptions := [{bboDrawSelectionRectangle}];
|
||||
|
||||
FImageBtn := TPicture.Create;
|
||||
FImageBtnDown := TPicture.Create;
|
||||
FImageBtnMouseOver := TPicture.Create;
|
||||
FImageBtnFocused := TPicture.Create;
|
||||
FImageBtnChecked := TPicture.Create;
|
||||
|
||||
FOptions := [{bboDrawSelectionRectangle}];
|
||||
|
||||
TabStop := True;
|
||||
end;
|
||||
|
||||
destructor TCustomBitmappedButton.Destroy;
|
||||
@ -232,11 +238,12 @@ end;
|
||||
function TCustomBitmappedButton.GetStateBitmap(): TBitmap;
|
||||
begin
|
||||
case FState of
|
||||
bbsNormal: Result := FImageBtn.Bitmap;
|
||||
bbsDown: Result := FImageBtnDown.Bitmap;
|
||||
// bbsMouseOver: Result := FImageBtnMouseOver;
|
||||
bbsFocused: Result := FImageBtnFocused.Bitmap;
|
||||
// bbsChecked: Result := FImageBtnChecked;
|
||||
else
|
||||
Result := FImageBtn.Bitmap;
|
||||
end;
|
||||
end;
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user