unit settings;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, CheckLst, ExtCtrls, SRGrad, SRWave, SRChkBox, MPlayer;

type
  TSetting = class(TForm)
    rg1: TRadioGroup;
    rg2: TRadioGroup;
    rg3: TRadioGroup;
    btn1: TButton;
    shp1: TSRGradient;
    srchckbx1: TSRCheckBox;
    mp1: TMediaPlayer;
    procedure FormCreate(Sender: TObject);
    procedure btn1Click(Sender: TObject);
    procedure FormActivate(Sender: TObject);
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
    procedure shp1MouseDown(Sender: TObject; Button: TMouseButton;
      Shift: TShiftState; X, Y: Integer);
    procedure rg2Click(Sender: TObject);
    procedure rg1Click(Sender: TObject);
  private
    { Private declarations }
  public
    dif: byte;
  end;

var
  Setting: TSetting;

implementation

uses Unit3, Unit2, Unit4, Unit5;

{$R *.dfm}

procedure TSetting.FormCreate(Sender: TObject);
var
 PointsArray : Array[0..61] of TPoint;
 FirstRegion, SecondRegion, CombineRegion : THandle;
begin
  dif:= 0;
 FirstRegion := CreateEllipticRGN(0, 0, 754, 119);
 SecondRegion := CreateEllipticRGN(13, 357, 767, 476);
   CombineRGN(FirstRegion, FirstRegion, SecondRegion, RGN_Or);
 CombineRegion := FirstRegion;
 FirstRegion := CreateRectRGN(91, 51, 676, 425);
   CombineRGN(CombineRegion, CombineRegion, FirstRegion, RGN_Or);
// CombineRGN(CombineRegion, CombineRegion, FirstRegion, RGN_Or);
 PointsArray[0] := Point(676, 379);
 PointsArray[1] := Point(679, 367);
 PointsArray[2] := Point(676, 358);
 PointsArray[3] := Point(682, 345);
 PointsArray[4] := Point(674, 319);
 PointsArray[5] := Point(680, 299);
 PointsArray[6] := Point(674, 262);
 PointsArray[7] := Point(684, 232);
 PointsArray[8] := Point(674, 183);
 PointsArray[9] := Point(684, 155);
 PointsArray[10] := Point(671, 118);
 PointsArray[11] := Point(677, 91);
 PointsArray[12] := Point(620, 90);
 PointsArray[13] := Point(619, 375);
   FirstRegion := CreatePolygonRGN(PointsArray, 14, Winding);
   CombineRGN(CombineRegion, CombineRegion, FirstRegion, RGN_Or);
{
 CombineRGN(CombineRegion, CombineRegion, FirstRegion, RGN_Or);
 CombineRGN(CombineRegion, CombineRegion, FirstRegion, RGN_Or);
 CombineRGN(CombineRegion, CombineRegion, FirstRegion, RGN_Or);
}
 PointsArray[0] := Point(126, 93);
 PointsArray[1] := Point(90, 100);
 PointsArray[2] := Point(84, 114);
 PointsArray[3] := Point(82, 129);
 PointsArray[4] := Point(87, 137);
 PointsArray[5] := Point(91, 144);
 PointsArray[6] := Point(86, 155);
 PointsArray[7] := Point(84, 160);
 PointsArray[8] := Point(83, 171);
 PointsArray[9] := Point(86, 176);
 PointsArray[10] := Point(91, 186);
 PointsArray[11] := Point(95, 201);
 PointsArray[12] := Point(92, 215);
 PointsArray[13] := Point(88, 221);
 PointsArray[14] := Point(86, 221);
 PointsArray[15] := Point(87, 287);
 PointsArray[16] := Point(94, 307);
 PointsArray[17] := Point(99, 325);
 PointsArray[18] := Point(99, 337);
 PointsArray[19] := Point(90, 349);
 PointsArray[20] := Point(83, 363);
 PointsArray[21] := Point(77, 374);
 PointsArray[22] := Point(74, 384);
 PointsArray[23] := Point(75, 392);
 PointsArray[24] := Point(81, 393);
 PointsArray[25] := Point(86, 393);
 PointsArray[26] := Point(92, 393);
 PointsArray[27] := Point(97, 392);
 PointsArray[28] := Point(96, 378);
 PointsArray[29] := Point(85, 368);
 PointsArray[30] := Point(75, 358);
 PointsArray[31] := Point(72, 347);
 PointsArray[32] := Point(78, 337);
 PointsArray[33] := Point(90, 329);
 PointsArray[34] := Point(98, 325);
 PointsArray[35] := Point(106, 315);
 PointsArray[36] := Point(107, 309);
 PointsArray[37] := Point(95, 301);
 PointsArray[38] := Point(84, 292);
 PointsArray[39] := Point(76, 284);
 PointsArray[40] := Point(72, 273);
 PointsArray[41] := Point(76, 261);
 PointsArray[42] := Point(89, 250);
 PointsArray[43] := Point(99, 244);
 PointsArray[44] := Point(105, 240);
 PointsArray[45] := Point(97, 230);
 PointsArray[46] := Point(80, 222);
 PointsArray[47] := Point(72, 213);
 PointsArray[48] := Point(70, 204);
 PointsArray[49] := Point(79, 197);
 PointsArray[50] := Point(96, 191);
 PointsArray[51] := Point(104, 185);
 PointsArray[52] := Point(101, 175);
 PointsArray[53] := Point(86, 158);
 PointsArray[54] := Point(72, 150);
 PointsArray[55] := Point(68, 138);
 PointsArray[56] := Point(78, 124);
 PointsArray[57] := Point(89, 114);
 PointsArray[58] := Point(93, 108);
 PointsArray[59] := Point(97, 101);
 PointsArray[60] := Point(117, 94);
 PointsArray[61] := Point(127, 91);
   FirstRegion := CreatePolygonRGN(PointsArray, 62, Winding);
   CombineRGN(CombineRegion, CombineRegion, FirstRegion, RGN_Or);
 PointsArray[0] := Point(693, 382);
 PointsArray[1] := Point(686, 359);
 PointsArray[2] := Point(668, 342);
 PointsArray[3] := Point(665, 334);
 PointsArray[4] := Point(677, 325);
 PointsArray[5] := Point(688, 317);
 PointsArray[6] := Point(694, 310);
 PointsArray[7] := Point(684, 292);
 PointsArray[8] := Point(660, 276);
 PointsArray[9] := Point(655, 263);
 PointsArray[10] := Point(665, 242);
 PointsArray[11] := Point(682, 228);
 PointsArray[12] := Point(688, 214);
 PointsArray[13] := Point(682, 196);
 PointsArray[14] := Point(658, 175);
 PointsArray[15] := Point(650, 162);
 PointsArray[16] := Point(671, 143);
 PointsArray[17] := Point(685, 131);
 PointsArray[18] := Point(684, 118);
 PointsArray[19] := Point(670, 103);
 PointsArray[20] := Point(662, 99);
 PointsArray[21] := Point(646, 99);
 PointsArray[22] := Point(640, 102);
 PointsArray[23] := Point(640, 134);
 PointsArray[24] := Point(646, 194);
 PointsArray[25] := Point(644, 266);
 PointsArray[26] := Point(672, 340);
 PointsArray[27] := Point(676, 355);
 PointsArray[28] := Point(676, 366);
   FirstRegion := CreatePolygonRGN(PointsArray, 29, Winding);
   CombineRGN(CombineRegion, CombineRegion, FirstRegion, RGN_Or);
     SetWindowRGN(Handle, CombineRegion, true);
end;

procedure TSetting.btn1Click(Sender: TObject);
begin
  Close;
end;

procedure TSetting.FormActivate(Sender: TObject);
begin
  TopMenu.Visible := False;
end;

procedure TSetting.FormClose(Sender: TObject; var Action: TCloseAction);
var b: Variant;
begin
  TopMenu.Visible := True;

    shadow.shp1.Visible := false;
  shadow.Width := 986;
  shadow.Height:= 706;
  b:= (Screen.Width/2)  - (shadow.Width/2);
    shadow.Left:=b;
  b:= (Screen.Height/2) - (shadow.Height/2);
    shadow.Top:= b;

     if srchckbx1.Checked = True then
        SG.NotCreate:= false;
  srchckbx1.Checked:= false;

  SG.Visible:= True;
  GG.Visible:= True;
  SetActiveWindow(SG.Handle);
end;

procedure TSetting.shp1MouseDown(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
begin
  ReleaseCapture;
  Setting.Perform(WM_SYSCOMMAND, $f012, 0);
end;

procedure TSetting.rg2Click(Sender: TObject);
begin
  if rg2.ItemIndex = 0 then
     mp1.Play;

  if rg2.ItemIndex = 1 then
     mp1.Stop;
end;

procedure TSetting.rg1Click(Sender: TObject);
  begin
    SG.EnmCnt:= rg1.ItemIndex + 1;
    if SG.EnmCnt = 0 then SG.EnmCnt:=1;
  end;

end.
