unit fServerForm;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls,
  uROClient, uROPoweredByRemObjectsButton, uROClientIntf, uROServer,
  uROBinMessage, uROIndyHTTPServer, uROIndyTCPServer, frxClass, frxPreview,
  JvComponent, JvTrayIcon, ActnList, Menus, XPMan, JvExControls,
  JvGradient, JvGIF, ExtCtrls, JvComponentBase;

type
  TServerForm = class(TForm)
    Memo1: TMemo;
    PopupMenu1: TPopupMenu;
    ActionList: TActionList;
    actCerrar: TAction;
    Cerrar1: TMenuItem;
    actRestart: TAction;
    actOpciones: TAction;
    actConexiones: TAction;
    Opciones1: TMenuItem;
    Refrescarconexin1: TMenuItem;
    N2: TMenuItem;
    XPManifest1: TXPManifest;
    JvTrayIcon: TJvTrayIcon;
    Panel1: TPanel;
    Image1: TImage;
    JvGradient1: TJvGradient;
    Button1: TButton;
    actAcerca: TAction;
    Acercade1: TMenuItem;
    N1: TMenuItem;
    procedure actCerrarExecute(Sender: TObject);
    procedure actRestartExecute(Sender: TObject);
    procedure actOpcionesExecute(Sender: TObject);
    procedure FormCreate(Sender: TObject);
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
    procedure actAcercaExecute(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  ServerForm: TServerForm;

implementation

uses
  uDataModuleServer, uConfiguracion, EDI_SLSRPT, uAcercaDe;


{$R *.dfm}

procedure TServerForm.actCerrarExecute(Sender: TObject);
begin
  Close;
end;

procedure TServerForm.actRestartExecute(Sender: TObject);
begin
  dmServer.RefrescarConexion;
end;

procedure TServerForm.actOpcionesExecute(Sender: TObject);
var
  AForm : TForm;
begin
  AForm := TfConfiguracion.Create(NIL);
  try
    AForm.ShowModal;
  finally
    AForm.Free;
    actRestart.Execute;
  end;
end;

procedure TServerForm.FormCreate(Sender: TObject);
begin
  JvTrayIcon.HideApplication;
  JvTrayIcon.Hint := 'Administración de puntos de venta (Servidor)' +
    #10#13 + dmServer.ConnectionName;
  JvTrayIcon.Active := True;
end;

procedure TServerForm.FormClose(Sender: TObject; var Action: TCloseAction);
begin
  JvTrayIcon.Active := False;
end;

procedure TServerForm.actAcercaExecute(Sender: TObject);
begin
  with TfAcercaDe.Create(NIL) do
    try
      ShowModal;
    finally
      Free;
    end;
end;

end.
