diff --git a/.gitattributes b/.gitattributes index b6fed8ef33..f94445baec 100644 --- a/.gitattributes +++ b/.gitattributes @@ -658,11 +658,6 @@ components/paradox/lazparadox.pas svneol=native#text/plain components/paradox/regparadox.lrs svneol=native#text/plain components/paradox/regparadox.pp svneol=native#text/plain components/paradox/tparadox.png -text svneol=unset#image/png -components/popupnotifier/demo/popupnotifierdemo.lpi svneol=native#text/plain -components/popupnotifier/demo/popupnotifierdemo.lpr svneol=native#text/plain -components/popupnotifier/demo/unit1.lfm svneol=native#text/plain -components/popupnotifier/demo/unit1.lrs svneol=native#text/plain -components/popupnotifier/demo/unit1.pas svneol=native#text/plain components/prettyformat/languages/pfidesource.de.po svneol=native#text/plain components/prettyformat/languages/pfidesource.fr.po svneol=native#text/plain components/prettyformat/languages/pfidesource.id.po svneol=native#text/plain @@ -1778,6 +1773,11 @@ examples/openglcontrol/data/texture3.bmp -text svneol=unset#image/bmp examples/openglcontrol/exampleform.pp svneol=native#text/pascal examples/openglcontrol/openglcontrol_demo.lpi svneol=native#text/plain examples/openglcontrol/openglcontrol_demo.pas svneol=native#text/pascal +examples/popupnotifier/popupnotifierdemo.lpi svneol=native#text/plain +examples/popupnotifier/popupnotifierdemo.lpr svneol=native#text/plain +examples/popupnotifier/unit1.lfm svneol=native#text/plain +examples/popupnotifier/unit1.lrs svneol=native#text/plain +examples/popupnotifier/unit1.pas svneol=native#text/plain examples/postscript/samplepostscriptcanvas.lpi svneol=native#text/plain examples/postscript/samplepostscriptcanvas.lpr svneol=native#text/pascal examples/postscript/usamplepostscriptcanvas.lfm svneol=native#text/plain diff --git a/.gitignore b/.gitignore index b1da41bd42..e3633960a2 100644 --- a/.gitignore +++ b/.gitignore @@ -76,10 +76,6 @@ components/opengl/*.bak components/opengl/example/*.bak components/opengl/example/units components/opengl/units -components/popupnotifier/*.bak -components/popupnotifier/demo/*.bak -components/popupnotifier/demo/units -components/popupnotifier/units components/prettyformat/*.bak components/prettyformat/languages/*.bak components/prettyformat/languages/units diff --git a/components/popupnotifier/demo/popupnotifierdemo.lpi b/examples/popupnotifier/popupnotifierdemo.lpi similarity index 77% rename from components/popupnotifier/demo/popupnotifierdemo.lpi rename to examples/popupnotifier/popupnotifierdemo.lpi index 0bc25c2b50..579d0b617f 100644 --- a/components/popupnotifier/demo/popupnotifierdemo.lpi +++ b/examples/popupnotifier/popupnotifierdemo.lpi @@ -1,17 +1,18 @@ - - + + - + </General> <PublishOptions> <Version Value="2"/> + <DestinationDirectory Value="$(TestDir)\publishedproject\"/> <IgnoreBinaries Value="False"/> <IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/> <ExcludeFileFilter Value="*.(bak|ppu|ppw|o|so);*~;backup"/> @@ -19,17 +20,13 @@ <RunParams> <local> <FormatVersion Value="1"/> - <LaunchingApplication PathPlusParams="/usr/X11R6/bin/xterm -T 'Lazarus Run Output' -e $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)"/> + <LaunchingApplication PathPlusParams="\usr\X11R6\bin\xterm -T 'Lazarus Run Output' -e $(LazarusDir)\tools\runwait.sh $(TargetCmdLine)"/> </local> </RunParams> - <RequiredPackages Count="2"> + <RequiredPackages Count="1"> <Item1> - <PackageName Value="popupnotifierlaz"/> - <MinVersion Minor="1" Release="1" Valid="True"/> - </Item1> - <Item2> <PackageName Value="LCL"/> - </Item2> + </Item1> </RequiredPackages> <Units Count="2"> <Unit0> @@ -48,11 +45,12 @@ </ProjectOptions> <CompilerOptions> <Version Value="5"/> + <PathDelim Value="\"/> <Target> <Filename Value="PopupNotifierDemo"/> </Target> <SearchPaths> - <SrcPath Value="$(LazarusDir)/lcl/;$(LazarusDir)/lcl/interfaces/$(LCLWidgetType)/"/> + <SrcPath Value="$(LazarusDir)\lcl\;$(LazarusDir)\lcl\interfaces\$(LCLWidgetType)\"/> </SearchPaths> <CodeGeneration> <Generate Value="Faster"/> diff --git a/components/popupnotifier/demo/popupnotifierdemo.lpr b/examples/popupnotifier/popupnotifierdemo.lpr similarity index 85% rename from components/popupnotifier/demo/popupnotifierdemo.lpr rename to examples/popupnotifier/popupnotifierdemo.lpr index 27258b55ab..214773e209 100644 --- a/components/popupnotifier/demo/popupnotifierdemo.lpr +++ b/examples/popupnotifier/popupnotifierdemo.lpr @@ -8,7 +8,7 @@ uses {$ENDIF}{$ENDIF} Interfaces, // this includes the LCL widgetset Forms - { add your units here }, unit1, popupnotifierlaz; + { add your units here }, unit1; begin Application.Title:='PopupNotifierDemo'; diff --git a/components/popupnotifier/demo/unit1.lfm b/examples/popupnotifier/unit1.lfm similarity index 100% rename from components/popupnotifier/demo/unit1.lfm rename to examples/popupnotifier/unit1.lfm diff --git a/components/popupnotifier/demo/unit1.lrs b/examples/popupnotifier/unit1.lrs similarity index 100% rename from components/popupnotifier/demo/unit1.lrs rename to examples/popupnotifier/unit1.lrs diff --git a/components/popupnotifier/demo/unit1.pas b/examples/popupnotifier/unit1.pas similarity index 100% rename from components/popupnotifier/demo/unit1.pas rename to examples/popupnotifier/unit1.pas diff --git a/lcl/interfaces/win32/win32trayicon.inc b/lcl/interfaces/win32/win32trayicon.inc index 81dec9a1e1..21812749bc 100644 --- a/lcl/interfaces/win32/win32trayicon.inc +++ b/lcl/interfaces/win32/win32trayicon.inc @@ -211,9 +211,22 @@ end; * DESCRIPTION: Shows a small message balloon near the tray icon * *******************************************************************} -class procedure TWin32WSCustomTrayIcon.ShowBalloonHint(const ATrayIcon: TCustomTrayIcon); +class function TWin32WSCustomTrayIcon.ShowBalloonHint( + const ATrayIcon: TCustomTrayIcon): Boolean; +{var + NotifyData: TNotifyIconDataEx:} begin + Result := True; +{ NotifyData.szInfo : array[0..255] of CHAR; + DUMMYUNIONNAME : record + case longint of + 0 : ( uTimeout : UINT ); + 1 : ( uVersion : UINT ); + end; + szInfoTitle : array[0..63] of CHAR; + dwInfoFlags : DWORD; + Shell_NotifyIconA():} end; {******************************************************************* @@ -225,7 +238,42 @@ end; * *******************************************************************} class function TWin32WSCustomTrayIcon.GetPosition(const ATrayIcon: TCustomTrayIcon): TPoint; +var + hWndTray : HWND; + TrayRect: TRect; begin Result := Point(0, 0); + + hWndTray := FindWindow('Shell_TrayWnd', nil); + + if hWndTray = 0 then Exit; + +{ Here we could also try to find the position of the toolbar + +var + s : string; + l : integer; +begin + SetLength(s, 255); + l := GetClassName(handle, PChar(s), Length(s)); + + if l = 0 then Exit(False); + + SetLength(s, l); + + if Pos('ToolbarWindow32', s) > 0 then + begin + lp := handle; + result := false; + end + else + result := true; +end; +} + + Windows.GetWindowRect(hWndTray, @TrayRect); + + Result.X := TrayRect.Left; + Result.Y := TrayRect.Top; end; diff --git a/lcl/interfaces/win32/win32wsextctrls.pp b/lcl/interfaces/win32/win32wsextctrls.pp index a3d258ef3f..d89bf232e5 100644 --- a/lcl/interfaces/win32/win32wsextctrls.pp +++ b/lcl/interfaces/win32/win32wsextctrls.pp @@ -32,7 +32,8 @@ uses // To get as little as posible circles, // uncomment only when needed for registration //////////////////////////////////////////////////// - SysUtils, Windows, ExtCtrls, Classes, Controls, ImgList, LCLType, LCLIntf, Themes, + SysUtils, Windows, ExtCtrls, Classes, Controls, ImgList, LCLType, LCLIntf, + Themes, //////////////////////////////////////////////////// WSControls, WSExtCtrls, WSLCLClasses, WSProc, Win32Extra, Win32Int, Win32Proc, InterfaceBase, Win32WSControls; @@ -224,7 +225,7 @@ type class function Hide(const ATrayIcon: TCustomTrayIcon): Boolean; override; class function Show(const ATrayIcon: TCustomTrayIcon): Boolean; override; class procedure InternalUpdate(const ATrayIcon: TCustomTrayIcon); override; - class procedure ShowBalloonHint(const ATrayIcon: TCustomTrayIcon); override; + class function ShowBalloonHint(const ATrayIcon: TCustomTrayIcon): Boolean; override; class function GetPosition(const ATrayIcon: TCustomTrayIcon): TPoint; override; end;