summaryrefslogtreecommitdiff
path: root/plugins/!NotAdopted/Chess4Net/LookFeelOptionsUnit.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/LookFeelOptionsUnit.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/LookFeelOptionsUnit.pas')
-rw-r--r--plugins/!NotAdopted/Chess4Net/LookFeelOptionsUnit.pas110
1 files changed, 110 insertions, 0 deletions
diff --git a/plugins/!NotAdopted/Chess4Net/LookFeelOptionsUnit.pas b/plugins/!NotAdopted/Chess4Net/LookFeelOptionsUnit.pas
new file mode 100644
index 0000000000..7fe03b2a70
--- /dev/null
+++ b/plugins/!NotAdopted/Chess4Net/LookFeelOptionsUnit.pas
@@ -0,0 +1,110 @@
+////////////////////////////////////////////////////////////////////////////////
+// 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 LookFeelOptionsUnit;
+
+interface
+
+uses
+ Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms,
+ Dialogs, StdCtrls, ExtCtrls,
+ ModalForm, TntStdCtrls,
+ // Chess4Net units
+ LocalizerUnit;
+
+type
+ TLookFeelOptionsForm = class(TModalForm, ILocalizable)
+ OkButton: TTntButton;
+ CancelButton: TTntButton;
+ AnimationComboBox: TTntComboBox;
+ AnimateLabel: TTntLabel;
+ BoxPanel: TPanel;
+ HilightLastMoveBox: TTntCheckBox;
+ FlashIncomingMoveBox: TTntCheckBox;
+ CoordinatesBox: TTntCheckBox;
+ StayOnTopBox: TTntCheckBox;
+ ExtraExitBox: TTntCheckBox;
+ GUILangLabel: TTntLabel;
+ GUILangComboBox: TTntComboBox;
+ procedure FormCreate(Sender: TObject);
+ procedure GUILangComboBoxChange(Sender: TObject);
+ procedure FormDestroy(Sender: TObject);
+ private
+ procedure ILocalizable.Localize = FLocalize;
+ procedure FLocalize;
+ protected
+ function GetModalID: TModalFormID; override;
+ end;
+
+implementation
+
+{$R *.dfm}
+
+function TLookFeelOptionsForm. GetModalID: TModalFormID;
+begin
+ Result := mfLookFeel;
+end;
+
+
+procedure TLookFeelOptionsForm.FormCreate(Sender: TObject);
+var
+ i: integer;
+begin
+ // Fill GUI Languages combo box
+ GUILangComboBox.Clear;
+ with TLocalizer.Instance do
+ begin
+ for i := 0 to LanguagesCount - 1 do
+ GUILangComboBox.Items.Add(LanguageName[i]);
+ GUILangComboBox.ItemIndex := ActiveLanguage;
+ end;
+
+ TLocalizer.Instance.AddSubscriber(self);
+ FLocalize;
+end;
+
+
+procedure TLookFeelOptionsForm.FLocalize;
+var
+ iSavedAnimation: integer;
+begin
+ with TLocalizer.Instance do
+ begin
+ Caption := GetLabel(0);
+ AnimateLabel.Caption := GetLabel(1);
+ with AnimationComboBox do
+ begin
+ iSavedAnimation := ItemIndex;
+ Items[0] := GetLabel(2);
+ Items[1] := GetLabel(3);
+ Items[2] := GetLabel(4);
+ ItemIndex := iSavedAnimation;
+ end;
+ HilightLastMoveBox.Caption := GetLabel(5);
+ FlashIncomingMoveBox.Caption := GetLabel(6);
+ CoordinatesBox.Caption := GetLabel(7);
+ StayOnTopBox.Caption := GetLabel(8);
+ ExtraExitBox.Caption := GetLabel(9);
+ GUILangLabel.Caption := GetLabel(10);
+
+ OkButton.Caption := GetLabel(11);
+ CancelButton.Caption := GetLabel(12);
+ end;
+end;
+
+
+procedure TLookFeelOptionsForm.GUILangComboBoxChange(Sender: TObject);
+begin
+ TLocalizer.Instance.ActiveLanguage := GUILangComboBox.ItemIndex;
+end;
+
+
+procedure TLookFeelOptionsForm.FormDestroy(Sender: TObject);
+begin
+ TLocalizer.Instance.DeleteSubscriber(self);
+end;
+
+end.