summaryrefslogtreecommitdiff
path: root/plugins/Chess4Net/LookFeelOptionsUnit.pas
diff options
context:
space:
mode:
authorPavel Perminov <packpaul@mail.ru>2012-09-26 19:02:53 +0000
committerPavel Perminov <packpaul@mail.ru>2012-09-26 19:02:53 +0000
commita0f6fd68a56068a20e7186e2dd2d7daccfbce4aa (patch)
treec729df922348c49431db745e0d694f228e53e4dc /plugins/Chess4Net/LookFeelOptionsUnit.pas
parentd9cd01de6dd3458ad806fdbe1d29108eda55b3e4 (diff)
Chess4Net_MI 2010.0 release (106 rev. truncated adjusted copy)
git-svn-id: http://svn.miranda-ng.org/main/trunk@1666 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Chess4Net/LookFeelOptionsUnit.pas')
-rw-r--r--plugins/Chess4Net/LookFeelOptionsUnit.pas108
1 files changed, 108 insertions, 0 deletions
diff --git a/plugins/Chess4Net/LookFeelOptionsUnit.pas b/plugins/Chess4Net/LookFeelOptionsUnit.pas
new file mode 100644
index 0000000000..138ab498ae
--- /dev/null
+++ b/plugins/Chess4Net/LookFeelOptionsUnit.pas
@@ -0,0 +1,108 @@
+unit LookFeelOptionsUnit;
+
+interface
+
+uses
+ Windows, Messages, SysUtils, Variants, 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
+{$IFDEF SKYPE}
+ StayOnTopBox.Enabled := FALSE; // TODO: this was done to prevent non-modal dialogs be overlapped by ChessForm. Resolve later
+{$ENDIF}
+
+ // 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.