ORKER

Top  Previous  Next

unit StOrker;

 

interface

 

uses SysUtils, WinTypes, WinProcs, Classes, Graphics, Forms, Controls, Buttons,

StdCtrls, ExtCtrls, Dialogs, AlmType, Stmap16, DGrafik;

 

type

TOrkerDlg = class(TForm)

  OKBtn: TBitBtn;

  CancelBtn: TBitBtn;

  Bevel1: TBevel;

  RadioGroup1: TRadioGroup;

  Image2: TImage;

  ComboBox2: TComboBox;

  ComboBox1: TComboBox;

  procedure FormActivate(Sender: TObject);

  procedure Image2Click(Sender: TObject);

  procedure RadioGroup1Click(Sender: TObject);

  procedure CancelBtnClick(Sender: TObject);

  procedure ComboBox2Change(Sender: TObject);

  procedure ComboBox1Change(Sender: TObject);

  procedure OKBtnClick(Sender: TObject);

private

  { Private declarations }

public

  { Public declarations }

end;

 

TStOrkereszt = class(TComponent)

private

  FStellaMap    : TStellaMap;

protected

public

  constructor Create(AOwner:TComponent);override;

  destructor Destroy;override;

  procedure Execute;

published

  property StellaMapSource: TStellaMap read FStellaMap write FStellaMap;

end;

 

var

OrkerDlg: TOrkerDlg;

stm: TStellaMap;

cww: TMapConfig;

 

procedure Register;

 

implementation

 

{$R *.DFM}

 

procedure Register;

begin

   RegisterComponents('AL',[TStOrkereszt]);

end;

 

procedure TStOrkereszt.Execute;

begin

If StellaMapSource<>nil then begin

   stm := StellaMapSource;

   OrkerDlg := TOrkerDlg.Create(Self);

   With OrkerDlg do begin

        ShowModal;

        Free;

   end;

end;

end;

 

constructor TStOrkereszt.Create(AOwner:TComponent);

begin

inherited Create(AOwner);

end;

 

destructor TStOrkereszt.Destroy;

begin

   inherited Destroy;

end;

 

procedure TOrkerDlg.FormActivate(Sender: TObject);

begin

cww:=stm.cw;

If stm.orkereszt then RadioGroup1.Itemindex := 0

   else RadioGroup1.Itemindex := 1;

ComboBox2.text:=IntToStr(cww.orkereszttav);

Combobox1.Itemindex:=cww.orkeresztstilus;

Cls(Image2.Canvas,cww.orkeresztszin);

end;

 

procedure TOrkerDlg.Image2Click(Sender: TObject);

var ColorDialog1: TColorDialog;

begin

ColorDialog1:=TColorDialog.Create(Application);

ColorDialog1.Color:=stm.cw.orkeresztszin;

If ColorDialog1.Execute then begin

   stm.cw.orkeresztszin := ColorDialog1.Color;

   Cls(Image2.Canvas,stm.cw.orkeresztszin);

end;

ColorDialog1.Free;

stm.refresh;

end;

 

procedure TOrkerDlg.RadioGroup1Click(Sender: TObject);

begin

stm.orkereszt:=RadioGroup1.Itemindex = 0;

stm.refresh;

end;

 

procedure TOrkerDlg.ComboBox2Change(Sender: TObject);

begin

stm.cw.orkereszttav:=Strtoint(ComboBox2.text);

stm.refresh;

end;

 

procedure TOrkerDlg.ComboBox1Change(Sender: TObject);

begin

stm.cw.orkeresztstilus:=Combobox1.Itemindex;

stm.refresh;

end;

 

procedure TOrkerDlg.CancelBtnClick(Sender: TObject);

begin

stm.cw:=cww;

Close;

end;

 

procedure TOrkerDlg.OKBtnClick(Sender: TObject);

begin

Close;

end;

 

end.