summaryrefslogtreecommitdiff
path: root/plugins/!NotAdopted/Chess4Net/ContinueUnit.pas
diff options
context:
space:
mode:
authorVadim Dashevskiy <watcherhd@gmail.com>2012-10-08 09:10:06 +0000
committerVadim Dashevskiy <watcherhd@gmail.com>2012-10-08 09:10:06 +0000
commit194923c172167eb3fc33807ec8009b255f86337e (patch)
tree1effc97a1bd872cc3a5eac7a361250cf283e0efd /plugins/!NotAdopted/Chess4Net/ContinueUnit.pas
parentb2943645fed61d0c0cfee1225654e5ff44fd96f8 (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/ContinueUnit.pas')
-rw-r--r--plugins/!NotAdopted/Chess4Net/ContinueUnit.pas117
1 files changed, 117 insertions, 0 deletions
diff --git a/plugins/!NotAdopted/Chess4Net/ContinueUnit.pas b/plugins/!NotAdopted/Chess4Net/ContinueUnit.pas
new file mode 100644
index 0000000000..d6a38a662f
--- /dev/null
+++ b/plugins/!NotAdopted/Chess4Net/ContinueUnit.pas
@@ -0,0 +1,117 @@
+////////////////////////////////////////////////////////////////////////////////
+// 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 ContinueUnit;
+
+interface
+
+uses
+ Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms,
+ {Dialogs, }ExtCtrls, StdCtrls, TntStdCtrls,
+ DialogUnit, ModalForm;
+
+type
+ TContinueHandler = procedure of object;
+
+ TContinueForm = class(TModalForm)
+ ContinueButton: TTntButton;
+ ContinueLabel: TTntLabel;
+ procedure ContinueButtonClick(Sender: TObject);
+ procedure FormClose(Sender: TObject; var Action: TCloseAction);
+ procedure FormShow(Sender: TObject);
+ procedure FormCreate(Sender: TObject);
+ private
+// dlgOwner: TDialogs;
+ ContinueHandler: TContinueHandler;
+ shuted: boolean;
+ procedure FLocalize;
+ protected
+ function GetModalID: TModalFormID; override;
+ public
+ procedure Shut;
+ constructor Create(Owner: TForm; h: TContinueHandler = nil); reintroduce; overload;
+// constructor Create(dlgOwner: TDialogs; h: TContinueHandler); reintroduce; overload;
+ end;
+
+implementation
+
+{$R *.dfm}
+
+uses
+ GlobalsUnit, LocalizerUnit;
+
+////////////////////////////////////////////////////////////////////////////////
+// TContinueForm
+
+procedure TContinueForm.ContinueButtonClick(Sender: TObject);
+begin
+ Close;
+end;
+
+
+procedure TContinueForm.FormShow(Sender: TObject);
+var
+ frmOwner: TForm;
+begin
+ frmOwner := (Owner as TForm);
+ Left:= frmOwner.Left + (frmOwner.Width - Width) div 2;
+ Top:= frmOwner.Top + (frmOwner.Height - Height) div 2;
+end;
+
+
+constructor TContinueForm.Create(Owner: TForm; h: TContinueHandler = nil);
+begin
+ self.FormStyle := Owner.FormStyle;
+ inherited Create(Owner);
+ shuted := FALSE;
+ ContinueHandler := h;
+end;
+
+
+procedure TContinueForm.FormClose(Sender: TObject;
+ var Action: TCloseAction);
+begin
+ if not shuted then
+ begin
+ ModalResult := ContinueButton.ModalResult;
+ if Assigned(ContinueHandler) then
+ ContinueHandler;
+ end
+ else
+ ModalResult := mrNone;
+end;
+
+
+procedure TContinueForm.Shut;
+begin
+ shuted:= TRUE;
+ Close;
+end;
+
+
+function TContinueForm.GetModalID: TModalFormID;
+begin
+ Result := mfContinue;
+end;
+
+
+procedure TContinueForm.FormCreate(Sender: TObject);
+begin
+ Caption := DIALOG_CAPTION;
+ FLocalize;
+end;
+
+
+procedure TContinueForm.FLocalize;
+begin
+ with TLocalizer.Instance do
+ begin
+ ContinueLabel.Caption := GetLabel(22);
+ ContinueButton.Caption := GetLabel(23);
+ end;
+end;
+
+end.