unit uServerMainForm;

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
  TfServerForm = 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
  fServerForm : TfServerForm;

implementation

uses
  uDataModuleServer, uConfiguracion, uAcercaDe;

{$R *.dfm}

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

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

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

procedure TfServerForm.FormCreate(Sender: TObject);
begin
  JvTrayIcon.HideApplication;
  JvTrayIcon.Active := True;
end;

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

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

end.
