View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0038135 | Lazarus | LCL | public | 2020-11-27 05:33 | 2020-11-30 21:24 |
Reporter | Wallaby | Assigned To | Juha Manninen | ||
Priority | normal | Severity | minor | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Product Version | 2.1 (SVN) | ||||
Summary | 0038135: Changing TAction.ImageIndex does not propogate to TSpeedButton's image index. | ||||
Description | There seems to be an issue in linking an action to a speed button. I have created a test project with one speed button, one image list with two images and an action. When I change the action's Caption property, the speed button's caption is updated correctly. However when I change the action's ImageIndex property, the speed button's image is not updated. The same can be observed in design time when changing the action's ImageIndex. | ||||
Steps To Reproduce | Open the sample project and click the button. Expected behaviour: caption and image change. Actual behaviour: caption changes, image does NOT | ||||
Tags | No tags attached. | ||||
Fixed in Revision | r64165 | ||||
LazTarget | - | ||||
Widgetset | Win32/Win64 | ||||
Attached Files |
|
|
|
|
Patch fixes problem speedbutton.diff (1,518 bytes)
Index: lcl/buttons.pp =================================================================== --- lcl/buttons.pp (revision 64160) +++ lcl/buttons.pp (working copy) @@ -290,9 +290,11 @@ procedure AssignClient(AClient: TObject); override; procedure SetGroupIndex(Value: Integer); override; procedure SetChecked(Value: Boolean); override; + procedure SetImageIndex(Value: Integer); override; public function IsCheckedLinked: Boolean; override; function IsGroupIndexLinked: Boolean; override; + function IsImageIndexLinked: Boolean; override; end; { TCustomSpeedButton } Index: lcl/include/speedbutton.inc =================================================================== --- lcl/include/speedbutton.inc (revision 64160) +++ lcl/include/speedbutton.inc (working copy) @@ -1224,6 +1224,12 @@ (SpeedButton.GroupIndex = (Action as TCustomAction).GroupIndex); end; +function TSpeedButtonActionLink.IsImageIndexLinked: Boolean; +begin + Result := inherited IsImageIndexLinked and + (TSpeedButton(FClient).ImageIndex = (Action as TCustomAction).ImageIndex); +end; + procedure TSpeedButtonActionLink.SetGroupIndex(Value: Integer); begin if IsGroupIndexLinked then TCustomSpeedButton(FClient).GroupIndex := Value; @@ -1234,7 +1240,13 @@ if IsCheckedLinked then TCustomSpeedButton(FClient).Down := Value; end; +procedure TSpeedButtonActionLink.SetImageIndex(Value: Integer); +begin + if IsImageIndexLinked then + TSpeedButton(FClient).ImageIndex := Value; +end; |
|
That patch helps, thank you. Devs, please merge it with the trunk. |
|
ping @JuhaManninen |
|
Applied, thanks. BTW, patch command refused to apply it : $ patch -p0 < ~/patch/speedbutton.diff patching file lcl/buttons.pp patching file lcl/include/speedbutton.inc patch: **** unexpected end of file in patch and indeed the last hunk ends without the trailing existing lines for some reason. It was a small patch and I could easily autogenerate the function bodies and then copy the code. No problem. |
Date Modified | Username | Field | Change |
---|---|---|---|
2020-11-27 05:33 | Wallaby | New Issue | |
2020-11-27 05:33 | Wallaby | File Added: test.zip | |
2020-11-27 20:19 | Anton Kavalenka | Note Added: 0127213 | |
2020-11-27 20:19 | Anton Kavalenka | File Added: speedbutton.diff | |
2020-11-28 06:00 | Wallaby | Note Added: 0127223 | |
2020-11-30 19:48 | Anton Kavalenka | Note Added: 0127276 | |
2020-11-30 21:09 | Juha Manninen | Assigned To | => Juha Manninen |
2020-11-30 21:09 | Juha Manninen | Status | new => assigned |
2020-11-30 21:24 | Juha Manninen | Status | assigned => resolved |
2020-11-30 21:24 | Juha Manninen | Resolution | open => fixed |
2020-11-30 21:24 | Juha Manninen | Fixed in Revision | => r64165 |
2020-11-30 21:24 | Juha Manninen | LazTarget | => - |
2020-11-30 21:24 | Juha Manninen | Widgetset | Win32/Win64 => Win32/Win64 |
2020-11-30 21:24 | Juha Manninen | Note Added: 0127280 |