Link to home
Start Free TrialLog in
Avatar of rfwoolf
rfwoolfFlag for South Africa

asked on

Can't find TSearchBox / TSearchItem / SearchComponent.dcu | Anyone know this component?

Hi guys

I'm trying to get an old project to compile but it says class "TSearchBox" not found.
The missing unit is "SearchComponent" and it's looking for SearchComponent.dcu

I have googled / binged / AOL'd / Ask.com'd / pudn'd  torry.net'd etc
..and I can't seem to find this.

Hopefully you can help.

Here's references in the unit that might help:

unit U_CommissionsManagement;

interface

uses
  .. SearchComponent;

type
  TCommissionsManagement = class(TForm)
    ..
    SearchBox1: TSearchBox;
    ..
    siFrom: TSearchItem;
    siFormula: TSearchItem;
    siAgent: TSearchItem;
    siTo: TSearchItem;
    procedure SearchBox1Click(Sender: TObject);
    ..
  private
    { Private declarations }
  public
    { Public declarations }
  end;

implementation

{$R *.DFM}

procedure TCommissionsManagement.SearchBox1Click(Sender: TObject);
begin
  Q_Search.Close;
  SearchBox1.SQL.Text := 'SELECT COMMISSIONS.*,';
  SearchBox1.SQL.Append('COMMISSION_AGENTS.AGENT_NAME,');
  SearchBox1.SQL.Append('COMMISSION_FORMULAS.FORMULA_NAME');
  SearchBox1.SQL.Append('FROM ');
  SearchBox1.SQL.Append('COMMISSION_FORMULAS, COMMISSIONS, COMMISSION_AGENTS');
  SearchBox1.SQL.Append('WHERE ');
  SearchBox1.SQL.Append('COMMISSION_FORMULAS.COM_FORM_ID = COMMISSIONS.COM_FORM_ID AND');
  SearchBox1.SQL.Append('COMMISSIONS.AGENT_ID = COMMISSION_AGENTS.AGENT_ID');

  Q_Search.SQL.Text := SearchBox1.GenResultSQL;

  if siFrom.Value <> null then
  begin
    Q_Search.Parameters.ParamByName('siFrom').DataType := ftDate;
    Q_Search.Parameters.ParamByName('siFrom').Value := Floor(siFrom.Value);
  end;

  if siTo.Value <> null then
  begin
    Q_Search.Parameters.ParamByName('siTo').DataType := ftDate;
    Q_Search.Parameters.ParamByName('siTo').Value := Floor(siTo.Value) + 1;
  end;

  if siAgent.Value <> null then
  begin
    Q_Search.Parameters.ParamByName('siAgent').DataType := ftInteger;
    Q_Search.Parameters.ParamByName('siAgent').Value := siAgent.Value;
  end;

  if siFormula.Value <> null then
  begin
    Q_Search.Parameters.ParamByName('siFormula').DataType := ftInteger;
    Q_Search.Parameters.ParamByName('siFormula').Value := siFormula.Value;
  end;

  Q_Search.Open;
end;

procedure TCommissionsManagement.Q_SearchAfterScroll(DataSet: TDataSet);
begin
  if Q_Search.FieldByName('Commission_ID').AsString <> '' then
  begin
    lblEditCommissionStructure.Enabled := True;
    lblDeleteCommissionStructure.Enabled := True;
  end
  else
  begin
    lblEditCommissionStructure.Enabled := False;
    lblDeleteCommissionStructure.Enabled := False;
  end;
end;

..

procedure TCommissionsManagement.FormShow(Sender: TObject);
begin
  TranslateForm(Self);
  SiFrom.DisplayCaption := Translate(ApplicationLanguage, Self.Name, 'SearchFrom', 'From');
  SiTo.DisplayCaption := Translate(ApplicationLanguage, Self.Name, 'SearchTo', 'To');
  SiAgent.DisplayCaption := Translate(ApplicationLanguage, Self.Name, 'SearchAgent', 'Agent');
  SiFormula.DisplayCaption := Translate(ApplicationLanguage, Self.Name, 'SearchFormula', 'Formula');
  SearchBox1.ButtonCaption := Translate(ApplicationLanguage, Self.Name, 'SearchSearchButton', 'Search');
end;

end.

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Emmanuel PASQUIER
Emmanuel PASQUIER
Flag of France image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial