implement ShowInTaskBar for win32 intf

git-svn-id: trunk@7022 -
This commit is contained in:
micha 2005-03-25 08:58:11 +00:00
parent 3a4f950d51
commit ab2ceb0d19
5 changed files with 36 additions and 7 deletions

View File

@ -1487,7 +1487,6 @@ type
procedure CreateHandle; virtual;
procedure CreateParams(var Params: TCreateParams); virtual;
procedure CreateWnd; virtual; //creates the window
procedure DestroyHandle; virtual;
procedure DestroyWnd; virtual;
procedure DoFlipChildren; dynamic;
procedure FixupTabList;
@ -1578,6 +1577,8 @@ type
constructor CreateParented(ParentWindow: HWnd);
class function CreateParentedControl(ParentWindow: HWnd): TWinControl;
destructor Destroy; override;
{ TODO: DestroyHandle needed by win32 intf }
procedure DestroyHandle; virtual;
procedure DockDrop(DockObject: TDragDockObject; X, Y: Integer); dynamic;
Function CanFocus: Boolean;
function GetControlIndex(AControl: TControl): integer;
@ -2890,6 +2891,9 @@ end.
{ =============================================================================
$Log$
Revision 1.289 2005/03/25 08:58:11 micha
implement ShowInTaskBar for win32 intf
Revision 1.288 2005/03/11 14:40:37 mattias
moved CM_ message constants from crontrols.pp to lmessages.pp to break circles and clean up controls.pp

View File

@ -413,6 +413,8 @@ 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 SetBorderIcons(NewIcons: TBorderIcons);
@ -555,7 +557,7 @@ type
property RestoredWidth: integer read FRestoredWidth;
property RestoredHeight: integer read FRestoredHeight;
property ShowInTaskBar: Boolean read FShowInTaskbar write SetShowInTaskBar
default True;
stored IsShowInTaskBarStored;
property TextHeight: Longint read FDummyTextHeight write FDummyTextHeight
stored False;
property Visible write SetVisible stored VisibleIsStored default false;

View File

@ -1406,8 +1406,8 @@ begin
if (Instance is TForm) then begin
AForm:=TForm(Instance);
if (FMainForm = nil) and (AForm.FormStyle=fsNormal) then begin
AForm.HandleNeeded;
FMainForm := AForm;
AForm.HandleNeeded;
end else begin
if not Assigned(FFormList) then
FFormList := TList.Create;
@ -1464,6 +1464,9 @@ end;
{ =============================================================================
$Log$
Revision 1.111 2005/03/25 08:58:11 micha
implement ShowInTaskBar for win32 intf
Revision 1.110 2005/03/10 09:02:11 mattias
handle tab key in ControlKeyDown in TCustomEdit and TCustomComboBox

View File

@ -208,6 +208,16 @@ 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 = Self);
end;
procedure TCustomForm.SetCancelControl(NewControl: TControl);
var
OldCancelControl: TControl;
@ -1188,8 +1198,8 @@ end;
procedure TCustomForm.SetShowInTaskbar(Value: Boolean);
begin
if Value = FShowInTaskbar then exit;
TWSCustomFormClass(WidgetSetClass).SetShowInTaskbar(Self, Value);
FShowInTaskbar := Value;
TWSCustomFormClass(WidgetSetClass).SetShowInTaskbar(Self, Value);
end;
{------------------------------------------------------------------------------
@ -1198,7 +1208,7 @@ end;
constructor TCustomForm.Create(AOwner : TComponent);
begin
//DebugLn('[TCustomForm.Create] A Class=',Classname);
FShowInTaskbar := True;
FShowInTaskbar := GetShowInTaskBarDefault;
BeginFormUpdate;
try
CreateNew(AOwner, 1);
@ -1905,6 +1915,9 @@ end;
{ =============================================================================
$Log$
Revision 1.181 2005/03/25 08:58:11 micha
implement ShowInTaskBar for win32 intf
Revision 1.180 2005/03/19 23:36:26 mattias
implemented TCustomForm.ShowInTaskBar for gtk1+2 from Andrew Haines

View File

@ -36,7 +36,7 @@ uses
Forms, Controls, LCLType, Classes,
////////////////////////////////////////////////////
WSForms, WSLCLClasses, Windows, SysUtils, WinExt,
Win32Int, Win32Proc, Win32WSControls;
InterfaceBase, Win32Int, Win32Proc, Win32WSControls;
type
@ -249,6 +249,9 @@ begin
Width := LongInt(CW_USEDEFAULT);
Height := LongInt(CW_USEDEFAULT);
SubClassWndProc := nil;
if ((Application = nil) or (Application.MainForm <> lForm))
and lForm.ShowInTaskBar then
Parent := 0;
end;
// create window
FinishCreateWindow(AWinControl, Params, false);
@ -321,7 +324,11 @@ end;
procedure TWin32WSCustomForm.SetShowInTaskbar(const AForm: TCustomForm;
const AValue: Boolean);
begin
{$Warning TODO: TWin32WSCustomForm.SetShowInTaskbar}
if (Application <> nil) and (AForm = Application.MainForm) then
exit;
AForm.DestroyHandle;
AForm.HandleNeeded;
end;
procedure TWin32WSCustomForm.ShowModal(const ACustomForm: TCustomForm);