From a0f6fd68a56068a20e7186e2dd2d7daccfbce4aa Mon Sep 17 00:00:00 2001 From: Pavel Perminov Date: Wed, 26 Sep 2012 19:02:53 +0000 Subject: 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 --- plugins/Chess4Net/LookFeelOptionsUnit.pas | 108 ++++++++++++++++++++++++++++++ 1 file changed, 108 insertions(+) create mode 100644 plugins/Chess4Net/LookFeelOptionsUnit.pas (limited to 'plugins/Chess4Net/LookFeelOptionsUnit.pas') 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. -- cgit v1.2.3