upluginutils.pas

来自「Delphi编写的一个支持语法高亮显示和很多语言的文本编辑器」· PAS 代码 · 共 66 行

PAS
66
字号
{
+------------------------------------------------------------------------------+
| This is a simple plugin wrapper class.  It only provides one function at the |
| moment but that one function is enough to do a whole lot of things with.     |
+------------------------------------------------------------------------------+
| Function:                                                                    |
+------------------------------------------------------------------------------+
| GetSelDoc - No parameters are required.  Returns the selected document on    |
| the cEdit window if there is one as a TFrmDoc.  With this you can get text,  |
| add text, modify text, etc.  Treat it just like it is in cEdit itself and    |
| your adding code to do something in cEdit.                                   |
+------------------------------------------------------------------------------+

}
unit uPluginUtils;

interface



uses    Windows,
   Messages,
   SysUtils,
   Classes,
   Dialogs,
   Forms,
   uPlugin,
   fDoc,
   fMain,
   dMain,
   synedit;



type
  TGetSelDoc=function:TfrmDoc;
  function GetSelDoc: TfrmDoc;
type
  TSetLang=procedure(strLang: string);
  procedure SetLang(strLang: String);

var AppHost: Tapplication;  

implementation


procedure SetLang(strLang: String);
begin

  TSetLang(TSetLang (GetProcAddress(Application.Handle,'SetLang')))(strLang);
end;


function GetSelDoc: TfrmDoc;
var
  frm: TFrmDoc;
begin

  frm:=TFrmDoc(TGetSelDoc (GetProcAddress(Application.Handle,'GetDoc')));
  if frm <> nil then
    GetSelDoc := frm
  else
    frm := GetSelDoc;
end;
end.

⌨️ 快捷键说明

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