El de bicho lo había hecho así...
Código Delphi
[-]
function TForm.GetStatusBarPanelClicked(StatusBar : TStatusBar; X, Y: Integer) : Integer;
var i, PanelWidthSum : integer;
begin
PanelWidthSum := 0;
for i := 0 to StatusBar.Panels.Count - 1 do
begin
if (x >= PanelWidthSum) and (x <= PanelWidthSum+StatusBar.Panels[i].Width) then
begin
Result := i;
exit;
end else
Inc(PanelWidthSum, StatusBar.Panels[i].Width);
end;
Result := -1;
end;
Hago la salvedad que usando cualquiera de los dos códigos; NO tienes que agregar nada a Uses...
El mismo compilador lo hace