/doceditor/frmlink.pp

http://github.com/graemeg/lazarus · Puppet · 110 lines · 90 code · 20 blank · 0 comment · 1 complexity · 4cd212d991061c885ae32d5032a220df 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 FrmLink;
  23. {$mode objfpc}{$H+}
  24. interface
  25. uses
  26. Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, StdCtrls,
  27. Buttons, ButtonPanel;
  28. type
  29. { TLinkForm }
  30. TLinkForm = class(TForm)
  31. ButtonPanel1: TButtonPanel;
  32. CBTarget: TComboBox;
  33. ELinkText: TEdit;
  34. LLinkTarget: TLabel;
  35. LELinkText: TLabel;
  36. private
  37. function GetELT: Boolean;
  38. function GetL: TStrings;
  39. function GetLL: String;
  40. function GetLT: String;
  41. procedure SetELT(const AValue: Boolean);
  42. procedure SetL(const AValue: TStrings);
  43. procedure SetLL(const AValue: String);
  44. procedure SetLT(const AValue: String);
  45. { private declarations }
  46. public
  47. { public declarations }
  48. Property Links : TStrings Read GetL Write SetL;
  49. property Link : String Read GetLL Write SetLL;
  50. Property LinkText : String Read GetLT Write SetLT;
  51. Property EnableLinkText : Boolean Read GetELT Write SetELT;
  52. end;
  53. var
  54. LinkForm: TLinkForm;
  55. implementation
  56. {$R *.lfm}
  57. { TLinkForm }
  58. function TLinkForm.GetELT: Boolean;
  59. begin
  60. Result:=ELinkText.Enabled;
  61. end;
  62. function TLinkForm.GetL: TStrings;
  63. begin
  64. Result:=CBTarget.Items;
  65. end;
  66. function TLinkForm.GetLL: String;
  67. begin
  68. Result:=CBTarget.Text;
  69. end;
  70. function TLinkForm.GetLT: String;
  71. begin
  72. Result:=ELinkText.Text;
  73. end;
  74. procedure TLinkForm.SetELT(const AValue: Boolean);
  75. begin
  76. ELinkText.Enabled:=AValue
  77. end;
  78. procedure TLinkForm.SetL(const AValue: TStrings);
  79. begin
  80. CBTarget.Items.Assign(AValue);
  81. end;
  82. procedure TLinkForm.SetLL(const AValue: String);
  83. begin
  84. CBTarget.Text:=AValue;
  85. end;
  86. procedure TLinkForm.SetLT(const AValue: String);
  87. begin
  88. ELinkText.Text:=AValue;
  89. end;
  90. end.