PageRenderTime 35ms CodeModel.GetById 14ms app.highlight 18ms RepoModel.GetById 1ms app.codeStats 1ms

/doceditor/frmlink.pp

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