106 lines
2.9 KiB
ObjectPascal
106 lines
2.9 KiB
ObjectPascal
unit uConfiguracion;
|
|
|
|
interface
|
|
|
|
uses
|
|
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
|
Dialogs, StdCtrls, ComCtrls, ActnList, JvComponent,
|
|
JvAppStorage, JvAppRegistryStorage, Contnrs, ExtCtrls, ImgList,
|
|
PngImageList, JvExControls, JvGradientHeaderPanel, uFrameConfiguracion,
|
|
JvComponentBase, JvPageList, JvExComCtrls, JvPageListTreeView,
|
|
uConfFicherosEDI, uConexionBD, uConfGeneral;
|
|
|
|
type
|
|
TfConfiguracion = class(TForm)
|
|
Button1: TButton;
|
|
Button2: TButton;
|
|
ActionList1: TActionList;
|
|
actAceptar: TAction;
|
|
actCancelar: TAction;
|
|
JvAppRegistryStorage1: TJvAppRegistryStorage;
|
|
PngImageList1: TPngImageList;
|
|
JvSettingsTreeView1: TJvSettingsTreeView;
|
|
JvPageList1: TJvPageList;
|
|
JvStandardPage1: TJvStandardPage;
|
|
JvStandardPage2: TJvStandardPage;
|
|
JvStandardPage3: TJvStandardPage;
|
|
frConfGeneral1: TfrConfGeneral;
|
|
frConexionBD1: TfrConexionBD;
|
|
frConfFicherosEDI1: TfrConfFicherosEDI;
|
|
procedure tvArbolChange(Sender: TObject; Node: TTreeNode);
|
|
procedure actAceptarExecute(Sender: TObject);
|
|
procedure actCancelarExecute(Sender: TObject);
|
|
procedure JvSettingsTreeView1Changing(Sender: TObject; Node: TTreeNode;
|
|
var AllowChange: Boolean);
|
|
private
|
|
FPaginaActual : IConfiguracionFrame;
|
|
end;
|
|
|
|
var
|
|
fConfiguracion: TfConfiguracion;
|
|
|
|
implementation
|
|
|
|
uses uDataModuleServer;
|
|
|
|
{$R *.dfm}
|
|
|
|
type
|
|
TFrameClass = class of TFrameConfiguracion;
|
|
|
|
function CreateFrame(Parent: TWinControl; FrameClass: TFrameClass): IConfiguracionFrame;
|
|
var
|
|
aFrame : TFrameConfiguracion;
|
|
begin
|
|
aFrame := FrameClass.Create(NIL);
|
|
aFrame.Name:='Frame'+IntToStr(Random(10000));
|
|
aFrame.Parent := Parent;
|
|
aFrame.Init;
|
|
aFrame.Show;
|
|
Result := aFrame;
|
|
end;
|
|
|
|
procedure TfConfiguracion.tvArbolChange(Sender: TObject; Node: TTreeNode);
|
|
begin
|
|
{ if Assigned(FPaginaActual) then
|
|
FPaginaActual.Finalize;
|
|
|
|
case Node.Index of
|
|
0 : FPaginaActual := CreateFrame(pnlPagina, TfrConfGeneral);
|
|
1 : FPaginaActual := CreateFrame(pnlPagina, TfrConexionBD);
|
|
2 : FPaginaActual := CreateFrame(pnlPagina, TfrConfFicherosEDI);
|
|
end;
|
|
Self.Update;
|
|
pnlHeader.LabelCaption := Node.Text;}
|
|
end;
|
|
|
|
procedure TfConfiguracion.actAceptarExecute(Sender: TObject);
|
|
begin
|
|
if Assigned(FPaginaActual) then
|
|
FPaginaActual.Finalize;
|
|
dmServer.SalvarConfiguracion;
|
|
Close;
|
|
end;
|
|
|
|
procedure TfConfiguracion.actCancelarExecute(Sender: TObject);
|
|
begin
|
|
Close;
|
|
end;
|
|
|
|
procedure TfConfiguracion.JvSettingsTreeView1Changing(Sender: TObject;
|
|
Node: TTreeNode; var AllowChange: Boolean);
|
|
begin
|
|
if Assigned(FPaginaActual) then
|
|
FPaginaActual.Finalize;
|
|
|
|
case Node.Index of
|
|
0 : FPaginaActual := frConfGeneral1;
|
|
1 : FPaginaActual := frConexionBD1;
|
|
2 : FPaginaActual := frConfFicherosEDI1;
|
|
end;
|
|
if Assigned(FPaginaActual) then
|
|
FPaginaActual.Init;
|
|
end;
|
|
|
|
end.
|