implemented FormStyle fsSplash for splash screens

git-svn-id: trunk@5762 -
This commit is contained in:
mattias 2004-08-09 21:12:43 +00:00
parent dbc4e7b929
commit fe6fe05521
6 changed files with 53 additions and 14 deletions

View File

@ -200,7 +200,7 @@ type
TCaption = String;
TCursor = -32768..32767;
TFormStyle = (fsNormal, fsMDIChild, fsMDIFORM, fsStayOnTop);
TFormStyle = (fsNormal, fsMDIChild, fsMDIFORM, fsStayOnTop, fsSplash);
TFormBorderStyle = (bsNone, bsSingle, bsSizeable, bsDialog, bsToolWindow,
bsSizeToolWin);
TBorderStyle = bsNone..bsSingle;
@ -217,6 +217,8 @@ type
TMouseButton = (mbLeft, mbRight, mbMiddle);
const
fsAllStayOnTop = [fsStayOnTop, fsSplash];
// Cursor constants
crHigh = TCursor(0);
@ -2388,6 +2390,9 @@ end.
{ =============================================================================
$Log$
Revision 1.233 2004/08/09 21:12:42 mattias
implemented FormStyle fsSplash for splash screens
Revision 1.232 2004/08/05 21:20:47 mattias
moved designer/abstractformeditor.pp to ideintf/formeditingintf.pas

View File

@ -791,7 +791,7 @@ type
FHintTimerType: TAppHintTimerType;
FHintWindow: THintWindow;
FIcon: TIcon;
FList: TList;
FFormList: TList;
FMainForm : TForm;
FMouseControl: TControl;
FOldExceptProc: TExceptProc;

View File

@ -83,7 +83,7 @@ begin
FHintShortPause := DefHintShortPause;
FHintHidePause := DefHintHidePause;
FShowHint := true;
FList := nil;
FFormList := nil;
FOnIdle := nil;
FIcon := nil;
ApplicationActionComponent:=Self;
@ -106,7 +106,7 @@ begin
// destroying
ApplicationActionComponent:=nil;
FreeThenNil(FIcon);
FreeThenNil(FList);
FreeThenNil(FFormList);
for HandlerType:=Low(TApplicationHandlerType) to High(TApplicationHandlerType)
do
@ -652,16 +652,27 @@ begin
end;
{------------------------------------------------------------------------------
procedure TApplication.DoIdleActions;
------------------------------------------------------------------------------}
procedure TApplication.DoIdleActions;
var
i: Integer;
CurForm: TCustomForm;
AForm: TForm;
begin
for i := 0 to Screen.CustomFormCount - 1 do begin
CurForm:=Screen.CustomForms[I];
if CurForm.HandleAllocated and CurForm.Visible and CurForm.Enabled then
CurForm.UpdateActions;
end;
if FFormList<>nil then begin
for i:=0 to FFormList.Count-1 do begin
AForm:=TForm(FFormList[i]);
if AForm.FormStyle=fsSplash then
AForm.Hide;
end;
end;
end;
{------------------------------------------------------------------------------
@ -812,7 +823,7 @@ begin
if (Screen=nil) then exit;
for i:=0 to Screen.CustomFormCount-1 do begin
AForm:=Screen.CustomForms[i];
if AForm.FormStyle=fsStayOnTop then begin
if AForm.FormStyle in fsAllStayOnTop then begin
DebugLn('TApplication.HideAllFormsWithStayOnTop ',AForm.Name,':',AForm.ClassName);
AForm.Hide;
end;
@ -1123,6 +1134,7 @@ var
Instance: TComponent;
ok: boolean;
OldFindGlobalComponent: TFindGlobalComponent;
AForm: TForm;
begin
// Allocate the instance, without calling the constructor
Instance := TComponent(InstanceClass.NewInstance);
@ -1143,13 +1155,20 @@ begin
end;
if (Instance is TForm) then begin
if (FMainForm = nil) then begin
TForm(Instance).HandleNeeded;
FMainForm := TForm(Instance);
AForm:=TForm(Instance);
if (FMainForm = nil) and (AForm.FormStyle=fsNormal) then begin
AForm.HandleNeeded;
FMainForm := AForm;
end else begin
if not Assigned(FList) then
FList := TList.Create;
FList.Add(TForm(Instance));
if not Assigned(FFormList) then
FFormList := TList.Create;
FFormList.Add(AForm);
end;
if AForm.FormStyle=fsSplash then begin
// show the splash form and handle the paint message
AForm.Show;
AForm.Paint;
ProcessMessages;
end;
end;
{$IFNDEF AfterConstructionDataModuleNotWorking}
@ -1186,6 +1205,9 @@ end;
{ =============================================================================
$Log$
Revision 1.84 2004/08/09 21:12:43 mattias
implemented FormStyle fsSplash for splash screens
Revision 1.83 2004/08/04 10:35:38 mattias
added workaround for not working TDataModule.AfterConstruction

View File

@ -1118,6 +1118,9 @@ Begin
//TODO: Finish SETFORMSTYLE
FFormStyle := Value;
Include(FFormState,fsFormStyleChanged);
if FFormStyle=fsSplash then begin
BorderStyle:=bsNone;
end;
end;
{------------------------------------------------------------------------------}
@ -1723,6 +1726,9 @@ end;
{ =============================================================================
$Log$
Revision 1.148 2004/08/09 21:12:43 mattias
implemented FormStyle fsSplash for splash screens
Revision 1.147 2004/08/08 20:51:15 mattias
replaced TDBEdit.WMKillFocus by EditingDone, Change Class basically working

View File

@ -5910,7 +5910,7 @@ begin
else
ABorderStyle:=ACustomForm.BorderStyle;
WindowType:=FormStyleMap[ABorderStyle];
if (ABorderStyle=bsNone) and (ACustomForm.FormStyle=fsStayOnTop)
if (ABorderStyle=bsNone) and (ACustomForm.FormStyle in fsAllStayOnTop)
and (not (csDesigning in ACustomForm.ComponentState)) then begin
WindowType:=GTK_WINDOW_POPUP;
end;
@ -6883,7 +6883,7 @@ begin
if (ACustomForm<>nil) then begin
If (ACustomForm.BorderStyle <> bsSizeable) or
((ACustomForm.FormStyle = fsStayOnTop)
((ACustomForm.FormStyle in fsAllStayOnTop)
and (not (csDesigning in ACustomForm.ComponentState)))
then begin
Decor := GetWindowDecorations(ACustomForm);
@ -9215,6 +9215,9 @@ end;
{ =============================================================================
$Log$
Revision 1.520 2004/08/09 21:12:43 mattias
implemented FormStyle fsSplash for splash screens
Revision 1.519 2004/08/09 18:22:08 mattias
fixed type of Low(open array) and type of PathDelim

View File

@ -2310,7 +2310,7 @@ Begin
Assert(False, 'Trace:CreateComponent - Creating a Form Window');
Flags := BorderStyleToWin32Flags(TCustomForm(Sender).BorderStyle);
FlagsEx := BorderStyleToWin32FlagsEx(TCustomForm(Sender).BorderStyle);
if (TCustomForm(Sender).FormStyle = fsStayOnTop)
if (TCustomForm(Sender).FormStyle in fsAllStayOnTop)
and (not (csDesigning in TCustomForm(Sender).ComponentState)) then
FlagsEx := FlagsEx or WS_EX_TOPMOST;
pClassName := @ClsName;
@ -3383,6 +3383,9 @@ End;
{
$Log$
Revision 1.225 2004/08/09 21:12:43 mattias
implemented FormStyle fsSplash for splash screens
Revision 1.224 2004/07/27 00:07:48 marc
* Fixed disabled state of bitbtns