www.pudn.com > Roulette.rar > Setting.pas


unit Setting; 
 
interface 
 
uses 
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, 
  Dialogs, StdCtrls, ExtCtrls, TltConst; 
 
type 
  TSettingForm = class(TForm) 
    Button1: TButton; 
    Button2: TButton; 
    Label2: TLabel; 
    Edit1: TEdit; 
    Label3: TLabel; 
    Edit2: TEdit; 
    Label5: TLabel; 
    ComboBox1: TComboBox; 
    Label4: TLabel; 
    Edit3: TEdit; 
    CheckBox1: TCheckBox; 
    Bevel1: TBevel; 
  private 
    { Private declarations } 
  public 
    { Public declarations } 
  end; 
 
  function SetGame(var AGameParams : TGameParams) : boolean; 
implementation 
 
{$R *.dfm} 
function SetGame(var AGameParams : TGameParams) : Boolean; 
var 
  SettingForm : TSettingForm; 
begin 
  Result := false; 
  SettingForm := TSettingForm.Create(Application); 
  try 
    with SettingForm do 
    begin 
      SettingForm.Edit1.Text := IntToStr(AGameParams.BelTime); 
      SettingForm.Edit2.Text := IntToStr(AGameParams.BeforeWheelTime); 
      SettingForm.Edit3.Text := IntToStr(AGameParams.Bleed); 
      SettingForm.ComboBox1.Text := IntToStr(AGameParams.Rate); 
      ShowModal; 
      if IDOK = ModalResult then 
      begin 
        AGameParams.BelTime := StrToInt(SettingForm.Edit1.Text); 
        AGameParams.BeforeWheelTime := StrToInt(SettingForm.Edit2.Text); 
        AGameParams.Bleed := StrToInt(SettingForm.Edit3.Text); 
        AGameParams.Rate := StrToInt(SettingForm.ComboBox1.Text); 
        Result := true; 
      end; 
    end; 
  finally 
    SettingForm.Free; 
  end; 
end; 
end.