A
download frmuAbout.pas
Language: Delphi
LOC: 84
Project Info
IBConsole
Server: SourceForge
Type: cvs
...onsole\ibconsole\ibconsole\
   dlguPreferences.dfm
   dlguPreferences.pas
   dmActions.dti
   dmuMain.dti
   dmuMain.pas
   dmuMain.xfm
   frmEditorOptionsU.dfm
   frmEditorOptionsU.pas
   frmEditorOptionsU.xfm
   frmuAbout.dfm
   frmuAbout.pas
   frmuAddCertificate.dfm
   frmuAddCertificate.pas
   frmuAddTool.dfm
   frmuAddTool.pas
   frmuAddTool.xfm
   ...ckupAliasProperties.dfm
   ...ckupAliasProperties.pas
   ...ckupAliasProperties.xfm
   frmuCommDiag.dfm
   frmuCommDiag.pas
   frmuCommDiag.xfm
   frmuDBBackup.dfm
   frmuDBBackup.pas
   frmuDBBackup.xfm
   frmuDBConnect.dfm
   frmuDBConnect.pas
   frmuDBConnect.xfm
   frmuDBConnections.dfm
   frmuDBConnections.pas
   frmuDBConnections.xfm
   frmuDBCreate.dfm
   frmuDBCreate.pas
   frmuDBCreate.xfm
   frmuDBProperties.dfm
   frmuDBProperties.pas
   frmuDBProperties.xfm
   frmuDBRegister.dfm
   frmuDBRegister.pas
   frmuDBRegister.xfm
   frmuDBRestore.dfm
   frmuDBRestore.pas
   frmuDBRestore.xfm
   frmuDBShutdown.dfm
   frmuDBShutdown.pas
   frmuDBShutdown.xfm
   frmuDBStatistics.dfm
   frmuDBStatistics.pas
   frmuDBStatistics.xfm
   frmuDBTransactions.dfm
   frmuDBTransactions.pas
   frmuDBTransactions.xfm
   frmuDBValidation.dfm
   frmuDBValidation.pas
   frmuDBValidation.xfm
   frmuDBValidationReport.dfm
   frmuDBValidationReport.pas
   frmuDBValidationReport.xfm
   frmuDescription.dfm
   frmuDescription.pas
   frmuDescription.xfm
   frmuDisplayBlob.dfm
   frmuDisplayBlob.pas
   frmuDisplayBlob.xfm
   frmuDispMemo.dfm
   frmuDispMemo.pas
   frmuDispMemo.xfm
   frmuDlgClass.dfm
   frmuDlgClass.pas
   frmuDlgClass.xfm
   frmuFormClass.dfm
   frmuFormClass.pas
   frmuISQL.dfm
   frmuISQL.pas
   frmuMain.dfm
   frmuMain.pas
   frmuMain.xfm
   frmuMessage.dfm
   frmuMessage.pas
   frmuMessage.xfm
   frmuModifyServerAlias.dfm
   frmuModifyServerAlias.pas
   frmuModifyServerAlias.xfm
   frmuObjectWindow.dfm
   frmuObjectWindow.pas
   frmuObjectWindow.xfm
   frmuPreferences.dfm
   frmuPreferences.pas
   frmuQryProgress.dfm
   frmuQryProgress.pas
   frmuServerLogin.dfm
   frmuServerLogin.pas
   frmuServerLogin.xfm
   frmuServerProperties.dfm
   frmuServerProperties.pas
   frmuServerProperties.xfm
   frmuServerRegister.dfm
   frmuServerRegister.pas
   frmuServerRegister.xfm
   frmuSplash.dfm
   frmuSplash.pas
   frmuSQLOptions.dfm
   frmuSQLOptions.pas
   frmuSQLOptions.xfm
   frmuTextViewer.dfm
   frmuTextViewer.pas
   frmuTextViewer.xfm
   frmuTools.dfm
   frmuTools.pas
   frmuTools.xfm
   frmuUser.dfm
   frmuUser.pas
   frmuUser.xfm
   frmuWindowList.dfm
   frmuWindowList.pas
   frmuWindowList.xfm
   IBCConsts.pas
   IBCGlobal.pas
   IBCiPersistentIniFile.pas
   IBConsole.cfg
   IBConsole.dof
   IBConsole.dpk
   IBConsole.dpr
   IBConsole.dsk
   IBConsole.mps
   IBConsole.todo
   IBCPersistent.pas
   IBCPersistentIniFile.pas
   IBCPersistentTypes.pas
   IBCPersistentUtils.pas
   IBCPersistentWinReg.pas
   IBCXDummies.pas
   IBExtract.pas
   IBManager.pas
   MemoLists.pas
   SqlRef.cnt
   thdExternalEditor.pas
   thduObjectView.pas
   wisql.dfm
   wisql.pas
   zluCommDiag.pas
   zluContextHelp.pas
   zluDDLExtraction.pas
   zluGlobal.pas
   zluibcClasses.pas
   zluIniPersistent.pas
   zluPersistent.pas
   zluPersistentTypes.pas
   zluPrevInstance.pas
   zluSQL.pas
   zluUtility.pas
   zluWinRegPersistent.pas

{
 * The contents of this file are subject to the InterBase Public License
 * Version 1.0 (the "License"); you may not use this file except in
 * compliance with the License.
 * 
 * You may obtain a copy of the License at http://www.Inprise.com/IPL.html.
 * 
 * Software distributed under the License is distributed on an "AS IS"
 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
 * the License for the specific language governing rights and limitations
 * under the License.  The Original Code was created by Inprise
 * Corporation and its predecessors.
 * 
 * Portions created by Inprise Corporation are Copyright (C) Inprise
 * Corporation. All Rights Reserved.
 * 
 * Contributor(s): Krzysztof Golko.
}
unit frmuAbout;

interface

uses
{$IFDEF LINUX}
  Types, QForms, QControls, QStdCtrls, QExtCtrls, QGraphics,
{$ENDIF}
{$IFDEF MSWINDOWS}
  WinTypes, WinProcs, Forms, Controls, StdCtrls,
  Buttons, Graphics, ExtCtrls, jpeg,
{$ENDIF}
  frmuDlgClass, Classes, SysUtils;

type
  TfrmAbout = class(TDialog)
    Panel1: TPanel;
    Image1: TImage;
    Button1: TButton;
    lblCopyright: TLabel;
    lblOSVersion: TLabel;
    lblIBConsoleVer: TLabel;
    lblInterbaseLink: TLabel;
    lblBorlandLink: TLabel;
    procedure btnOKClick(Sender: TObject);
    procedure FormShow(Sender: TObject);
    procedure HTTPLinkClick(Sender: TObject);
    procedure GetFileVersion (const Filename: String; out Major1, Major2, Minor1, Minor2: integer);
    { Private declarations }
  public
    { Public declarations }
  end;

procedure ShowAboutDialog(ProductName, ProductVersion: string);

implementation

uses
{$IFDEF MSWINDOWS}
  ShellApi,
{$ENDIF}
  IBCGlobal, zluUtility;

{$IF Declared(Forms)}
{$R *.DFM}
{$IFEND}

{$IF Declared(QForms)}
{$R *.xfm}
{$IFEND}

procedure ShowAboutDialog(ProductName, ProductVersion: string);
var
  frmAbout: TfrmAbout;
begin
  frmAbout := TfrmAbout.Create(Application.MainForm);
  with frmAbout do
  begin
    // show name and version
    if (ProductName <> '') {and (ProductVersion <> '')} then
    begin
      Caption := 'About ' + ProductName + ' ' + Productversion;
    end;
    ShowModal;
    Free;
  end;
end;

procedure TfrmAbout.btnOKClick(Sender: TObject);
begin
  Close;
end;

procedure TfrmAbout.FormShow(Sender: TObject);
begin
  inherited;
  { Get OS Version Information / moved to  }
  lblOSVersion.Caption := OSVerInfo();

  { Get the version information for IBConsole }
  lblIBConsoleVer.Caption := IBConsoleVerInfo();
end;

procedure TfrmAbout.GetFileVersion(const Filename: String; out Major1,
  Major2, Minor1, Minor2: integer);
  { Helper function to get the actual file version information }
{$IFDEF MSWINDOWS}
var
  Info: Pointer;
  InfoSize: DWORD;
  FileInfo: PVSFixedFileInfo;
  FileInfoSize: DWORD;
  Tmp: DWORD;
{$ENDIF}
begin
{$IFDEF MSWINDOWS}
  // Get the size of the FileVersionInformatioin
  InfoSize := GetFileVersionInfoSize(PChar(FileName), Tmp);
  // If InfoSize = 0, then the file may not exist, or
  // it may not have file version information in it.
  if InfoSize = 0 then
    raise Exception.Create('Can''t get file version information for '
      + FileName);
  // Allocate memory for the file version information
  GetMem(Info, InfoSize);
  try
    // Get the information
    GetFileVersionInfo(PChar(FileName), 0, InfoSize, Info);
    // Query the information for the version
    VerQueryValue(Info, '\', Pointer(FileInfo), FileInfoSize);
    // Now fill in the version information
    Major1 := FileInfo.dwFileVersionMS shr 16;
    Major2 := FileInfo.dwFileVersionMS and $FFFF;
    Minor1 := FileInfo.dwFileVersionLS shr 16;
    Minor2 := FileInfo.dwFileVersionLS and $FFFF;
  finally
    FreeMem(Info, FileInfoSize);
  end;
{$ENDIF}
end;

procedure TfrmAbout.HTTPLinkClick(Sender: TObject);
begin
{$IFDEF MSWINDOWS}
  inherited;
  ShellExecute(0, 'open', PChar((Sender as TLabel).Caption), '', '', SW_SHOWNORMAL);
{$ENDIF}
end;

end.



About Koders | Resources | Downloads | Support | Black Duck | Submit Project | Terms of Service | DMCA | Privacy Policy | Site Map| Contact Us