mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-19 00:19:26 +02:00
implemented TCustomForm.ShowInTaskBar for gtk1+2 from Andrew Haines
git-svn-id: trunk@6995 -
This commit is contained in:
parent
3e4b7bdaed
commit
5ec0ba3595
@ -402,6 +402,7 @@ type
|
|||||||
FRestoredTop: integer;
|
FRestoredTop: integer;
|
||||||
FRestoredWidth: integer;
|
FRestoredWidth: integer;
|
||||||
FRestoredHeight: integer;
|
FRestoredHeight: integer;
|
||||||
|
FShowInTaskbar: Boolean;
|
||||||
FWindowState: TWindowState;
|
FWindowState: TWindowState;
|
||||||
function IsForm : Boolean;
|
function IsForm : Boolean;
|
||||||
function IsHelpFileStored: boolean;
|
function IsHelpFileStored: boolean;
|
||||||
@ -424,6 +425,7 @@ type
|
|||||||
procedure SetMenu(Value : TMainMenu);
|
procedure SetMenu(Value : TMainMenu);
|
||||||
procedure SetModalResult(const AValue: TModalResult);
|
procedure SetModalResult(const AValue: TModalResult);
|
||||||
procedure SetPosition(Value : TPosition);
|
procedure SetPosition(Value : TPosition);
|
||||||
|
procedure SetShowInTaskbar(Value: Boolean);
|
||||||
procedure SetVisible(Value: boolean);
|
procedure SetVisible(Value: boolean);
|
||||||
procedure SetWindowFocus;
|
procedure SetWindowFocus;
|
||||||
procedure SetWindowState(Value : TWIndowState);
|
procedure SetWindowState(Value : TWIndowState);
|
||||||
@ -552,6 +554,8 @@ type
|
|||||||
property RestoredTop: integer read FRestoredTop;
|
property RestoredTop: integer read FRestoredTop;
|
||||||
property RestoredWidth: integer read FRestoredWidth;
|
property RestoredWidth: integer read FRestoredWidth;
|
||||||
property RestoredHeight: integer read FRestoredHeight;
|
property RestoredHeight: integer read FRestoredHeight;
|
||||||
|
property ShowInTaskBar: Boolean read FShowInTaskbar write SetShowInTaskBar
|
||||||
|
default True;
|
||||||
property TextHeight: Longint read FDummyTextHeight write FDummyTextHeight
|
property TextHeight: Longint read FDummyTextHeight write FDummyTextHeight
|
||||||
stored False;
|
stored False;
|
||||||
property Visible write SetVisible stored VisibleIsStored default false;
|
property Visible write SetVisible stored VisibleIsStored default false;
|
||||||
@ -619,6 +623,7 @@ type
|
|||||||
property Position;
|
property Position;
|
||||||
property SessionProperties;
|
property SessionProperties;
|
||||||
property ShowHint;
|
property ShowHint;
|
||||||
|
property ShowInTaskBar;
|
||||||
property TextHeight;
|
property TextHeight;
|
||||||
property UseDockManager;
|
property UseDockManager;
|
||||||
property Visible;
|
property Visible;
|
||||||
|
@ -1185,12 +1185,20 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TCustomForm.SetShowInTaskbar(Value: Boolean);
|
||||||
|
begin
|
||||||
|
if Value = FShowInTaskbar then exit;
|
||||||
|
TWSCustomFormClass(WidgetSetClass).SetShowInTaskbar(Self, Value);
|
||||||
|
FShowInTaskbar := Value;
|
||||||
|
end;
|
||||||
|
|
||||||
{------------------------------------------------------------------------------
|
{------------------------------------------------------------------------------
|
||||||
TCustomForm Constructor
|
TCustomForm Constructor
|
||||||
------------------------------------------------------------------------------}
|
------------------------------------------------------------------------------}
|
||||||
constructor TCustomForm.Create(AOwner : TComponent);
|
constructor TCustomForm.Create(AOwner : TComponent);
|
||||||
begin
|
begin
|
||||||
//DebugLn('[TCustomForm.Create] A Class=',Classname);
|
//DebugLn('[TCustomForm.Create] A Class=',Classname);
|
||||||
|
FShowInTaskbar := True;
|
||||||
BeginFormUpdate;
|
BeginFormUpdate;
|
||||||
try
|
try
|
||||||
CreateNew(AOwner, 1);
|
CreateNew(AOwner, 1);
|
||||||
@ -1897,6 +1905,9 @@ end;
|
|||||||
{ =============================================================================
|
{ =============================================================================
|
||||||
|
|
||||||
$Log$
|
$Log$
|
||||||
|
Revision 1.180 2005/03/19 23:36:26 mattias
|
||||||
|
implemented TCustomForm.ShowInTaskBar for gtk1+2 from Andrew Haines
|
||||||
|
|
||||||
Revision 1.179 2005/03/07 21:59:44 vincents
|
Revision 1.179 2005/03/07 21:59:44 vincents
|
||||||
changed hexstr(cardinal()) for pointers to dbgs() and other 64-bits fixes from Peter Vreman
|
changed hexstr(cardinal()) for pointers to dbgs() and other 64-bits fixes from Peter Vreman
|
||||||
|
|
||||||
|
@ -73,6 +73,7 @@ const
|
|||||||
procedure GDK_WINDOW_ACTIVATE(Window: PGdkWindowPrivate);
|
procedure GDK_WINDOW_ACTIVATE(Window: PGdkWindowPrivate);
|
||||||
procedure GDK_WINDOW_MAXIMIZE(Window: PGdkWindowPrivate);
|
procedure GDK_WINDOW_MAXIMIZE(Window: PGdkWindowPrivate);
|
||||||
procedure GDK_WINDOW_MINIMIZE(Window: PGdkWindowPrivate);
|
procedure GDK_WINDOW_MINIMIZE(Window: PGdkWindowPrivate);
|
||||||
|
procedure GDK_WINDOW_SHOW_IN_TASKBAR(Window: PGdkWindowPrivate; Show: Boolean);
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
|
|
||||||
|
|
||||||
@ -1262,6 +1263,36 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
procedure GDK_WINDOW_SHOW_IN_TASKBAR(Window: PGdkWindowPrivate; Show: Boolean);
|
||||||
|
var
|
||||||
|
XDisplay: PDisplay;
|
||||||
|
XScreen: PScreen;
|
||||||
|
XRootWindow,
|
||||||
|
XWindow: TWindow;
|
||||||
|
XEvent: TXClientMessageEvent;
|
||||||
|
_NET_WM_STATE,
|
||||||
|
_NET_WM_STATE_SKIP_TASKBAR: clong;
|
||||||
|
|
||||||
|
begin
|
||||||
|
XDisplay := GDK_WINDOW_XDISPLAY (Window);
|
||||||
|
XScreen := XDefaultScreenOfDisplay(xdisplay);
|
||||||
|
XRootWindow := XRootWindowOfScreen(xscreen);
|
||||||
|
XWindow := GDK_WINDOW_XWINDOW (Window);
|
||||||
|
|
||||||
|
_NET_WM_STATE := XInternAtom(xdisplay, '_NET_WM_STATE', false);
|
||||||
|
_NET_WM_STATE_SKIP_TASKBAR := XInternAtom(xdisplay, '_NET_WM_STATE_SKIP_TASKBAR', false);
|
||||||
|
|
||||||
|
XEvent._type := ClientMessage;
|
||||||
|
XEvent.window := XWindow;
|
||||||
|
XEvent.message_type := _NET_WM_STATE;
|
||||||
|
XEvent.format := 32;
|
||||||
|
XEvent.data.l[0] := Ord(not(Show)); // 0=Remove 1=Add 2=Toggle
|
||||||
|
XEvent.data.l[1] := _NET_WM_STATE_SKIP_TASKBAR;
|
||||||
|
|
||||||
|
XSendEvent(XDisplay, XRootWindow, False, SubstructureNotifyMask, @XEvent);
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
|
|
||||||
initialization
|
initialization
|
||||||
|
@ -78,6 +78,7 @@ type
|
|||||||
class procedure SetFormBorderStyle(const AForm: TCustomForm;
|
class procedure SetFormBorderStyle(const AForm: TCustomForm;
|
||||||
const AFormBorderStyle: TFormBorderStyle); override;
|
const AFormBorderStyle: TFormBorderStyle); override;
|
||||||
class procedure SetIcon(const AForm: TCustomForm; const AIcon: HICON); override;
|
class procedure SetIcon(const AForm: TCustomForm; const AIcon: HICON); override;
|
||||||
|
class procedure SetShowInTaskbar(const AForm: TCustomForm; const AValue: Boolean); override;
|
||||||
class procedure ShowModal(const ACustomForm: TCustomForm); override;
|
class procedure ShowModal(const ACustomForm: TCustomForm); override;
|
||||||
class procedure SetBorderIcons(const AForm: TCustomForm;
|
class procedure SetBorderIcons(const AForm: TCustomForm;
|
||||||
const ABorderIcons: TBorderIcons); override;
|
const ABorderIcons: TBorderIcons); override;
|
||||||
@ -157,6 +158,25 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TGtkWSCustomForm.SetShowInTaskbar(const AForm: TCustomForm;
|
||||||
|
const AValue: Boolean);
|
||||||
|
{$IFDEF GTK1}
|
||||||
|
var
|
||||||
|
AWindow: PGdkWindowPrivate;
|
||||||
|
{$ENDIF}
|
||||||
|
begin
|
||||||
|
if (AForm.Parent<>nil) or not(AForm.HandleAllocated) then exit;
|
||||||
|
|
||||||
|
{$IFDEF GTK1}
|
||||||
|
AWindow := PGdkWindowPrivate(PGtkWidget(AForm.Handle)^.window);
|
||||||
|
GDK_WINDOW_SHOW_IN_TASKBAR(AWindow,AValue);
|
||||||
|
{$ENDIF}
|
||||||
|
|
||||||
|
{$IFDEF GTK2}
|
||||||
|
gtk_window_set_skip_taskbar_hint(PGtkWindow(AForm.Handle), not AValue);
|
||||||
|
{$ENDIF}
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TGtkWSCustomForm.ShowModal(const ACustomForm: TCustomForm);
|
procedure TGtkWSCustomForm.ShowModal(const ACustomForm: TCustomForm);
|
||||||
var
|
var
|
||||||
GtkWindow: PGtkWindow;
|
GtkWindow: PGtkWindow;
|
||||||
|
@ -90,6 +90,7 @@ type
|
|||||||
class procedure SetBounds(const AWinControl: TWinControl; const ALeft, ATop,
|
class procedure SetBounds(const AWinControl: TWinControl; const ALeft, ATop,
|
||||||
AWidth, AHeight: Integer); override;
|
AWidth, AHeight: Integer); override;
|
||||||
class procedure SetIcon(const AForm: TCustomForm; const AIcon: HICON); override;
|
class procedure SetIcon(const AForm: TCustomForm; const AIcon: HICON); override;
|
||||||
|
class procedure SetShowInTaskbar(const AForm: TCustomForm; const AValue: Boolean); override;
|
||||||
class procedure ShowModal(const ACustomForm: TCustomForm); override;
|
class procedure ShowModal(const ACustomForm: TCustomForm); override;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -317,6 +318,12 @@ begin
|
|||||||
SendMessage(winHandle, WM_SETICON, ICON_BIG, iconHandle);
|
SendMessage(winHandle, WM_SETICON, ICON_BIG, iconHandle);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TWin32WSCustomForm.SetShowInTaskbar(const AForm: TCustomForm;
|
||||||
|
const AValue: Boolean);
|
||||||
|
begin
|
||||||
|
{$Warning TODO: TWin32WSCustomForm.SetShowInTaskbar}
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TWin32WSCustomForm.ShowModal(const ACustomForm: TCustomForm);
|
procedure TWin32WSCustomForm.ShowModal(const ACustomForm: TCustomForm);
|
||||||
var
|
var
|
||||||
DisableWindowsInfo: PDisableWindowsInfo;
|
DisableWindowsInfo: PDisableWindowsInfo;
|
||||||
|
@ -81,6 +81,7 @@ type
|
|||||||
class procedure SetFormBorderStyle(const AForm: TCustomForm;
|
class procedure SetFormBorderStyle(const AForm: TCustomForm;
|
||||||
const AFormBorderStyle: TFormBorderStyle); virtual;
|
const AFormBorderStyle: TFormBorderStyle); virtual;
|
||||||
class procedure SetIcon(const AForm: TCustomForm; const AIcon: HICON); virtual;
|
class procedure SetIcon(const AForm: TCustomForm; const AIcon: HICON); virtual;
|
||||||
|
class procedure SetShowInTaskbar(const AForm: TCustomForm; const AValue: Boolean); virtual;
|
||||||
class procedure ShowModal(const ACustomForm: TCustomForm); virtual;
|
class procedure ShowModal(const ACustomForm: TCustomForm); virtual;
|
||||||
end;
|
end;
|
||||||
TWSCustomFormClass = class of TWSCustomForm;
|
TWSCustomFormClass = class of TWSCustomForm;
|
||||||
@ -136,6 +137,11 @@ procedure TWSCustomForm.SetIcon(const AForm: TCustomForm; const AIcon: HICON);
|
|||||||
begin
|
begin
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TWSCustomForm.SetShowInTaskbar(const AForm: TCustomForm;
|
||||||
|
const AValue: Boolean);
|
||||||
|
begin
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TWSCustomForm.ShowModal(const ACustomForm: TCustomForm);
|
procedure TWSCustomForm.ShowModal(const ACustomForm: TCustomForm);
|
||||||
begin
|
begin
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user