Watch, Follow, &
Connect with Us
Public Report
Report From: Delphi-BCB/VCL/Action Classes    [ Add a report in this area ]  
Report #:  37978   Status: Closed
TButton can not be action client of TSearchFind
Project:  Delphi Build #:  10.0.2445.40105
Version:    10.0 Submitted By:   Erwin Mouthaan
Report Type:  Minor failure / Design problem Date Reported:  12/21/2006 5:48:31 AM
Severity:    Commonly encountered problem Last Updated: 12/21/2006 2:36:56 PM
Platform:    All versions Internal Tracking #:  
Resolution: As Designed (Resolution Comments) Resolved in Build: : None
Duplicate of:  None
Voting and Rating
Overall Rating: No Ratings Yet
0.00 out of 5
Total Votes: None
Description
When the standard action TSearchFind is connected to a TButton, no find dialog appears when the button is clicked.
Steps to Reproduce:
- Start a new VCL Forms Application.

- Drop a TMemo, a TButton and a TActionList on the form.

- Double click the ActionList component to invoke the Action List Editor.

- Select New Standard Action, and choose TSearchFind. Press OK.

- Set the action property of the button to the search action.

- Run the application. When one clicks the button, it becomes disabled and no find dialog appears.
Workarounds
None
Attachment
None
Comments

Sebastian Modersohn at 12/21/2006 2:35:53 PM -
Quote from the help:

--
Controls such as menu items and tool buttons linked to this action cause the application to display the find dialog or bring it to the fore.

TSearchFind is designed to work with an edit control (TCustomEdit descendant) as a target. It automatically disables itself if the active control in a form is not an edit control.
--

This is exactly the designed behaviour. TSearchFind (and many other actions, like TEditCut etc. apply to the currently focused control. Therefore linking them to a TButton won't work, since clicking the button makes it the currently focused control!

Server Response from: ETNACODE01