umfshowsource.pas

来自「DelphiDoc is a program for automatic gen」· PAS 代码 · 共 83 行

PAS
83
字号
{  JADD - Just Another DelphiDoc: Documentation from Delphi Source Code

Copyright (C) 2002-2008   Gerold Veith

This file is part of JADD - Just Another DelphiDoc.

DelphiDoc is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License version 3 as
published by the Free Software Foundation.

DelphiDoc is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.
}


unit UMFShowSource;

{Contains a simple page with a button to show the form showing the souce code.
}

interface

uses Classes, Forms, Controls, StdCtrls, ExtCtrls,
     UMainFormFrame,
     UJADDState;

type
  {A simple page with a button to show the form showing the souce code. }
  TMFShowSource = class(TMainFormFrame)
    ButtonShowSourceCode: TButton;
    procedure ButtonShowSourceCodeClick(Sender: TObject);
  private
  protected
    //Called when the list of parsed file changes.
    procedure StateFileListChanged(State: TJADDState); override;
  public
 end;


implementation

{$R *.dfm}


uses UPascalConsts;



{Called when the list of parsed file changes.
~param State the state that has been changed }
procedure TMFShowSource.StateFileListChanged(State: TJADDState);
begin                 //only show form to show soucre code if data is available
 ButtonShowSourceCode.Enabled := assigned(State.FileList) and
                                 not State.FileList.IsEmpty;
end;




{Called when the button to show the source code of the current parsed data if
 chosen.
~param Sender the sender of the event, ~[link ButtonShowSourceCode] }
procedure TMFShowSource.ButtonShowSourceCodeClick(Sender: TObject);
var       Position     :TPosition;             //beginning of the file
begin
 if assigned(State.FileList) and not State.FileList.IsEmpty and
    assigned(ShowSourceCode) then
  begin
   Position.Row := 0;                            //show beginning of file
   Position.Column := 1;
                                                 //show beginning of first file
   ShowSourceCode(Self, nil, State.FileList[0], Position,
                             State.FileList[0], Position);
  end;
end;

end.
     

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?