2009-12-24 16:34:29 +01:00
|
|
|
(*
|
|
|
|
* CDDL HEADER START
|
|
|
|
*
|
|
|
|
* The contents of this file are subject to the terms of the
|
|
|
|
* Common Development and Distribution License, Version 1.0 only
|
|
|
|
* (the "License"). You may not use this file except in compliance
|
|
|
|
* with the License.
|
|
|
|
*
|
|
|
|
* You can obtain a copy of the license at
|
|
|
|
* http://www.opensource.org/licenses/cddl1.php.
|
|
|
|
* See the License for the specific language governing permissions
|
|
|
|
* and limitations under the License.
|
|
|
|
*
|
|
|
|
* When distributing Covered Code, include this CDDL HEADER in each
|
|
|
|
* file and include the License file at
|
|
|
|
* http://www.opensource.org/licenses/cddl1.php. If applicable,
|
|
|
|
* add the following below this CDDL HEADER, with the fields enclosed
|
|
|
|
* by brackets "[]" replaced with your own identifying * information:
|
|
|
|
* Portions Copyright [yyyy] [name of copyright owner]
|
|
|
|
*
|
|
|
|
* CDDL HEADER END
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* Portions Copyright 2007 Andreas Schneider
|
|
|
|
*)
|
|
|
|
unit UfrmAbout;
|
|
|
|
|
|
|
|
{$mode objfpc}{$H+}
|
|
|
|
|
|
|
|
interface
|
|
|
|
|
|
|
|
uses
|
|
|
|
Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, StdCtrls,
|
2015-05-01 14:44:54 +02:00
|
|
|
ExtCtrls;
|
2009-12-24 16:34:29 +01:00
|
|
|
|
|
|
|
type
|
|
|
|
|
|
|
|
{ TfrmAbout }
|
|
|
|
|
2008-08-09 19:38:09 +02:00
|
|
|
TfrmAbout = class(TForm)
|
|
|
|
btnClose: TButton;
|
2015-05-01 12:23:03 +02:00
|
|
|
imgLogo: TImage;
|
|
|
|
imgBaner: TImage;
|
2009-12-24 16:34:29 +01:00
|
|
|
Label3: TLabel;
|
2015-05-01 12:23:03 +02:00
|
|
|
Label8: TLabel;
|
2008-08-09 19:38:09 +02:00
|
|
|
lblCopyright: TLabel;
|
|
|
|
lblVersion: TLabel;
|
2015-05-01 12:23:03 +02:00
|
|
|
lblWebLink: TLabel;
|
2008-08-09 19:38:09 +02:00
|
|
|
Panel2: TPanel;
|
2009-12-24 16:34:29 +01:00
|
|
|
Panel3: TPanel;
|
2015-05-01 12:23:03 +02:00
|
|
|
Panel4: TPanel;
|
|
|
|
Panel5: TPanel;
|
2009-12-24 16:34:29 +01:00
|
|
|
procedure btnCloseClick(Sender: TObject);
|
|
|
|
procedure FormCreate(Sender: TObject);
|
2015-05-01 12:23:03 +02:00
|
|
|
procedure FormHide(Sender: TObject);
|
|
|
|
procedure FormShow(Sender: TObject);
|
|
|
|
procedure imgBanerClick(Sender: TObject);
|
|
|
|
procedure imgBanerMouseEnter(Sender: TObject);
|
|
|
|
procedure imgBanerMouseLeave(Sender: TObject);
|
|
|
|
procedure lblWebLinkClick(Sender: TObject);
|
|
|
|
procedure lblWebLinkMouseEnter(Sender: TObject);
|
|
|
|
procedure lblWebLinkMouseLeave(Sender: TObject);
|
|
|
|
procedure Panel2Click(Sender: TObject);
|
2009-12-24 16:34:29 +01:00
|
|
|
private
|
|
|
|
{ private declarations }
|
2015-05-01 12:23:03 +02:00
|
|
|
pSound: Pointer;
|
2009-12-24 16:34:29 +01:00
|
|
|
public
|
|
|
|
{ public declarations }
|
2015-05-01 12:23:03 +02:00
|
|
|
lbVersion: string;
|
|
|
|
lbBuild: string;
|
2009-12-24 16:34:29 +01:00
|
|
|
end;
|
|
|
|
|
|
|
|
var
|
|
|
|
frmAbout: TfrmAbout;
|
|
|
|
|
|
|
|
implementation
|
|
|
|
|
2015-05-01 12:23:03 +02:00
|
|
|
uses vinfo, Language, UResourceManager;
|
2009-12-24 16:34:29 +01:00
|
|
|
{$I version.inc}
|
|
|
|
|
2015-05-01 12:23:03 +02:00
|
|
|
|
2009-12-24 16:34:29 +01:00
|
|
|
{ TfrmAbout }
|
|
|
|
|
|
|
|
procedure TfrmAbout.btnCloseClick(Sender: TObject);
|
|
|
|
begin
|
|
|
|
Close;
|
|
|
|
end;
|
|
|
|
|
|
|
|
procedure TfrmAbout.FormCreate(Sender: TObject);
|
|
|
|
begin
|
2015-05-01 12:23:03 +02:00
|
|
|
pSound:= nil;
|
|
|
|
LanguageTranslate(Self);
|
|
|
|
lblVersion.Caption := Format('%s %s%s %s %d',
|
|
|
|
[lbVersion, VersionInfo.GetFileVersionString, #13#10, lbBuild, VersionInfo.Build]);
|
|
|
|
imgLogo.Picture.Bitmap.LoadFromStream(ResourceManager.GetResource('Overlay/About.bmp'));
|
|
|
|
//lblVersion.Caption := Format('Version %s', [ProductVersion]);
|
|
|
|
//lblCopyright.Caption := Format('Copyright %s', [Copyright]);
|
|
|
|
end;
|
|
|
|
|
|
|
|
procedure TfrmAbout.FormShow(Sender: TObject);
|
|
|
|
var
|
|
|
|
stream: TStream;
|
|
|
|
begin
|
|
|
|
if (pSound = nil) then begin
|
|
|
|
stream := ResourceManager.GetResource('Sounds/MusicInf.wav');
|
|
|
|
GetMem(pSound, stream.Size);
|
|
|
|
stream.Read(pSound^, stream.Size);
|
|
|
|
end;
|
2015-05-01 14:44:54 +02:00
|
|
|
//TODO: sndPlaySound(pSound, SND_MEMORY or SND_ASYNC or SND_LOOP);
|
2015-05-01 12:23:03 +02:00
|
|
|
end;
|
|
|
|
|
|
|
|
procedure TfrmAbout.FormHide(Sender: TObject);
|
|
|
|
begin
|
|
|
|
if pSound = nil then Exit;
|
2015-05-01 14:44:54 +02:00
|
|
|
//TODO: sndPlaySound(nil, SND_ASYNC or SND_LOOP);
|
2015-05-01 12:23:03 +02:00
|
|
|
FreeMem(pSound);
|
|
|
|
pSound := nil;
|
|
|
|
end;
|
|
|
|
|
|
|
|
procedure TfrmAbout.imgBanerClick(Sender: TObject);
|
|
|
|
begin
|
2015-05-01 14:44:54 +02:00
|
|
|
//Open the site in the default browser
|
|
|
|
//TODO: ShellExecute(Handle, 'open', PChar('http://uoquint.ru'), nil, nil, 1 {SW_SHOWNORMAL});
|
2015-05-01 12:23:03 +02:00
|
|
|
end;
|
|
|
|
|
|
|
|
procedure TfrmAbout.imgBanerMouseEnter(Sender: TObject);
|
|
|
|
var stream: TMemoryStream;
|
|
|
|
begin
|
|
|
|
stream := TMemoryStream.Create;
|
|
|
|
stream.Write(baner_h[0],SizeOf(baner_h));
|
|
|
|
stream.Position:=0;
|
|
|
|
imgBaner.Picture.Bitmap.LoadFromStream(stream);
|
|
|
|
stream.Free;
|
|
|
|
end;
|
|
|
|
|
|
|
|
procedure TfrmAbout.imgBanerMouseLeave(Sender: TObject);
|
|
|
|
var stream: TMemoryStream;
|
|
|
|
begin
|
|
|
|
stream := TMemoryStream.Create;
|
|
|
|
stream.Write(baner_u[0],SizeOf(baner_u));
|
|
|
|
stream.Position:=0;
|
|
|
|
imgBaner.Picture.Bitmap.LoadFromStream(stream);
|
|
|
|
stream.Free;
|
|
|
|
// sndPlaySound
|
|
|
|
end;
|
|
|
|
|
|
|
|
procedure TfrmAbout.lblWebLinkClick(Sender: TObject);
|
|
|
|
begin
|
2015-05-01 14:44:54 +02:00
|
|
|
//Open the site in the default browser
|
|
|
|
//ShellExecute(Handle, 'open', PChar('http://dev.uoquint.ru/projects/centred'), nil, nil, 1 {SW_SHOWNORMAL});
|
2015-05-01 12:23:03 +02:00
|
|
|
end;
|
|
|
|
|
|
|
|
procedure TfrmAbout.lblWebLinkMouseEnter(Sender: TObject);
|
|
|
|
begin
|
|
|
|
lblWebLink.Font.Color := TColor($00EAAE86);
|
|
|
|
end;
|
|
|
|
|
|
|
|
procedure TfrmAbout.lblWebLinkMouseLeave(Sender: TObject);
|
|
|
|
begin
|
|
|
|
lblWebLink.Font.Color := TColor($00E18A51);
|
|
|
|
end;
|
|
|
|
|
|
|
|
procedure TfrmAbout.Panel2Click(Sender: TObject);
|
|
|
|
begin
|
|
|
|
|
2009-12-24 16:34:29 +01:00
|
|
|
end;
|
|
|
|
|
|
|
|
initialization
|
|
|
|
{$I UfrmAbout.lrs}
|
|
|
|
|
|
|
|
end.
|
|
|
|
|