⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 umfguihelp.pas

📁 DelphiDoc is a program for automatic generation of documentation on a Delphi-Project. At the momen
💻 PAS
字号:
{  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 UMFGUIHelp;

{Contains a page to generate a documentation as a help about a GUI.
}

interface

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

type
  {A page to generate a documentation as a help about a GUI. }
  TMFGUIHelp = class(TMFGenerate)
  protected
    //Called when the generator changes.
    procedure StateGeneratorChanged(State: TJADDState); override;


    //Generates the documentation.
    function DoGenerate: Boolean; override;
    //Generates the documentation.
    procedure GenerateRequest; override;
  public

    //Called sometimes when the frame is to be replaced by another frame.
    procedure SelectNextFrame(var NewFrameClass: TMainFormFrameClass;
                              IsNext: Boolean); override;
  end;


implementation

{$R *.dfm}

{$IFDEF LINUX}
 {$DEFINE DONT_USE_MESSAGEGRID}
{$ENDIF}

uses SysUtils, Dialogs,
     General,
     UMakeDoc,
     UMFGenerator, UMFStatusText,
{$IFDEF DONT_USE_MESSAGEGRID}
     UMFGenerateMessages_kyl;
{$ELSE}
     UMFGenerateMessages;
{$ENDIF}







{Called sometimes when the frame is to be replaced by another frame. This
 method is ~[em not] always called before the frame is being replaced (and
 freed).
~param NewFrameClass the class of the frame that should replace this one
~param IsNext        if the next frame should be shown (instead of the previous
                     one) in some kind of an order }
procedure TMFGUIHelp.SelectNextFrame(var NewFrameClass: TMainFormFrameClass;
                                     IsNext: Boolean);
begin
 if IsNext then                                //next page should be shown?
  begin
   if FGenerated then                            //documentation new generated?
    if State.Generate.GetGenerateStatusText = '' then  //has status text?
     NewFrameClass :=                                    //show it
{$IFDEF DONT_USE_MESSAGEGRID}
                      TMFGenerateMessagesKylix
{$ELSE}
                      TMFGenerateMessages
{$ENDIF}
    else
     NewFrameClass := TMFStatusText;                     //show messages
  end
 else
  //generator does not support generating help about a GUI?
  if not (gcGUIHelp in State.Generate.GeneratorCapabilities) then
   NewFrameClass := TMFGenerator;                //select a new generator
end;









{Called when the generator changes.
~param State the state that has been changed }
procedure TMFGUIHelp.StateGeneratorChanged(State: TJADDState);
begin
 inherited StateGeneratorChanged(State);   //show its options

 //button only enabled, when the generator supports help about a GUI
 ButtonGenerate.Enabled := State.Generate.GeneratorAvailable and
                           (gcGUIHelp in State.Generate.GeneratorCapabilities);
end;








{Generates the documentation.
~result if the generation was successful }
function TMFGUIHelp.DoGenerate;
begin
 Result := State.GenerateGUIHelp;      //generate the help on a GUI
end;


{Handles the request to generate the documentation. Should call
 ~[link GenerateFrame] when the documentation should be generated. }
procedure TMFGUIHelp.GenerateRequest;
begin
 if (State.GUIHelpLogFiles.Count <> 0) or  //some log files added or confirmed?
    (MessageDlg('No log files have been added.' + LineDelimiter + 
                'Are you sure, you want to create an empty help?',
                mtWarning, [mbYes, mbCancel],
                ButtonGenerate.HelpContext) = mrYes) then
  begin
   FGenerated := True;                       //will generate documentation
   FSuccesfullyGenerated := GenerateFrame;   //generate the documentation
  end;
end;


end.
      

⌨️ 快捷键说明

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