home *** CD-ROM | disk | FTP | other *** search
/ PC Open 19 / pcopen19.iso / Zipped / CALMIR21.ZIP / SOURCE.ZIP / SRC / ABOUT.PAS < prev    next >
Encoding:
Pascal/Delphi Source File  |  1998-02-20  |  3.6 KB  |  112 lines

  1. {**************************************************************************}
  2. {                                                                          }
  3. {    Calmira shell for Microsoft« Windows(TM) 3.1                          }
  4. {    Source Release 2.1                                                    }
  5. {    Copyright (C) 1997-1998 Li-Hsin Huang                                 }
  6. {                                                                          }
  7. {    This program is free software; you can redistribute it and/or modify  }
  8. {    it under the terms of the GNU General Public License as published by  }
  9. {    the Free Software Foundation; either version 2 of the License, or     }
  10. {    (at your option) any later version.                                   }
  11. {                                                                          }
  12. {    This program is distributed in the hope that it will be useful,       }
  13. {    but WITHOUT ANY WARRANTY; without even the implied warranty of        }
  14. {    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         }
  15. {    GNU General Public License for more details.                          }
  16. {                                                                          }
  17. {    You should have received a copy of the GNU General Public License     }
  18. {    along with this program; if not, write to the Free Software           }
  19. {    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.             }
  20. {                                                                          }
  21. {**************************************************************************}
  22.  
  23. unit About;
  24.  
  25. interface
  26.  
  27. uses WinTypes, WinProcs, Classes, Graphics, Forms, Controls, StdCtrls,
  28.   Buttons, ExtCtrls;
  29.  
  30. type
  31.   TAboutBox = class(TForm)
  32.     OKButton: TBitBtn;
  33.     LicenseBtn: TBitBtn;
  34.     Image: TImage;
  35.     ProductName: TLabel;
  36.     VersionLabel: TLabel;
  37.     Copyright: TLabel;
  38.     Email: TLabel;
  39.     MemLabel: TLabel;
  40.     ResLabel: TLabel;
  41.     Label2: TLabel;
  42.     Bevel1: TBevel;
  43.     HomePage: TLabel;
  44.     Label4: TLabel;
  45.     Label5: TLabel;
  46.     procedure LicenseBtnClick(Sender: TObject);
  47.     procedure FormCreate(Sender: TObject);
  48.     procedure HomePageClick(Sender: TObject);
  49.     procedure ImageClick(Sender: TObject);
  50.   private
  51.     { Private declarations }
  52.   public
  53.     { Public declarations }
  54.   end;
  55.  
  56. {
  57. var
  58.   AboutBox: TAboutBox;
  59. }
  60.  
  61. implementation
  62.  
  63. {$R *.DFM}
  64.  
  65. uses Strings, SysUtils, Files, MiscUtil, Settings, Fileman,
  66.   Dialogs, Locale, Desk;
  67.  
  68. procedure TAboutBox.LicenseBtnClick(Sender: TObject);
  69. var
  70.   license : TFilename;
  71. begin
  72.   license := ApplicationPath + 'LICENSE.TXT';
  73.  
  74.   if not FileExists(license) then
  75.     MsgDialogRes(SCannotFindLicense, mtError, [mbOK], 0)
  76.   else
  77.     if ExecuteFile('notepad.exe', license, '', 'Open', SW_SHOWMAXIMIZED) <= 32 then
  78.     MsgDialogRes(SCannotRunNotepad, mtError, [mbOK], 0);
  79. end;
  80.  
  81.  
  82. procedure TAboutBox.FormCreate(Sender: TObject);
  83. begin
  84.   OKButton.Cancel := True;
  85.  
  86.   MemLabel.Caption := FormatByte(GetFreeSpace(0), 2) + ' Free';
  87.   ResLabel.Caption := Format('System %d%%    GDI %d%%    USER %d%%',
  88.     [GetFreeSystemResources(GFSR_SYSTEMRESOURCES),
  89.      GetFreeSystemResources(GFSR_GDIRESOURCES),
  90.      GetFreeSystemResources(GFSR_USERRESOURCES)]);
  91.  
  92.   Image.Picture.Bitmap.Handle := LoadBitmap(HInstance, 'LOGO');
  93.  
  94.   if FirstRun then begin
  95.     Caption := LoadStr(SWelcome);
  96.     FirstRun := False;
  97.   end;
  98. end;
  99.  
  100. procedure TAboutBox.HomePageClick(Sender: TObject);
  101. begin
  102.   DefaultExec(HomePage.Caption, '', '', SW_SHOW);
  103. end;
  104.  
  105. procedure TAboutBox.ImageClick(Sender: TObject);
  106. begin
  107.   Desktop.Revert;
  108. end;
  109.  
  110. end.
  111.  
  112.