{%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% osCommerce Product Manager for Windows (oscpmwin). Copyright ©2003-2006 by Mario A. Valdez-Ramirez. You can contact Mario A. Valdez-Ramirez by email at mario@mariovaldez.org or paper mail at Olmos 809, San Nicolas, NL. 66495, Mexico. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%} unit search; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, Buttons, ExtCtrls; type Topm_Form_SearchProduct = class(TForm) opm_ComboBox_SearchCat: TComboBox; opm_ComboBox_SearchMan: TComboBox; opm_Edit_SearchModel: TEdit; opm_Edit_SearchName: TEdit; opm_Label_SearchCat: TLabel; opm_Label_SearchMan: TLabel; opm_Label_SearchModel: TLabel; opm_Label_SearchName: TLabel; opm_BitBtn_SearchOk: TBitBtn; opm_BitBtn_SearchCancel: TBitBtn; opm_Label_SearchDescription: TLabel; opm_Edit_SearchDescription: TEdit; opm_RadioGroup_SearchSPrice: TRadioGroup; opm_RadioGroup_SearchImgURL: TRadioGroup; opm_RadioGroup_SearchAvailable: TRadioGroup; procedure FormShow(Sender: TObject); procedure opm_BitBtn_SearchOkClick(Sender: TObject); procedure FormCreate(Sender: TObject); private { Private declarations } public end; var opm_Form_SearchProduct: Topm_Form_SearchProduct; implementation {$R *.dfm} Uses gnugettext, main, oscpmdata, balloons; {%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%} {%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%} procedure Topm_Form_SearchProduct.FormShow(Sender: TObject); VAR CurMan : opmR_Manufacturer; CurCat : opmR_Category; begin opm_Form_SearchProduct.Caption := _('Search product'); CurCat := opm_Form_Main.FNopm_GetCategory (opmG_CategoryList, opm_Search_PCategory, opmC_FindByID); CurMan := opm_Form_Main.FNopm_GetManufacturer (opmG_ManufacturerList, opm_Search_PManufacturer, opmC_FindByID); opm_ComboBox_SearchCat.Items := opmG_CategoryBoxList; opm_ComboBox_SearchCat.ItemIndex := CurCat.ListIndex; opm_ComboBox_SearchMan.Items := opmG_ManufacturerBoxList; opm_ComboBox_SearchMan.ItemIndex := CurMan.ListIndex; opm_Edit_SearchModel.Text := TRIM (opm_Search_PModel); opm_Edit_SearchName.Text := TRIM (opm_Search_PName); opm_Edit_SearchDescription.Text := TRIM (opm_Search_PDesc); opm_RadioGroup_SearchSPrice.ItemIndex := ABS (opm_Search_PSPrice); opm_RadioGroup_SearchImgURL.ItemIndex := ABS (opm_Search_PImagURL); opm_RadioGroup_SearchAvailable.ItemIndex := ABS (opm_Search_PAvailable); end; {%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%} {%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%} procedure Topm_Form_SearchProduct.opm_BitBtn_SearchOkClick(Sender: TObject); VAR CurCat : opmR_Category; CurMan : opmR_Manufacturer; begin CurCat := opm_Form_Main.FNopm_GetCategory (opmG_CategoryList, opm_ComboBox_SearchCat.ItemIndex, opmC_FindByIndex); opm_Search_PCategory := CurCat.ID; CurMan := opm_Form_Main.FNopm_GetManufacturer (opmG_ManufacturerList, opm_ComboBox_SearchMan.ItemIndex, opmC_FindByIndex); opm_Search_PManufacturer := CurMan.ID; opm_Search_PModel := TRIM (opm_Edit_SearchModel.Text); opm_Search_PName := TRIM (opm_Edit_SearchName.Text); opm_Search_PDesc := TRIM (opm_Edit_SearchDescription.Text); opm_Search_PSPrice := ABS (opm_RadioGroup_SearchSPrice.ItemIndex); opm_Search_PImagURL := ABS (opm_RadioGroup_SearchImgURL.ItemIndex); opm_Search_PAvailable := ABS (opm_RadioGroup_SearchAvailable.ItemIndex); end; {%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%} {%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%} procedure Topm_Form_SearchProduct.FormCreate(Sender: TObject); begin TranslateComponent (self); end; end.