Just updated to Hydra version 6.3.0.1259, from version 6.2.99.1229. Using Delphi 10 Seattle.
The first thing that was noticed was that the OnActivate event on a THYVisualPlugin form wasn’t triggered, until you clicked on a control(i.e.: a button) on the form(yet the code behind the button doesn’t get executed). We also noticed that a lot of the controls(placed an a THYVisualPlugin form) were no longer responding as expected. As an example, we have a TMS TPlanner component on a THYVisualPlugin form, and a double-click event on a cell within TPlanner should return which column and row that the user double-clicked, but instead it is now returning the first column and first row everytime.
I did compare the code between version 6.2.99.1229 and 6.3.0.1259, and noticed that there was a change in the THYVisualPlugin.SetFocusedControl method.
The old code(version 6.2.99.1229):
function THYVisualPlugin.SetFocusedControl(Control: TWinControl): Boolean;
begin
Result := inherited SetFocusedControl(Control);
if ActiveControl <> nil then
SendMessage(ParentWindow, WM_FOCUSOUTOFHOST, 0, 0);
end;
The new code(version 6.3.0.1259):
function THYVisualPlugin.SetFocusedControl(Control: TWinControl): Boolean;
begin
Result := True;
if ActiveControl <> Control then begin
Result := inherited SetFocusedControl(Control);
if not (csDesigning in ComponentState) then begin
if ActiveControl <> nil then
SendMessage(ParentWindow, WM_FOCUSOUTOFHOST, 0, 0);
Control.SetFocus;
end;
end;
end;
I noticed that the inherited SetFocusedControl might not always be called, and also that calling Control.Focus might eliminate other values that are required for some functionalities in some controls(i.e.: TPlanner).
I modified the code as follows:
function THYVisualPlugin.SetFocusedControl(Control: TWinControl): Boolean;
begin
Result := inherited SetFocusedControl(Control);
if not (csDesigning in ComponentState) then begin
if ActiveControl <> nil then
SendMessage(ParentWindow, WM_FOCUSOUTOFHOST, 0, 0);
end;
end;
And, these modifications eliminates all the problems that I was seeing. And, that the application is now working the way it is designed, after making the changes.