unit Unit38021;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Buttons, ExtCtrls;
type
TForm38021 = class(TForm)
SpeedButton8: TSpeedButton;
SpeedButton9: TSpeedButton;
RadioButton1: TRadioButton;
RadioButton2: TRadioButton;
RadioButton3: TRadioButton;
RadioButton4: TRadioButton;
RadioButton5: TRadioButton;
RadioButton6: TRadioButton;
RadioButton7: TRadioButton;
Panel1: TPanel;
Panel2: TPanel;
procedure SpeedButton8Click(Sender: TObject);
procedure SpeedButton9Click(Sender: TObject);
private
public
class function Execute(const code:String):String;
end;
var
Form38021: TForm38021;
implementation
{$R *.dfm}
class function TForm38021.Execute(const code:String):String;
var I:Integer;
begin
with Create(Application) do
begin
try
for I:=1 to Length(code) do TRadioButton(FindComponent('RadioButton'+code[I])).Checked:=true;
if ShowModal=mrYes then
begin
SetLength(Result,0);
for I:=1 to 7 do if TRadioButton(FindComponent('RadioButton'+IntToStr(I))).Checked then Result:=Result+IntToStr(I);
end
else Result:=code;
finally
Free;
end;
end;
end;
procedure TForm38021.SpeedButton8Click(Sender: TObject);
begin
ModalResult:=mrYes;
end;
procedure TForm38021.SpeedButton9Click(Sender: TObject);
begin
ModalResult:=mrNo;
end;
end.
object Form38021: TForm38021
Left = 997
Top = 370
BorderIcons = [biSystemMenu]
BorderStyle = bsSingle
Caption = 'Form38021'
ClientHeight = 134
ClientWidth = 299
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = []
OldCreateOrder = False
Position = poScreenCenter
PixelsPerInch = 96
TextHeight = 13
object SpeedButton8: TSpeedButton
Left = 98
Top = 103
Width = 40
Height = 22
Caption = 'Tak'
OnClick = SpeedButton8Click
end
object SpeedButton9: TSpeedButton
Left = 158
Top = 103
Width = 40
Height = 22
Caption = 'Nie'
OnClick = SpeedButton9Click
end
object Panel1: TPanel
Left = 8
Top = 8
Width = 137
Height = 89
BevelOuter = bvSpace
TabOrder = 0
object RadioButton1: TRadioButton
Left = 16
Top = 9
Width = 113
Height = 17
Caption = 'Do lewej'
Checked = True
TabOrder = 0
TabStop = True
end
object RadioButton2: TRadioButton
Left = 16
Top = 32
Width = 113
Height = 17
Caption = 'Do srodka'
TabOrder = 1
end
object RadioButton3: TRadioButton
Left = 16
Top = 55
Width = 113
Height = 17
Caption = 'Do prawej'
TabOrder = 2
end
end
object Panel2: TPanel
Left = 151
Top = 8
Width = 137
Height = 89
BevelOuter = bvSpace
TabOrder = 1
object RadioButton4: TRadioButton
Left = 15
Top = 9
Width = 113
Height = 17
Caption = 'Tekst'
Checked = True
TabOrder = 0
TabStop = True
end
object RadioButton5: TRadioButton
Left = 15
Top = 27
Width = 113
Height = 17
Caption = 'Liczba'
TabOrder = 1
end
object RadioButton6: TRadioButton
Left = 15
Top = 44
Width = 113
Height = 17
Caption = 'Waluta zloty'
TabOrder = 2
end
object RadioButton7: TRadioButton
Left = 15
Top = 64
Width = 113
Height = 17
Caption = 'Data sql'
TabOrder = 3
end
end
end
procedure TForm3802.EdiustawiCOLExcelClick(Sender: TObject);
begin
sGrid2.Cells[sGrid2.Col,1]:=Form38021.Execute(sGrid2.Cells[sGrid2.Col,1]);
end;