add TShowInTaskbar enum to specify "default", which is default for what the widgetset wants

git-svn-id: trunk@8079 -
This commit is contained in:
micha 2005-11-06 19:35:22 +00:00
parent 1cc42929d8
commit 95cfbef747
4 changed files with 16 additions and 29 deletions

View File

@ -345,6 +345,8 @@ type
fhtCreate
);
TShowInTaskbar = (stDefault, stAlways, stNever);
{ TCustomForm }
TCustomForm = class(TScrollingWinControl)
@ -383,7 +385,7 @@ type
FRestoredTop: integer;
FRestoredWidth: integer;
FRestoredHeight: integer;
FShowInTaskbar: Boolean;
FShowInTaskbar: TShowInTaskbar;
FWindowState: TWindowState;
function IsForm : Boolean;
function IsHelpFileStored: boolean;
@ -394,8 +396,6 @@ type
procedure DoDestroy;
procedure IconChanged(Sender: TObject);
function IsKeyPreviewStored: boolean;
function IsShowInTaskBarStored: boolean;
function GetShowInTaskBarDefault: boolean;
procedure SetActive(AValue: Boolean);
procedure SetActiveControl(AWinControl: TWinControl);
procedure SetActiveDefaultControl(AControl: TControl);
@ -409,7 +409,7 @@ type
procedure SetMenu(Value : TMainMenu);
procedure SetModalResult(const AValue: TModalResult);
procedure SetPosition(Value : TPosition);
procedure SetShowInTaskbar(Value: Boolean);
procedure SetShowInTaskbar(Value: TShowInTaskbar);
procedure SetVisible(Value: boolean);
procedure SetWindowFocus;
procedure SetWindowState(Value : TWindowState);
@ -542,8 +542,8 @@ type
property RestoredTop: integer read FRestoredTop;
property RestoredWidth: integer read FRestoredWidth;
property RestoredHeight: integer read FRestoredHeight;
property ShowInTaskBar: Boolean read FShowInTaskbar write SetShowInTaskBar
stored IsShowInTaskBarStored;
property ShowInTaskBar: TShowInTaskbar read FShowInTaskbar write SetShowInTaskBar
default stDefault;
property TextHeight: Longint read FDummyTextHeight write FDummyTextHeight
stored False;
property Visible write SetVisible stored VisibleIsStored default false;

View File

@ -203,17 +203,6 @@ begin
Result:=FKeyPreview=true;
end;
function TCustomForm.IsShowInTaskBarStored: boolean;
begin
Result := FShowInTaskBar <> GetShowInTaskBarDefault;
end;
function TCustomForm.GetShowInTaskBarDefault: boolean;
begin
Result := (Application = nil) or (Application.MainForm=nil)
or (Application.MainForm = Self);
end;
procedure TCustomForm.SetCancelControl(NewControl: TControl);
var
OldCancelControl: TControl;
@ -697,9 +686,6 @@ end;
------------------------------------------------------------------------------}
procedure TCustomForm.DoShow;
begin
HandleNeeded;
TWSCustomFormClass(WidgetSetClass).SetShowInTaskbar(Self, FShowInTaskbar);
if Assigned(FOnShow) then FOnShow(Self);
end;
@ -1236,7 +1222,7 @@ begin
end;
end;
procedure TCustomForm.SetShowInTaskbar(Value: Boolean);
procedure TCustomForm.SetShowInTaskbar(Value: TShowInTaskbar);
begin
if Value = FShowInTaskbar then exit;
FShowInTaskbar := Value;
@ -1249,7 +1235,7 @@ end;
constructor TCustomForm.Create(AOwner : TComponent);
begin
//DebugLn('[TCustomForm.Create] A Class=',Classname);
FShowInTaskbar := GetShowInTaskBarDefault;
FShowInTaskbar := stDefault;
BeginFormUpdate;
try
@ -1588,9 +1574,10 @@ var
begin
Result := false;
if Assigned(FOnShortcut) then
begin
FOnShortcut(Message, Result);
if Result then
exit;
if Result then exit;
end;
if Assigned(FMenu) then
begin
Result := FMenu.IsShortCut(Message);

View File

@ -92,7 +92,7 @@ type
class procedure SetFormBorderStyle(const AForm: TCustomForm;
const AFormBorderStyle: TFormBorderStyle); override;
class procedure SetIcon(const AForm: TCustomForm; const AIcon: HICON); override;
class procedure SetShowInTaskbar(const AForm: TCustomForm; const AValue: Boolean); override;
class procedure SetShowInTaskbar(const AForm: TCustomForm; const AValue: TShowInTaskbar); override;
class procedure ShowModal(const ACustomForm: TCustomForm); override;
end;
@ -231,7 +231,7 @@ begin
Height := LongInt(CW_USEDEFAULT);
SubClassWndProc := nil;
if ((Application = nil) or (Application.MainForm <> lForm))
and lForm.ShowInTaskBar then
and (lForm.ShowInTaskBar = stAlways) then
Parent := 0;
end;
// create window
@ -301,7 +301,7 @@ begin
end;
procedure TWin32WSCustomForm.SetShowInTaskbar(const AForm: TCustomForm;
const AValue: Boolean);
const AValue: TShowInTaskbar);
begin
if not AForm.HandleAllocated then exit;
if (Application <> nil) and (AForm = Application.MainForm) then

View File

@ -81,7 +81,7 @@ type
class procedure SetFormBorderStyle(const AForm: TCustomForm;
const AFormBorderStyle: TFormBorderStyle); virtual;
class procedure SetIcon(const AForm: TCustomForm; const AIcon: HICON); virtual;
class procedure SetShowInTaskbar(const AForm: TCustomForm; const AValue: Boolean); virtual;
class procedure SetShowInTaskbar(const AForm: TCustomForm; const AValue: TShowInTaskbar); virtual;
class procedure SetZPosition(const AWinControl: TWinControl; const APosition: TWSZPosition); virtual;
class procedure ShowModal(const ACustomForm: TCustomForm); virtual;
end;
@ -139,7 +139,7 @@ begin
end;
procedure TWSCustomForm.SetShowInTaskbar(const AForm: TCustomForm;
const AValue: Boolean);
const AValue: TShowInTaskbar);
begin
end;