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/MI/TransmitGameSelectionUnit.pas | 77 ++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 plugins/Chess4Net/MI/TransmitGameSelectionUnit.pas (limited to 'plugins/Chess4Net/MI/TransmitGameSelectionUnit.pas') diff --git a/plugins/Chess4Net/MI/TransmitGameSelectionUnit.pas b/plugins/Chess4Net/MI/TransmitGameSelectionUnit.pas new file mode 100644 index 0000000000..8e87d67d66 --- /dev/null +++ b/plugins/Chess4Net/MI/TransmitGameSelectionUnit.pas @@ -0,0 +1,77 @@ +unit TransmitGameSelectionUnit; + +interface + +uses + Forms, Controls, StdCtrls, TntStdCtrls, Classes, + // + ModalForm; + +type + TTransmitGameSelectionForm = class(TModalForm) + OkButton: TTntButton; + CancelButton: TTntButton; + TransmitGameListBox: TTntListBox; + procedure FormCreate(Sender: TObject); + private + procedure FLocalize; + protected + function GetModalID: TModalFormID; override; + public + procedure SetGames(Games: TStrings); + function GetSelected: TObject; + end; + +implementation + +{$R *.dfm} + +uses + LocalizerUnit; + +//////////////////////////////////////////////////////////////////////////////// +// TTransmitGameSelectionForm + +procedure TTransmitGameSelectionForm.FormCreate(Sender: TObject); +begin + FLocalize; +end; + + +procedure TTransmitGameSelectionForm.FLocalize; +begin + with TLocalizer.Instance do + begin + Caption := GetLabel(67); + OkButton.Caption := GetLabel(11); + CancelButton.Caption := GetLabel(12); + end; +end; + + +function TTransmitGameSelectionForm.GetModalID: TModalFormID; +begin + Result := mfTransmitGame; +end; + + +procedure TTransmitGameSelectionForm.SetGames(Games: TStrings); +begin + TransmitGameListBox.Items.Assign(Games); + if (TransmitGameListBox.Count > 0) then + TransmitGameListBox.ItemIndex := 0; +end; + + +function TTransmitGameSelectionForm.GetSelected: TObject; +var + iIndex: integer; +begin + iIndex := TransmitGameListBox.ItemIndex; + if (iIndex >= 0) then + Result := TransmitGameListBox.Items.Objects[iIndex] + else + Result := nil; +end; + +end. -- cgit v1.2.3