First commit 16/08/1996
This commit is contained in:
82
Builder/agenda/busqueda.cpp
Normal file
82
Builder/agenda/busqueda.cpp
Normal file
@ -0,0 +1,82 @@
|
||||
//---------------------------------------------------------------------------
|
||||
#include <vcl\vcl.h>
|
||||
#pragma hdrstop
|
||||
|
||||
#include "busqueda.h"
|
||||
#include "diario.h"
|
||||
#include "recuerda.h"
|
||||
#include "telefonos.h"
|
||||
//---------------------------------------------------------------------------
|
||||
#pragma link "Grids"
|
||||
#pragma resource "*.dfm"
|
||||
int direccion;
|
||||
TForm4 *Form4;
|
||||
//---------------------------------------------------------------------------
|
||||
__fastcall TForm4::TForm4(TComponent* Owner)
|
||||
: TForm(Owner)
|
||||
{
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TForm4::ComboBox1Change(TObject *Sender)
|
||||
{
|
||||
Edit1->SetFocus();
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TForm4::Edit1KeyPress(TObject *Sender, char &Key)
|
||||
{
|
||||
TLocateOptions SearchOptions;
|
||||
SearchOptions << loPartialKey;
|
||||
switch(busca)
|
||||
{
|
||||
case 0:
|
||||
if(Key=='\r')
|
||||
Table1->Locate("Fecha", Edit1->Text, SearchOptions);
|
||||
break;
|
||||
|
||||
case 1:
|
||||
if (ComboBox1->Text == "Nombre")
|
||||
Table1->Locate("Nombre", Edit1->Text, SearchOptions);
|
||||
else
|
||||
Table1->Locate("Apodo", Edit1->Text, SearchOptions);
|
||||
break;
|
||||
|
||||
case 2:
|
||||
if(Key=='\r')
|
||||
Table1->Locate("Fecha", Edit1->Text, SearchOptions);
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TForm4::FormActivate(TObject *Sender)
|
||||
{
|
||||
ComboBox1->Clear();
|
||||
Edit1->Clear();
|
||||
|
||||
switch(busca)
|
||||
{
|
||||
|
||||
case 0:
|
||||
ComboBox1->Text="Fecha";
|
||||
ComboBox1->Items->Add("Fecha");
|
||||
break;
|
||||
|
||||
case 1:
|
||||
ComboBox1->Text="Nombre";
|
||||
ComboBox1->Items->Add("Apodo");
|
||||
ComboBox1->Items->Add("Nombre");
|
||||
break;
|
||||
|
||||
case 2:
|
||||
ComboBox1->Text="Fecha";
|
||||
ComboBox1->Items->Add("Fecha");
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TForm4::FormClose(TObject *Sender, TCloseAction &Action)
|
||||
{
|
||||
direccion = (Table1->RecNo) -1;
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
Reference in New Issue
Block a user