commit 770bd03a810fa3d18b34aa8a17aa45cb810c990b Author: jdg Date: Sun Sep 12 22:14:03 2021 +0200 First commit 12/02/2000 diff --git a/Datos/ACTIVIDA.MDX b/Datos/ACTIVIDA.MDX new file mode 100644 index 0000000..27c035c Binary files /dev/null and b/Datos/ACTIVIDA.MDX differ diff --git a/Datos/Act2Pro.PX b/Datos/Act2Pro.PX new file mode 100644 index 0000000..1b9b0e8 Binary files /dev/null and b/Datos/Act2Pro.PX differ diff --git a/Datos/Act2Pro.db b/Datos/Act2Pro.db new file mode 100644 index 0000000..a9a3d61 Binary files /dev/null and b/Datos/Act2Pro.db differ diff --git a/Datos/Actividad.DBF b/Datos/Actividad.DBF new file mode 100644 index 0000000..3fe8522 Binary files /dev/null and b/Datos/Actividad.DBF differ diff --git a/Datos/Actividad.PX b/Datos/Actividad.PX new file mode 100644 index 0000000..1c70eda Binary files /dev/null and b/Datos/Actividad.PX differ diff --git a/Datos/Actividad.db b/Datos/Actividad.db new file mode 100644 index 0000000..2cb36e8 Binary files /dev/null and b/Datos/Actividad.db differ diff --git a/Datos/Proveedores.DB b/Datos/Proveedores.DB new file mode 100644 index 0000000..316f69e Binary files /dev/null and b/Datos/Proveedores.DB differ diff --git a/Datos/Proveedores.MB b/Datos/Proveedores.MB new file mode 100644 index 0000000..0dca1c0 Binary files /dev/null and b/Datos/Proveedores.MB differ diff --git a/Datos/Proveedores.PX b/Datos/Proveedores.PX new file mode 100644 index 0000000..666fe48 Binary files /dev/null and b/Datos/Proveedores.PX differ diff --git a/InfoProveedores.cpp b/InfoProveedores.cpp new file mode 100644 index 0000000..1b7d0e0 --- /dev/null +++ b/InfoProveedores.cpp @@ -0,0 +1,249 @@ +//--------------------------------------------------------------------------- +#include +#include +#pragma hdrstop + +#include "InfoProveedores.h" +//--------------------------------------------------------------------------- +#pragma package(smart_init) +#pragma resource "*.dfm" +TInfoProv *InfoProv; +//--------------------------------------------------------------------------- +__fastcall TInfoProv::TInfoProv(TComponent* Owner) + : TForm(Owner) +{ + TbProv->Active = true; + TbProv2Act->Active = true; + TbAct->Active = true; +} +//--------------------------------------------------------------------------- +void __fastcall TInfoProv::DsProvDataChange(TObject *Sender, TField *Field) +{ + char BarraEstado[80]; + + // Indicador de FichaActual / Num.Fichas + if ( DsProv -> DataSet -> RecNo > 0 ) + sprintf( BarraEstado, "%d / %d", DsProv -> DataSet -> RecNo, DsProv -> DataSet -> RecordCount ); + else + sprintf( BarraEstado, "¿Nuevo? / %d", DsProv -> DataSet -> RecordCount ); + + StatusBar1->Panels->Items[2]->Text = BarraEstado; +} +//--------------------------------------------------------------------------- + +void __fastcall TInfoProv::RB1Click(TObject *Sender) +{ + Edit1->SetFocus(); +} +//--------------------------------------------------------------------------- + +void __fastcall TInfoProv::RB2Click(TObject *Sender) +{ + Edit2->SetFocus(); +} +//--------------------------------------------------------------------------- + +void __fastcall TInfoProv::RB3Click(TObject *Sender) +{ + Edit3->SetFocus(); +} +//--------------------------------------------------------------------------- + +void __fastcall TInfoProv::RB4Click(TObject *Sender) +{ + Edit4->SetFocus(); +} +//--------------------------------------------------------------------------- + +void __fastcall TInfoProv::RB5Click(TObject *Sender) +{ + Edit5->SetFocus(); +} +//--------------------------------------------------------------------------- + +void __fastcall TInfoProv::Edit1Enter(TObject *Sender) +{ + RB1->Checked = true; +} +//--------------------------------------------------------------------------- + +void __fastcall TInfoProv::Edit2Enter(TObject *Sender) +{ + RB2->Checked = true; +} +//--------------------------------------------------------------------------- + +void __fastcall TInfoProv::Edit3Enter(TObject *Sender) +{ + RB3->Checked = true; +} +//--------------------------------------------------------------------------- + +void __fastcall TInfoProv::Edit4Enter(TObject *Sender) +{ + RB4->Checked = true; +} +//--------------------------------------------------------------------------- + +void __fastcall TInfoProv::Edit5Enter(TObject *Sender) +{ + RB5->Checked = true; +} +//--------------------------------------------------------------------------- + +void __fastcall TInfoProv::SpeedButton1Click(TObject *Sender) +{ + Close(); +} +//--------------------------------------------------------------------------- + + +void __fastcall TInfoProv::Edit1KeyPress(TObject *Sender, char &Key) +{ + Edit2->Text = ""; + Edit3->Text = ""; + Edit4->Text = ""; + Edit5->Text = ""; +} +//--------------------------------------------------------------------------- + +void __fastcall TInfoProv::Edit2KeyPress(TObject *Sender, char &Key) +{ + Edit1->Text = ""; + Edit3->Text = ""; + Edit4->Text = ""; + Edit5->Text = ""; +} +//--------------------------------------------------------------------------- + +void __fastcall TInfoProv::Edit3KeyPress(TObject *Sender, char &Key) +{ + Edit1->Text = ""; + Edit2->Text = ""; + Edit4->Text = ""; + Edit5->Text = ""; +} +//--------------------------------------------------------------------------- + +void __fastcall TInfoProv::Edit4KeyPress(TObject *Sender, char &Key) +{ + Edit1->Text = ""; + Edit2->Text = ""; + Edit3->Text = ""; + Edit5->Text = ""; +} +//--------------------------------------------------------------------------- + +void __fastcall TInfoProv::Edit5KeyPress(TObject *Sender, char &Key) +{ + Edit1->Text = ""; + Edit2->Text = ""; + Edit3->Text = ""; + Edit4->Text = ""; +} +//--------------------------------------------------------------------------- + +void __fastcall TInfoProv::TabSheet2Enter(TObject *Sender) +{ + PageControl2->ActivePage = TabSheet4; +} +//--------------------------------------------------------------------------- + +void __fastcall TInfoProv::SpeedButton2Click(TObject *Sender) +{ + + // Si no tiene ya esta actividad... + if ( ! ( TbProv2Act -> Locate( "ID_ACTIVIDAD", TbAct->FieldByName( "ID_ACTIVIDAD" )->Value, TLocateOptions() << loCaseInsensitive ) ) ) + // Añadimos esta actividad al proveedor actualmente señalado... + TbProv2Act -> InsertRecord( ARRAYOFCONST( + ( + TbProv->FieldByName( "ID_PROVEEDOR" )->Value, + TbAct->FieldByName( "ID_ACTIVIDAD" )->Value + ) ) ); + else + ShowMessage( "Este proveedor ya tiene asignada, la actividad que intenta agregar" ); + +} +//--------------------------------------------------------------------------- + +void __fastcall TInfoProv::SpeedButton3Click(TObject *Sender) +{ + AnsiString MSG; + + MSG = "Seguro que desea eliminar la actividad de: \n"+TbProv2Act->FieldByName("NombreActividad")->AsString+"\n del proveedor actual: \n" + TbProv->FieldByName( "Nombre" )->AsString; + switch( MessageDlg( MSG, mtWarning, TMsgDlgButtons() << mbNo << mbYes, 0 ) ) + { + case mrYes: + TbProv2Act->Delete(); + break; + default: + break; + } +} +//--------------------------------------------------------------------------- + +void __fastcall TInfoProv::RefiltrarDatos(TObject *Sender) +{ + AnsiString Aqui, BuscarEsto; + + + // SI no hay actividades seleccionadas + // Tenemos que dejar las propiedades MAESTRO-DETALLE: + // + // TbProv2Act ---> TbProv + // + + + + + // // Filter contendrá el 'multi-filtro' (Esto puede parecer un poco tosco), pero realmente funciona... ). + + + // ! NOTA: NO LLAMAR A ESTA FUNCION DESDE NINGUN SITIO SIN ASEGURARSE + // ! QUE EL OBJETO CONTIENE UN EDIT VALIDO... + // ! + + if ( RB1->Checked ) Aqui = "ID_PROVEEDOR"; + if ( RB2->Checked ) Aqui = "Nombre"; + if ( RB3->Checked ) Aqui = "CIF"; + if ( RB4->Checked ) Aqui = "Direccion"; + if ( RB5->Checked ) Aqui = "CP"; + + // Obtenemos el valor del campo concreto que esta señalado... + BuscarEsto = ((TEdit *) Sender )->Text; + + { // Some non-indexed field. + AnsiString BuscarCota; + BuscarCota = BuscarEsto + "Z"; + + TbProv->FilterOptions = TbBusquedas->FilterOptions << foCaseInsensitive; + + TbProv->Filter = "( ([" + Aqui + "] >= '" + BuscarEsto + "') AND [" + Aqui + "] < '" + BuscarCota + "')"; + TbProv->Filtered = true; + } + + TbBusquedas->Refresh(); +} +//--------------------------------------------------------------------------- + +void __fastcall TInfoProv::SpeedButton4Click(TObject *Sender) +{ + if ( TbProv->Filtered ) + { + SpeedButton4->Caption = "Pulse aqui para ACTIVAR FILTRO"; + TbProv->Filtered = false; + + TbProv2Act -> Active = false; + TbProv2Act -> MasterSource = DsProv; + TbProv2Act -> IndexFieldName = "ID_PROVEEDOR"; + TbProv2Act -> MasterFields = "ID_PROVEEDOR"; + TbProv2Act -> MasterSource = DsProv; + + + } else { + SpeedButton4->Caption = "Pulse aqui para DEJAR de FILTRAR" + TbProv->Filtered = true; + } +} +//--------------------------------------------------------------------------- + diff --git a/InfoProveedores.dfm b/InfoProveedores.dfm new file mode 100644 index 0000000..1cb77e4 Binary files /dev/null and b/InfoProveedores.dfm differ diff --git a/InfoProveedores.h b/InfoProveedores.h new file mode 100644 index 0000000..ad0e102 --- /dev/null +++ b/InfoProveedores.h @@ -0,0 +1,90 @@ +//--------------------------------------------------------------------------- +#ifndef InfoProveedoresH +#define InfoProveedoresH +//--------------------------------------------------------------------------- +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +//--------------------------------------------------------------------------- +class TInfoProv : public TForm +{ +__published: // IDE-managed Components + TStatusBar *StatusBar1; + TPanel *Panel1; + TSpeedButton *SpeedButton1; + TDBGrid *DBGrid1; + TTable *TbProv; + TTable *TbProv2Act; + TTable *TbAct; + TDataSource *DsProv; + TPanel *Panel2; + TPageControl *PageControl1; + TTabSheet *TabSheet1; + TTabSheet *TabSheet2; + TDBMemo *DBMemo1; + TDataSource *DsProv2Act; + TIntegerField *TbProv2ActID_PROVEEDOR; + TIntegerField *TbProv2ActID_ACTIVIDAD; + TStringField *TbProv2ActNombreActividad; + TPageControl *PageControl2; + TTabSheet *TabSheet3; + TPanel *Panel3; + TRadioButton *RB1; + TRadioButton *RB2; + TRadioButton *RB3; + TRadioButton *RB4; + TRadioButton *RB5; + TEdit *Edit1; + TEdit *Edit2; + TEdit *Edit3; + TEdit *Edit4; + TEdit *Edit5; + TDBGrid *DBGrid2; + TTabSheet *TabSheet4; + TDataSource *DsAct; + TDBGrid *DBGrid3; + TDBGrid *DBGrid4; + TSpeedButton *SpeedButton2; + TSpeedButton *SpeedButton3; + TSpeedButton *SpeedButton4; + void __fastcall DsProvDataChange(TObject *Sender, TField *Field); + void __fastcall RB1Click(TObject *Sender); + void __fastcall RB2Click(TObject *Sender); + void __fastcall RB3Click(TObject *Sender); + void __fastcall RB4Click(TObject *Sender); + void __fastcall RB5Click(TObject *Sender); + void __fastcall Edit1Enter(TObject *Sender); + void __fastcall Edit2Enter(TObject *Sender); + void __fastcall Edit3Enter(TObject *Sender); + void __fastcall Edit4Enter(TObject *Sender); + void __fastcall Edit5Enter(TObject *Sender); + void __fastcall SpeedButton1Click(TObject *Sender); + void __fastcall Edit1KeyPress(TObject *Sender, char &Key); + void __fastcall Edit2KeyPress(TObject *Sender, char &Key); + void __fastcall Edit3KeyPress(TObject *Sender, char &Key); + void __fastcall Edit4KeyPress(TObject *Sender, char &Key); + void __fastcall Edit5KeyPress(TObject *Sender, char &Key); + void __fastcall TabSheet2Enter(TObject *Sender); + + void __fastcall SpeedButton2Click(TObject *Sender); + void __fastcall SpeedButton3Click(TObject *Sender); + void __fastcall RefiltrarDatos(TObject *Sender); + void __fastcall SpeedButton4Click(TObject *Sender); +private: // User declarations +public: // User declarations + __fastcall TInfoProv(TComponent* Owner); +}; +//--------------------------------------------------------------------------- +extern PACKAGE TInfoProv *InfoProv; +//--------------------------------------------------------------------------- +#endif diff --git a/MultiFiltro.bpr b/MultiFiltro.bpr new file mode 100644 index 0000000..0a5a406 --- /dev/null +++ b/MultiFiltro.bpr @@ -0,0 +1,180 @@ +# --------------------------------------------------------------------------- +!if !$d(BCB) +BCB = $(MAKEDIR)\.. +!endif + +# --------------------------------------------------------------------------- +# IDE SECTION +# --------------------------------------------------------------------------- +# The following section of the project makefile is managed by the BCB IDE. +# It is recommended to use the IDE to change any of the values in this +# section. +# --------------------------------------------------------------------------- + +VERSION = BCB.03 +# --------------------------------------------------------------------------- +PROJECT = MultiFiltro.exe +OBJFILES = MultiFiltro.obj InfoProveedores.obj +RESFILES = MultiFiltro.res +DEFFILE = +RESDEPEN = $(RESFILES) InfoProveedores.dfm +LIBFILES = +LIBRARIES = VCLDB35.lib VCL35.lib +SPARELIBS = VCL35.lib VCLDB35.lib +PACKAGES = VCLX35.bpi VCL35.bpi VCLDB35.bpi VCLDBX35.bpi QRPT35.bpi TEEUI35.bpi \ + VCLSMP35.bpi TEEDB35.bpi TEE35.bpi NMFAST35.bpi INETDB35.bpi INET35.bpi \ + JD_soft.bpi CDopping.bpi bcbsmp35.bpi dclocx35.bpi ibsmp35.bpi QSElFrm.bpi +# --------------------------------------------------------------------------- +PATHCPP = .; +PATHASM = .; +PATHPAS = .; +PATHRC = .; +DEBUGLIBPATH = $(BCB)\lib\debug +RELEASELIBPATH = $(BCB)\lib\release +# --------------------------------------------------------------------------- +CFLAG1 = -Od -Hc -w -Ve -r- -k -y -v -vi- -c -b- -w-par -w-inl -Vx -tW +CFLAG2 = -D_RTLDLL -I$(BCB)\include;$(BCB)\include\vcl -H=$(BCB)\lib\vcl35.csm +CFLAG3 = -Tkh30000 +PFLAGS = -D_RTLDLL \ + -U..\componentes\cdopping;..\componentes;"..\jd soft";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -I$(BCB)\include;$(BCB)\include\vcl -$Y -$W -$O- -v -JPHN -M +RFLAGS = -D_RTLDLL -i$(BCB)\include;$(BCB)\include\vcl +AFLAGS = /i$(BCB)\include /i$(BCB)\include\vcl /d_RTLDLL /mx /w2 /zd +LFLAGS = -L..\componentes\cdopping;..\componentes;"..\jd soft";$(BCB)\lib\obj;$(BCB)\lib;$(RELEASELIBPATH) \ + -aa -Tpe -x -Gn -v +IFLAGS = +# --------------------------------------------------------------------------- +ALLOBJ = c0w32.obj sysinit.obj $(OBJFILES) +ALLRES = $(RESFILES) +ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib +# --------------------------------------------------------------------------- +!ifdef IDEOPTIONS + +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +Locale=3082 +CodePage=1252 + +[Version Info Keys] +CompanyName=Informatica DJ "Programadores" +FileDescription=MultiFlitro (Ejemplo para mi amigo Benji) +FileVersion=1.0.0.0 +InternalName=MultiFiltro +LegalCopyright=JD Soft. +LegalTrademarks=JD Soft. +OriginalFilename=MultiFiltro +ProductName=MultiFiltro +ProductVersion=1.0.0.0 +Comments= +WEB=http://www.infdj.com +E-Mail=http://jd@infdj.com + +[HistoryLists\hlIncludePath] +Count=1 +Item0=$(BCB)\include;$(BCB)\include\vcl + +[HistoryLists\hlLibraryPath] +Count=1 +Item0=..\componentes\cdopping;..\componentes;..\jd soft;$(BCB)\lib\obj;$(BCB)\lib + +[HistoryLists\hlDebugSourcePath] +Count=1 +Item0=$(BCB)\source\vcl + +[HistoryLists\hlConditionals] +Count=1 +Item0=_RTLDLL + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +HostApplication= + +!endif + +# --------------------------------------------------------------------------- +# MAKE SECTION +# --------------------------------------------------------------------------- +# This section of the project file is not used by the BCB IDE. It is for +# the benefit of building from the command-line using the MAKE utility. +# --------------------------------------------------------------------------- + +.autodepend +# --------------------------------------------------------------------------- +!if !$d(BCC32) +BCC32 = bcc32 +!endif + +!if !$d(DCC32) +DCC32 = dcc32 +!endif + +!if !$d(TASM32) +TASM32 = tasm32 +!endif + +!if !$d(LINKER) +LINKER = ilink32 +!endif + +!if !$d(BRCC32) +BRCC32 = brcc32 +!endif +# --------------------------------------------------------------------------- +!if $d(PATHCPP) +.PATH.CPP = $(PATHCPP) +.PATH.C = $(PATHCPP) +!endif + +!if $d(PATHPAS) +.PATH.PAS = $(PATHPAS) +!endif + +!if $d(PATHASM) +.PATH.ASM = $(PATHASM) +!endif + +!if $d(PATHRC) +.PATH.RC = $(PATHRC) +!endif +# --------------------------------------------------------------------------- +$(PROJECT): $(OBJFILES) $(RESDEPEN) $(DEFFILE) + $(BCB)\BIN\$(LINKER) @&&! + $(LFLAGS) + + $(ALLOBJ), + + $(PROJECT),, + + $(ALLLIB), + + $(DEFFILE), + + $(ALLRES) +! +# --------------------------------------------------------------------------- +.pas.hpp: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.pas.obj: + $(BCB)\BIN\$(DCC32) $(PFLAGS) {$< } + +.cpp.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.c.obj: + $(BCB)\BIN\$(BCC32) $(CFLAG1) $(CFLAG2) $(CFLAG3) -n$(@D) {$< } + +.asm.obj: + $(BCB)\BIN\$(TASM32) $(AFLAGS) $<, $@ + +.rc.res: + $(BCB)\BIN\$(BRCC32) $(RFLAGS) -fo$@ $< +# --------------------------------------------------------------------------- diff --git a/MultiFiltro.cpp b/MultiFiltro.cpp new file mode 100644 index 0000000..6a1712c --- /dev/null +++ b/MultiFiltro.cpp @@ -0,0 +1,21 @@ +//--------------------------------------------------------------------------- +#include +#pragma hdrstop +USERES("MultiFiltro.res"); +USEFORM("InfoProveedores.cpp", InfoProv); +//--------------------------------------------------------------------------- +WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int) +{ + try + { + Application->Initialize(); + Application->CreateForm(__classid(TInfoProv), &InfoProv); + Application->Run(); + } + catch (Exception &exception) + { + Application->ShowException(&exception); + } + return 0; +} +//--------------------------------------------------------------------------- diff --git a/MultiFiltro.exe b/MultiFiltro.exe new file mode 100644 index 0000000..24f33ce Binary files /dev/null and b/MultiFiltro.exe differ diff --git a/MultiFiltro.res b/MultiFiltro.res new file mode 100644 index 0000000..2e40531 Binary files /dev/null and b/MultiFiltro.res differ diff --git a/MultiFiltro2.exe b/MultiFiltro2.exe new file mode 100644 index 0000000..36904b0 Binary files /dev/null and b/MultiFiltro2.exe differ diff --git a/README.md b/README.md new file mode 100644 index 0000000..c9b2bea --- /dev/null +++ b/README.md @@ -0,0 +1,9 @@ +#MultiFiltro + + +*12/02/2000* + +ToDo: wwtcf? + + +![screenshot](/MultiFiltro.png "Screenshot")