Componentes.Terceros.RemObj.../internal/5.0.23.613/1/RemObjects SDK for Delphi/Source/uRoPleaseWaitForm.pas
david 2824855ea7 - Modificación del paquete RemObjects_Core_D10 para que sea un paquete de runtime/designtime (antes era designtime sólo)
- Recompilación en Delphi10 de todos los paquetes de RO para generar las DCU's en Lib\D10
- Recompilación en Delphi10 de todos los paquetes de DA para generar las DCU's en Lib\D10

git-svn-id: https://192.168.0.254/svn/Componentes.Terceros.RemObjects@9 b6239004-a887-0f4b-9937-50029ccdca16
2007-09-10 14:06:19 +00:00

107 lines
3.2 KiB
ObjectPascal

unit uROPleaseWaitForm;
{----------------------------------------------------------------------------}
{ RemObjects SDK Library - Delphi IDE Integration }
{ }
{ compiler: Delphi 5 and up, Kylix 2 and up }
{ platform: Win32, Linux }
{ }
{ (c)opyright RemObjects Software. all rights reserved. }
{ }
{ Using this code requires a valid license of the RemObjects SDK }
{ which can be obtained at http://www.remobjects.com. }
{----------------------------------------------------------------------------}
{$I RemObjects.inc}
interface
uses
{$IFDEF MSWINDOWS}Windows,{$ELSE}Libc,{$ENDIF} Messages, SysUtils, Classes, Graphics, Controls, Forms,
{$IFDEF FPC} LResources, lmessages,{$ENDIF}
Dialogs, StdCtrls, ExtCtrls;
type
TPleaseWaitForm = class(TForm)
lbl_Caption: TLabel;
img_Logo: TImage;
procedure FormShow(Sender: TObject);
procedure FormHide(Sender: TObject);
private
fWindowList:pointer;
public
constructor Create(iOwner: TComponent; const iCaption:string=''; const iHeader:string=''; iBitmap:TBitmap=nil; iFreeBitmap:boolean=false); reintroduce;
procedure Show(const iCaption:string=''); reintroduce;
procedure Hide; reintroduce;
end;
var
PleaseWaitForm: TPleaseWaitForm;
implementation
{$IFNDEF FPC}
{$R *.dfm}
{$ENDIF}
{ TPleaseWaitForm }
constructor TPleaseWaitForm.Create(iOwner: TComponent; const iCaption:string=''; const iHeader:string=''; iBitmap:TBitmap=nil; iFreeBitmap:boolean=false);
begin
inherited Create(iOwner);
if iHeader <> '' then Caption := iHeader;
lbl_Caption.Caption := iCaption;
if Assigned(iBitmap) then begin
img_Logo.Picture.Assign(iBitmap);
if iFreeBitmap then iBitmap.Free();
end;
img_Logo.Top := (ClientHeight-img_Logo.Height) div 2;
img_Logo.Left := img_Logo.Top;
lbl_Caption.Left := img_Logo.Width+ (img_Logo.Left*2);
ClientWidth := lbl_Caption.Left+lbl_Caption.Width+img_Logo.Left;
end;
procedure TPleaseWaitForm.Show(const iCaption:string='');
begin
if iCaption <> '' then begin
lbl_Caption.Caption := iCaption;
ClientWidth := lbl_Caption.Left+lbl_Caption.Width+8;
end;
inherited Show();
Application.ProcessMessages();
end;
procedure TPleaseWaitForm.Hide;
begin
inherited Hide();
Application.ProcessMessages();
end;
procedure TPleaseWaitForm.FormShow(Sender: TObject);
begin
{$IFNDEF LINUX}
SendMessage(Handle, CM_ACTIVATE, 0, 0);
{$ENDIF}
{$IFNDEF FPC}
fWindowList := DisableTaskWindows(0);
{$ENDIF FPC}
end;
procedure TPleaseWaitForm.FormHide(Sender: TObject);
begin
{$IFNDEF LINUX}
SendMessage(Handle, CM_DEACTIVATE, 0, 0);
{$ENDIF}
{$IFNDEF FPC}
EnableTaskWindows(fWindowList);
{$ENDIF FPC}
end;
initialization
{$IFDEF FPC}
{$I uROPleaseWaitForm.lrs}
{$ENDIF}
end.