home *** CD-ROM | disk | FTP | other *** search
/ synchro.net / synchro.net.tar / synchro.net / main / COMM / CTA6_SRC.ZIP / Config.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  2000-07-12  |  1.8 KB  |  77 lines

  1. unit Config;
  2.  
  3. interface
  4.  
  5. uses
  6.   Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, Main,
  7.   StdCtrls, Mask;
  8.  
  9. type
  10.   TfrmConfig = class(TForm)
  11.     Button1: TButton;
  12.     Button2: TButton;
  13.     GroupBox1: TGroupBox;
  14.     Label1: TLabel;
  15.     Label2: TLabel;
  16.     MaskEdit1: TMaskEdit;
  17.     MaskEdit2: TMaskEdit;
  18.     RadioButton1: TRadioButton;
  19.     RadioButton2: TRadioButton;
  20.     Label3: TLabel;
  21.     Label4: TLabel;
  22.     MaskEdit3: TMaskEdit;
  23.     MaskEdit4: TMaskEdit;
  24.     procedure FormCreate(Sender: TObject);
  25.     procedure Button1Click(Sender: TObject);
  26.     procedure RadioButton1Click(Sender: TObject);
  27.     procedure RadioButton2Click(Sender: TObject);
  28.   private
  29.     { Private declarations }
  30.   public
  31.     { Public declarations }
  32.   end;
  33.  
  34. var
  35.   frmConfig: TfrmConfig;
  36.  
  37. implementation
  38.  
  39. {$R *.DFM}
  40.  
  41. procedure TfrmConfig.FormCreate(Sender: TObject);
  42. begin
  43.   MaskEdit1.Text := IntToStr(MF.VgaEmu1.chrCols);
  44.   MaskEdit2.Text := IntToStr(MF.VgaEmu1.chrRows);
  45.   MaskEdit3.Text := IntToStr(MF.VgaEmu1.Width);
  46.   MaskEdit4.Text := IntToStr(MF.VgaEmu1.Height);
  47. end;
  48.  
  49. procedure TfrmConfig.Button1Click(Sender: TObject);
  50. var
  51.   col, row : integer;
  52. begin
  53.   if RadioButton1.Checked then begin
  54.     col := StrToInt(MaskEdit1.Text);
  55.     row := StrToInt(MaskEdit2.Text);
  56.     MF.VgaEmu1.setChrDim(col,row);
  57.   end else begin
  58.     col := StrToInt(MaskEdit3.Text);
  59.     row := StrToInt(MaskEdit4.Text);
  60.     MF.VgaEmu1.setResolution(col,row);
  61.   end;
  62. end;
  63.  
  64. procedure TfrmConfig.RadioButton1Click(Sender: TObject);
  65. begin
  66.   RadioButton1.Checked := true;
  67.   RadioButton2.Checked := false;
  68. end;
  69.  
  70. procedure TfrmConfig.RadioButton2Click(Sender: TObject);
  71. begin
  72.   RadioButton1.Checked := false;
  73.   RadioButton2.Checked := true;
  74. end;
  75.  
  76. end.
  77.