unit MySetupDialog;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, ExtCtrls;

type
  TSetupDlg = class(TForm)
    Label1: TLabel;
    RadioGroup1: TRadioGroup;
    Button1: TButton;
    Button2: TButton;
  private
    { Private declarations }
  public
    Function Execute(PreSelect: Integer): Boolean;
  end;

var
  SetupDlg: TSetupDlg;

implementation

{$R *.dfm}

{ TSetupDlg }

function TSetupDlg.Execute(PreSelect: Integer): Boolean;
begin
 // Load your current setting onto the form
 // here I will only set the radiogroup index, you would probably
 // want to use the registry to store your settings.
 RadioGroup1.ItemIndex := PreSelect;
 // Show the form and wait for user input
 // the "OK" button has a ModalResult of mrOK and "Cancel" has mrCancel
 // you can call your buttons what you like, but stick to mrXXX.
 Result := Showmodal = mrOK;
 // If the user has clicked to "OK" button then the result of this function
 // is true and then you probably want to save the information.
 If Result then begin
  // Perform your save - Again I would recommend the registry.
  // The Class TRegistry is a powerfull wrapper for it.
 end;
end;

end.
