mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-07 06:38:06 +02:00
Fixes lcl compilation on win32, initial implementation for TWin32TrayIcon.GetPosition and moved popupnotifier example.
git-svn-id: trunk@14041 -
This commit is contained in:
parent
ac73b6de41
commit
2d2a1cb6ff
10
.gitattributes
vendored
10
.gitattributes
vendored
@ -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
|
||||
|
4
.gitignore
vendored
4
.gitignore
vendored
@ -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
|
||||
|
@ -1,17 +1,18 @@
|
||||
<?xml version="1.0"?>
|
||||
<CONFIG>
|
||||
<ProjectOptions>
|
||||
<PathDelim Value="/"/>
|
||||
<Version Value="5"/>
|
||||
<PathDelim Value="\"/>
|
||||
<Version Value="6"/>
|
||||
<General>
|
||||
<SessionStorage Value="InProjectDir"/>
|
||||
<MainUnit Value="0"/>
|
||||
<IconPath Value="./"/>
|
||||
<IconPath Value=".\"/>
|
||||
<TargetFileExt Value=""/>
|
||||
<Title Value="PopupNotifierDemo"/>
|
||||
</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"/>
|
@ -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';
|
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user