Fixes lcl compilation on win32, initial implementation for TWin32TrayIcon.GetPosition and moved popupnotifier example.

git-svn-id: trunk@14041 -
This commit is contained in:
sekelsenmat 2008-02-09 12:39:21 +00:00
parent ac73b6de41
commit 2d2a1cb6ff
9 changed files with 67 additions and 24 deletions

10
.gitattributes vendored
View File

@ -658,11 +658,6 @@ components/paradox/lazparadox.pas svneol=native#text/plain
components/paradox/regparadox.lrs svneol=native#text/plain components/paradox/regparadox.lrs svneol=native#text/plain
components/paradox/regparadox.pp svneol=native#text/plain components/paradox/regparadox.pp svneol=native#text/plain
components/paradox/tparadox.png -text svneol=unset#image/png 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.de.po svneol=native#text/plain
components/prettyformat/languages/pfidesource.fr.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 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/exampleform.pp svneol=native#text/pascal
examples/openglcontrol/openglcontrol_demo.lpi svneol=native#text/plain examples/openglcontrol/openglcontrol_demo.lpi svneol=native#text/plain
examples/openglcontrol/openglcontrol_demo.pas svneol=native#text/pascal 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.lpi svneol=native#text/plain
examples/postscript/samplepostscriptcanvas.lpr svneol=native#text/pascal examples/postscript/samplepostscriptcanvas.lpr svneol=native#text/pascal
examples/postscript/usamplepostscriptcanvas.lfm svneol=native#text/plain examples/postscript/usamplepostscriptcanvas.lfm svneol=native#text/plain

4
.gitignore vendored
View File

@ -76,10 +76,6 @@ components/opengl/*.bak
components/opengl/example/*.bak components/opengl/example/*.bak
components/opengl/example/units components/opengl/example/units
components/opengl/units components/opengl/units
components/popupnotifier/*.bak
components/popupnotifier/demo/*.bak
components/popupnotifier/demo/units
components/popupnotifier/units
components/prettyformat/*.bak components/prettyformat/*.bak
components/prettyformat/languages/*.bak components/prettyformat/languages/*.bak
components/prettyformat/languages/units components/prettyformat/languages/units

View File

@ -1,17 +1,18 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<CONFIG> <CONFIG>
<ProjectOptions> <ProjectOptions>
<PathDelim Value="/"/> <PathDelim Value="\"/>
<Version Value="5"/> <Version Value="6"/>
<General> <General>
<SessionStorage Value="InProjectDir"/> <SessionStorage Value="InProjectDir"/>
<MainUnit Value="0"/> <MainUnit Value="0"/>
<IconPath Value="./"/> <IconPath Value=".\"/>
<TargetFileExt Value=""/> <TargetFileExt Value=""/>
<Title Value="PopupNotifierDemo"/> <Title Value="PopupNotifierDemo"/>
</General> </General>
<PublishOptions> <PublishOptions>
<Version Value="2"/> <Version Value="2"/>
<DestinationDirectory Value="$(TestDir)\publishedproject\"/>
<IgnoreBinaries Value="False"/> <IgnoreBinaries Value="False"/>
<IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/> <IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/>
<ExcludeFileFilter Value="*.(bak|ppu|ppw|o|so);*~;backup"/> <ExcludeFileFilter Value="*.(bak|ppu|ppw|o|so);*~;backup"/>
@ -19,17 +20,13 @@
<RunParams> <RunParams>
<local> <local>
<FormatVersion Value="1"/> <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> </local>
</RunParams> </RunParams>
<RequiredPackages Count="2"> <RequiredPackages Count="1">
<Item1> <Item1>
<PackageName Value="popupnotifierlaz"/>
<MinVersion Minor="1" Release="1" Valid="True"/>
</Item1>
<Item2>
<PackageName Value="LCL"/> <PackageName Value="LCL"/>
</Item2> </Item1>
</RequiredPackages> </RequiredPackages>
<Units Count="2"> <Units Count="2">
<Unit0> <Unit0>
@ -48,11 +45,12 @@
</ProjectOptions> </ProjectOptions>
<CompilerOptions> <CompilerOptions>
<Version Value="5"/> <Version Value="5"/>
<PathDelim Value="\"/>
<Target> <Target>
<Filename Value="PopupNotifierDemo"/> <Filename Value="PopupNotifierDemo"/>
</Target> </Target>
<SearchPaths> <SearchPaths>
<SrcPath Value="$(LazarusDir)/lcl/;$(LazarusDir)/lcl/interfaces/$(LCLWidgetType)/"/> <SrcPath Value="$(LazarusDir)\lcl\;$(LazarusDir)\lcl\interfaces\$(LCLWidgetType)\"/>
</SearchPaths> </SearchPaths>
<CodeGeneration> <CodeGeneration>
<Generate Value="Faster"/> <Generate Value="Faster"/>

View File

@ -8,7 +8,7 @@ uses
{$ENDIF}{$ENDIF} {$ENDIF}{$ENDIF}
Interfaces, // this includes the LCL widgetset Interfaces, // this includes the LCL widgetset
Forms Forms
{ add your units here }, unit1, popupnotifierlaz; { add your units here }, unit1;
begin begin
Application.Title:='PopupNotifierDemo'; Application.Title:='PopupNotifierDemo';

View File

@ -211,9 +211,22 @@ end;
* DESCRIPTION: Shows a small message balloon near the tray icon * 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 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; end;
{******************************************************************* {*******************************************************************
@ -225,7 +238,42 @@ end;
* *
*******************************************************************} *******************************************************************}
class function TWin32WSCustomTrayIcon.GetPosition(const ATrayIcon: TCustomTrayIcon): TPoint; class function TWin32WSCustomTrayIcon.GetPosition(const ATrayIcon: TCustomTrayIcon): TPoint;
var
hWndTray : HWND;
TrayRect: TRect;
begin begin
Result := Point(0, 0); 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; end;

View File

@ -32,7 +32,8 @@ uses
// To get as little as posible circles, // To get as little as posible circles,
// uncomment only when needed for registration // 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, WSControls, WSExtCtrls, WSLCLClasses, WSProc, Win32Extra, Win32Int, Win32Proc,
InterfaceBase, Win32WSControls; InterfaceBase, Win32WSControls;
@ -224,7 +225,7 @@ type
class function Hide(const ATrayIcon: TCustomTrayIcon): Boolean; override; class function Hide(const ATrayIcon: TCustomTrayIcon): Boolean; override;
class function Show(const ATrayIcon: TCustomTrayIcon): Boolean; override; class function Show(const ATrayIcon: TCustomTrayIcon): Boolean; override;
class procedure InternalUpdate(const ATrayIcon: TCustomTrayIcon); 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; class function GetPosition(const ATrayIcon: TCustomTrayIcon): TPoint; override;
end; end;