PageRenderTime 29ms CodeModel.GetById 12ms app.highlight 14ms RepoModel.GetById 2ms app.codeStats 0ms

/doceditor/frmmakeskel.pp

http://github.com/graemeg/lazarus
Pascal | 104 lines | 56 code | 20 blank | 28 comment | 0 complexity | defcc457f471809abc04aaa5e5be0335 MD5 | raw file
  1{
  2 ***************************************************************************
  3 *                                                                         *
  4 *   This source is free software; you can redistribute it and/or modify   *
  5 *   it under the terms of the GNU General Public License as published by  *
  6 *   the Free Software Foundation; either version 2 of the License, or     *
  7 *   (at your option) any later version.                                   *
  8 *                                                                         *
  9 *   This code is distributed in the hope that it will be useful, but      *
 10 *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
 11 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
 12 *   General Public License for more details.                              *
 13 *                                                                         *
 14 *   A copy of the GNU General Public License is available on the World    *
 15 *   Wide Web at <http://www.gnu.org/copyleft/gpl.html>. You can also      *
 16 *   obtain it by writing to the Free Software Foundation,                 *
 17 *   Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.        *
 18 *                                                                         *
 19 ***************************************************************************
 20
 21  Author: Michael Van Canneyt
 22}
 23unit FrmMakeSkel;
 24
 25{$mode objfpc}{$H+}
 26
 27interface
 28
 29uses
 30  Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, Buttons,
 31  StdCtrls, EditBtn, ButtonPanel, ExtCtrls;
 32
 33type
 34
 35  { TMakeSkelForm }
 36
 37  TMakeSkelForm = class(TForm)
 38    ButtonPanel1: TButtonPanel;
 39    CBDisableArguments: TCheckBox;
 40    CBDisableErrors: TCheckBox;
 41    CBDisablePrivate: TCheckBox;
 42    CBDisableProtected: TCheckBox;
 43    CBDisableResults: TCheckBox;
 44    CBDisableSeeAlso: TCheckBox;
 45    EAdditionalOptions: TEdit;
 46    EPackage: TEdit;
 47    FEinputFile: TFileNameEdit;
 48    FEoutputFIle: TFileNameEdit;
 49    Label1: TLabel;
 50    Label2: TLabel;
 51    Label3: TLabel;
 52    LEPackage: TLabel;
 53    Panel1: TGroupBox;
 54    Panel2: TGroupBox;
 55    procedure CheckEnabled(Sender: TObject);
 56  private
 57    procedure CheckOKEnabled;
 58    function InputFileOK: Boolean;
 59    function OutputFileOK: Boolean;
 60    function PackageOK: Boolean;
 61    { private declarations }
 62  public
 63    { public declarations }
 64  end; 
 65
 66var
 67  MakeSkelForm: TMakeSkelForm;
 68
 69implementation
 70
 71{$R *.lfm}
 72
 73{ TMakeSkelForm }
 74
 75procedure TMakeSkelForm.CheckEnabled(Sender: TObject);
 76begin
 77  CheckOKEnabled;
 78end;
 79
 80procedure TMakeSkelForm.CheckOKEnabled;
 81begin
 82   ButtonPanel1.OkButton.Enabled:=PackageOK and InputFileOK and OutputFileOK;
 83end;
 84
 85Function TMakeSkelForm.PackageOK : Boolean;
 86
 87begin
 88  Result:=(EPackage.Text<>'') and IsValidIdent(EPackage.Text);
 89end;
 90
 91Function TMakeSkelForm.InputFileOK : Boolean;
 92
 93begin
 94  Result:=(FEInputFile.Text<>'') and (FEInputFile.Text<>FEOutputFile.Text)
 95end;
 96
 97Function TMakeSkelForm.OutputFileOK : Boolean;
 98
 99begin
100  Result:=(FEOutputFile.Text<>'') and (FEInputFile.Text<>FEOutputFile.Text)
101end;
102
103end.
104