/doceditor/frmmakeskel.pp

http://github.com/graemeg/lazarus · Puppet · 104 lines · 83 code · 21 blank · 0 comment · 1 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. Author: Michael Van Canneyt
  21. }
  22. unit FrmMakeSkel;
  23. {$mode objfpc}{$H+}
  24. interface
  25. uses
  26. Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, Buttons,
  27. StdCtrls, EditBtn, ButtonPanel, ExtCtrls;
  28. type
  29. { TMakeSkelForm }
  30. TMakeSkelForm = class(TForm)
  31. ButtonPanel1: TButtonPanel;
  32. CBDisableArguments: TCheckBox;
  33. CBDisableErrors: TCheckBox;
  34. CBDisablePrivate: TCheckBox;
  35. CBDisableProtected: TCheckBox;
  36. CBDisableResults: TCheckBox;
  37. CBDisableSeeAlso: TCheckBox;
  38. EAdditionalOptions: TEdit;
  39. EPackage: TEdit;
  40. FEinputFile: TFileNameEdit;
  41. FEoutputFIle: TFileNameEdit;
  42. Label1: TLabel;
  43. Label2: TLabel;
  44. Label3: TLabel;
  45. LEPackage: TLabel;
  46. Panel1: TGroupBox;
  47. Panel2: TGroupBox;
  48. procedure CheckEnabled(Sender: TObject);
  49. private
  50. procedure CheckOKEnabled;
  51. function InputFileOK: Boolean;
  52. function OutputFileOK: Boolean;
  53. function PackageOK: Boolean;
  54. { private declarations }
  55. public
  56. { public declarations }
  57. end;
  58. var
  59. MakeSkelForm: TMakeSkelForm;
  60. implementation
  61. {$R *.lfm}
  62. { TMakeSkelForm }
  63. procedure TMakeSkelForm.CheckEnabled(Sender: TObject);
  64. begin
  65. CheckOKEnabled;
  66. end;
  67. procedure TMakeSkelForm.CheckOKEnabled;
  68. begin
  69. ButtonPanel1.OkButton.Enabled:=PackageOK and InputFileOK and OutputFileOK;
  70. end;
  71. Function TMakeSkelForm.PackageOK : Boolean;
  72. begin
  73. Result:=(EPackage.Text<>'') and IsValidIdent(EPackage.Text);
  74. end;
  75. Function TMakeSkelForm.InputFileOK : Boolean;
  76. begin
  77. Result:=(FEInputFile.Text<>'') and (FEInputFile.Text<>FEOutputFile.Text)
  78. end;
  79. Function TMakeSkelForm.OutputFileOK : Boolean;
  80. begin
  81. Result:=(FEOutputFile.Text<>'') and (FEInputFile.Text<>FEOutputFile.Text)
  82. end;
  83. end.