diff options
author | Vadim Dashevskiy <watcherhd@gmail.com> | 2012-10-08 09:10:06 +0000 |
---|---|---|
committer | Vadim Dashevskiy <watcherhd@gmail.com> | 2012-10-08 09:10:06 +0000 |
commit | 194923c172167eb3fc33807ec8009b255f86337e (patch) | |
tree | 1effc97a1bd872cc3a5eac7a361250cf283e0efd /plugins/!NotAdopted/Chess4Net/InfoUnit.pas | |
parent | b2943645fed61d0c0cfee1225654e5ff44fd96f8 (diff) |
Plugin is not adapted until someone can compile it and tell others how to do the same
git-svn-id: http://svn.miranda-ng.org/main/trunk@1809 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/!NotAdopted/Chess4Net/InfoUnit.pas')
-rw-r--r-- | plugins/!NotAdopted/Chess4Net/InfoUnit.pas | 98 |
1 files changed, 98 insertions, 0 deletions
diff --git a/plugins/!NotAdopted/Chess4Net/InfoUnit.pas b/plugins/!NotAdopted/Chess4Net/InfoUnit.pas new file mode 100644 index 0000000000..f4b349a71d --- /dev/null +++ b/plugins/!NotAdopted/Chess4Net/InfoUnit.pas @@ -0,0 +1,98 @@ +////////////////////////////////////////////////////////////////////////////////
+// All code below is exclusively owned by author of Chess4Net - Pavel Perminov
+// (packpaul@mail.ru, packpaul1@gmail.com).
+// Any changes, modifications, borrowing and adaptation are a subject for
+// explicit permition from the owner.
+
+unit InfoUnit;
+
+interface
+
+uses
+ Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms,
+ Dialogs, StdCtrls, ShellAPI;
+
+type
+ TInfoForm = class(TForm)
+ OkButton: TButton;
+ PluginNameLabel: TLabel;
+ PlayingViaLabel: TLabel;
+ Label2: TLabel;
+ Label3: TLabel;
+ Label4: TLabel;
+ Label5: TLabel;
+ URLLabel: TLabel;
+ EMailLabel: TLabel;
+ procedure OkButtonClick(Sender: TObject);
+ procedure FormCreate(Sender: TObject);
+ procedure EMailLabelClick(Sender: TObject);
+ procedure URLLabelClick(Sender: TObject);
+ procedure FormClose(Sender: TObject; var Action: TCloseAction);
+ end;
+
+procedure ShowInfo;
+
+implementation
+
+{$R *.dfm}
+
+uses
+ GlobalsLocalUnit, ModalForm;
+
+var
+ infoForm: TInfoForm = nil;
+
+procedure ShowInfo;
+begin
+ if (not Assigned(infoForm)) then
+ begin
+ infoForm := TInfoForm.Create(nil);
+ if (TDialogs.HasStayOnTopOwners) then
+ infoForm.FormStyle := fsStayOnTop;
+{$IFDEF SKYPE}
+ infoForm.Icon := Chess4NetIcon;
+ infoForm.Caption := DIALOG_CAPTION;
+{$ELSE} // MI, TRILLIAN, AND_RQ, QIP
+ infoForm.Icon := pluginIcon;
+ infoForm.Caption := PLUGIN_NAME;
+{$ENDIF}
+ end;
+ if not infoForm.Showing then
+ infoForm.Show
+ else
+ infoForm.SetFocus;
+end;
+
+procedure TInfoForm.OkButtonClick(Sender: TObject);
+begin
+ Close;
+end;
+
+procedure TInfoForm.FormCreate(Sender: TObject);
+begin
+ PlayingViaLabel.Caption := PLUGIN_PLAYING_OVER;
+ PluginNameLabel.Caption := PLUGIN_INFO_NAME;
+ URLLabel.Caption := PLUGIN_URL;
+ EMailLabel.Caption := PLUGIN_EMAIL;
+end;
+
+procedure TInfoForm.URLLabelClick(Sender: TObject);
+begin
+ ShellExecute(Handle, nil, PChar(URLLabel.Caption), nil, nil, SW_SHOWNORMAL);
+end;
+
+procedure TInfoForm.EMailLabelClick(Sender: TObject);
+var
+ shellStr: string;
+begin
+ shellStr := 'mailto:' + EMailLabel.Caption;
+ ShellExecute(Handle, nil, PChar(shellStr), nil, nil, SW_SHOWNORMAL);
+end;
+
+procedure TInfoForm.FormClose(Sender: TObject; var Action: TCloseAction);
+begin
+ infoForm := nil;
+ Action := caFree;
+end;
+
+end.
|