亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? web.pas

?? Delphi編寫的一個支持語法高亮顯示和很多語言的文本編輯器
?? PAS
?? 第 1 頁 / 共 3 頁
字號:
unit web;

{This unit encapsulates SHDocVw.dll and MSHTML.dll functionality by subclassing
TWebBrowser object as TWeb object

TWeb was designed for easy use of HTML display and editing capacity in
SuperMemo 2002 for Windows developed by SuperMemo R&D in Fall 2001.

SuperMemo 2002 implements HTML-based incremental reading in which extensive HTML
support is vital

Pieces of this units can be used by anyone in other Delphi applications that make
use of HTML WYSIWYG interfaces made open by Microsoft

Please send comments, questions, suggestions for improvements or bugs to:
bugs(AT)supermemo(.)com}

{IMPORTANT! you need to assign TWinControl(Web).Parent to make Web:TWeb visible}
{For example, putting TWeb on a panel:
   TheWeb:=TWeb.Create(Panel);
   TheWeb.TheParent:=Self; //Form parenting the panel
   TWinControl(TheWeb).Parent:=Panel;
   TWinControl(TheWeb).Align:=alClient;
   TheWeb.Tag:=1; //Set different Tag if more TWeb's placed in a form}

interface

uses SysUtils,WinTypes,
     ActiveX,MSHTMLEvents2,SHDocVw_TLB, MSHTML_TLB,
     IeConst,Classes,Forms,Graphics;

const
  CGID_MSHTML:TGUID='{DE4BA900-59CA-11CF-9592-444553540000}';
  IID_IOleCommandTarget:TGUID='{B722BCCB-4E68-101B-A2BC-00AA00404770}';
  CGID_WebBrowser:TGUID='{ED016940-BD5B-11cf-BA4E-00C04FD70816}';
  FontScale=3;

var IEStr,LastHyperlink:string;
    ApplicationOnMessage:TMessageEvent; {set to Forms.Application.OnMessage when creating the main form}
    OnMessageCompNo:byte;

type TWeb=class(TWebBrowser)
          public
             Modified,ReadOnly,Extrinsic,SuperMemoMenu,_Filter:boolean;
             TheDoc:IHTMLDocument2; //MSHTML HTML Document 2 interface
             TheWind:IHTMLWindow2;
             DocCmd,WebCmd:IOleCommandTarget; //MSHTML IOLECommandTarget interface
             Editable:boolean;
             TheSlot,TheTextPosit:integer;
             LastClickX,LastClickY:integer;
             TheParent:TForm;
             ElWind:byte; {pointer reference error protection; to occlude ElementWindow.ElWind in SuperMemo}
             LoadedHTMLFile:string;
             procedure Clear;
             procedure Save;
             procedure SaveAs(DefaultName:string);
             function SaveFile(Filename:string):boolean;
             procedure Print;
             procedure SetState(Edit:boolean);
             procedure LoadFile(FileName:string);
             procedure StatusTextChange(Sender: TObject; const Text: WideString);
             procedure CommandStateChange(Sender: TObject; Command: Integer; Enable: WordBool);
             procedure BeforeNavigate2(Sender: TObject;const pDisp: IDispatch;
                 var URL: OleVariant;var Flags: OleVariant;var TargetFrameName:OleVariant;
                 var PostData: OleVariant;var Headers: OleVariant;var Cancel: WordBool);
             procedure NavigateComplete2(Sender: TObject;const pDisp: IDispatch; var URL: OleVariant);
             constructor Create(Owner:TComponent); override;
             destructor Destroy; override;
             procedure SetFocus; override;
             function SourceText:string;
             procedure SetSelection(Start,Length:integer);
             function GetTextRange:IHtmlTxtRange;
             function SelStart:integer;
             function SelEnd:integer;
             function SelLength:integer;
             procedure SetBackgroundColor(Color:TColor);
             function GetBackgroundColor:TColor;
             procedure SetHTMLText(HTML:WideString);
             procedure WaitLoad(peek:boolean);
             function GetScrollTop:integer;
             procedure SetScrollTop(ScrollTop:integer);
             function GetHTMLSelection:WideString;
             procedure ClearSelection;
             procedure ReplaceSelection(HTML:string);
             procedure SetFont(AFont:TFont;SetFontMode:byte);
             function Text:string;
             procedure SetBorder(Border:boolean);
             procedure SetScrollBar(ScrollBar:boolean);
             procedure Undo;
             procedure GetFont(var AFont:TFont);
             procedure FontDialog;
             function  SpecialCommand(Cmd : Cardinal; PromptUser : boolean;
                       editModeOnly : boolean; bTriEditCommandGroup : boolean;
                       InputArgs : OleVariant) : HRESULT;
             procedure ToggleBullet;
             procedure ToggleNumbering;
             procedure Indent(Indent:boolean);
             procedure Align(IDM:integer);
             function SelText:string;
             procedure Paste;
             procedure Copy;
             procedure Cut;
             procedure Delete;
             procedure SelectAll;
             procedure SetText(HTML:string);
             procedure CompleteLoading;
             function CompNo:byte;
             function Visible:boolean;
             procedure Find;
             procedure Subscript;
             procedure Superscript;
             {end public}
          private
             OleInPlaceActiveObject: IOleInPlaceActiveObject;
             Events:TMSHTMLHTMLDocumentEvents;
             CtrlToBeProcessed,ShiftToBeProcessed:boolean;
             procedure SuperMemoMessageHandler(var Msg: TMsg; var Handled: Boolean);
             procedure OnMouseDown(Sender:TObject);
             procedure OnMouseUp(Sender:TObject);
             procedure OnMouseMove(Sender:TObject);
             procedure OnMouseOver(Sender:TObject);
             procedure OnMouseOut(Sender:TObject);
             function OnClick(Sender:TObject):WordBool;
             function OnSelectStart(Sender:TObject):WordBool;
             procedure OnFocusOut(Sender:TObject);
             procedure OnFocusIn(Sender:TObject);
             function OnContextMenu(Sender:TObject):WordBool;
             function OnKeyPress(Sender:TObject):WordBool;
             procedure OnKeyDown(Sender:TObject);
             procedure OnKeyUp(Sender:TObject);
             procedure ClickPoint(X,Y:integer);
             procedure DefineEvents;
             function HyperlinkClicked:boolean;
             function HrExecCommand(ucmdID: cardinal;
                       const pVarIn: OleVariant; var pVarOut: OleVariant; bPromptUser,
                       bTriEditCmdGroup: boolean): HResult;
             procedure ProcessLoadMessages;
             procedure SetBorderWidth;
             procedure ReassignKeyboardHandler(CompNo:byte;TurnOn:boolean);
            {end private}
          end;

implementation

uses WinProcs,Messages,Controls,Variants,Clipbrd;
     {Pieces of code specific to SuperMemo are marked as: SMSpecific:}
     {SMSpecific:}{These units are specific to SuperMemo}
{     const8,Basic,Dial,Files,Component,
     DBDat,Col,Option,LayoutMan,ElementWindow,Main;}

var PtrWGUID,PtrMGUID,PtrDGUID:PGUID;
    NULL:OleVariant;

constructor TWeb.Create(Owner:TComponent);
begin
  inherited Create(Owner);
  LoadedHTMLFile:='';
  OnBeforeNavigate2:=BeforeNavigate2;
  OnStatusTextChange:=StatusTextChange;
  OnCommandStateChange:=CommandStateChange;
  OnNavigateComplete2:=NavigateComplete2;
  TheDoc:=nil;
  DocCmd:=nil;
  WebCmd:=nil;
  Modified:=false;
  SuperMemoMenu:=true; {SMSpecific}
  LastClickX:=0;
  LastClickY:=0;
  ReadOnly:=false;
  CtrlToBeProcessed:=false;
  ShiftToBeProcessed:=false;
  Events:=nil;
end;

destructor TWeb.Destroy;
begin
  ReassignKeyboardHandler(Tag,false);
  inherited Destroy;
end;

procedure TWeb.SaveAs(DefaultName:string);
begin
  if TheDoc=nil then
     exit;
  TheDoc.ExecCommand('SaveAs',false,DefaultName);
  Modified:=false;
end;

procedure TWeb.Print;
begin
  ExecWB(OLECMDID_PRINT,OLECMDEXECOPT_PROMPTUSER,NULL,NULL);
end;

procedure TWeb.Save;
var
  sHTML:string;
  fsOut:TFileStream;
begin
  sHTML:=SourceText;
  fsOut:=TFileStream.Create(TheDoc.URL,fmCreate or fmShareExclusive);
  try
    fsOut.Write(pchar(sHTML)^, length(sHTML));
  finally
    fsOut.Free;
    Modified:=false;
  end;
end;

procedure TWeb.OnKeyUp(Sender:TObject);
begin {those empty handlers are needed for the keyboard and mouse to behave correctly with EventSink!}
  {nop}
end;

procedure TWeb.OnMouseMove(Sender:TObject);
begin
 {nop}
end;

procedure TWeb.OnMouseOver(Sender:TObject);
begin
  {nop}
end;

procedure TWeb.OnMouseOut(Sender:TObject);
begin
 {nop}
end;

function TWeb.OnClick(Sender:TObject):WordBool;
begin
  Result:=true;
end;

function TWeb.OnSelectStart(Sender:TObject):WordBool;
begin
  Result:=true;
end;

procedure TWeb.OnMouseUp(Sender:TObject);
begin
  {nop}
end;

procedure TWeb.Clear;
begin
  TheTextPosit:=0;
  SetHTMLText('');
end;

function TWeb.SelStart:integer;
var TextRange:IHtmlTxtRange;
begin
  Result:=0;
  TextRange:=GetTextRange;
  if TextRange=nil then
     exit;
//  Result:=Abs(Integer(TextRange.move('character',-MaxTextLength)));
end;

function TWeb.SelEnd:integer;
var TextRange:IHtmlTxtRange;
begin
  Result:=0;
  TextRange:=GetTextRange;
  if TextRange=nil then
     exit;
//  Result:=Abs(Integer(TextRange.MoveEnd('character',-MaxTextLength)));
end;

function TWeb.SelLength:integer;
begin
  Result:=SelEnd-SelStart;
end;

function TWeb.GetScrollTop:integer;
var FocusElement:IHTMLElement2;
begin
  Result:=0;
  try
     if TheDoc=nil then
        exit;
     FocusElement:=TheDoc.ActiveElement as IHTMLElement2;
     if FocusElement=nil then
        exit;
     Result:=FocusElement.ScrollTop;
  except
//    on E:Exception do EError('Cannot get scroll top position',E);
    end;
end;

function TWeb.GetHTMLSelection:WideString;
var TextRange:IHtmlTxtRange;
begin
  Result:='';
  TextRange:=GetTextRange;
  if TextRange=nil then
     exit;
  Result:=TextRange.HTMLText;
end;

procedure TWeb.ClearSelection;
begin
  if TheDoc=nil then
     exit;
  TheDoc.Selection.Clear;
  Modified:=true;
end;

procedure TWeb.ReplaceSelection(HTML:string);
var TextRange:IHtmlTxtRange;
begin
  try
     TextRange:=GetTextRange;
     if TextRange=nil then
        exit;
     TextRange.PasteHTML(HTML); {Warning! pasting relative paths will result in conversion to absolute paths!}
     Modified:=true;
  except
   on E:Exception do begin
//      ShortenString(HTML,80);
//      EError('Error pasting HTML'+nl+
//      'Microsoft HTML refuses to paste this string:'+nl+
//      HTML+nl,E);
      end;
   end;
end;

procedure TWeb.SetFont(AFont:TFont;SetFontMode:byte);
begin
end;

procedure TWeb.SetBorder(Border:boolean);
begin
  if TheDoc=nil then
     exit;
  if TheDoc.body=nil then
     exit;
  if not Border then begin
     if not Editable then begin
        TheDoc.body.style.borderStyle:='none';
        TheDoc.body.style.borderWidth:='thin';
        TheDoc.body.style.borderColor:='white';
        end;
     if Editable then begin
        TheDoc.body.style.borderStyle:='none';
        TheDoc.body.style.borderWidth:='thin';
        TheDoc.body.style.borderColor:='blue';
        end;
     end;
  if Border then begin
     if not Editable then begin
        TheDoc.body.style.borderStyle:='solid';
        TheDoc.body.style.borderWidth:='thin';
        TheDoc.body.style.borderColor:='silver';
        end;
     if Editable then begin
        TheDoc.body.style.borderStyle:='solid';
        TheDoc.body.style.borderWidth:='thin';
        TheDoc.body.style.borderColor:='blue';
        end;
     end;
end;

procedure TWeb.SetScrollBar(ScrollBar:boolean);
begin
  if TheDoc=nil then
     exit;
  if TheDoc.body=nil then
     exit;
  if ScrollBar then {values of "hidden" and "visible" lock PgUp and PgDn!}
     TheDoc.body.style.overflow:='scroll'
  else
     TheDoc.body.style.overflow:='auto';
end;

procedure TWeb.Undo;
begin
  if TheDoc=nil then
     exit;
  TheDoc.ExecCommand('Undo',false,0);
  Modified:=true;
end;

procedure TWeb.FontDialog;
begin
  SpecialCommand(IDM_FONT,True,True,False,Null);
  Modified:=true;
end;

function TWeb.SpecialCommand(Cmd:Cardinal;PromptUser:boolean;
                              editModeOnly:boolean;bTriEditCommandGroup:boolean;
                              InputArgs:OleVariant):HRESULT;
begin
  Result:=HrExecCommand(Cmd,null,InputArgs,promptUser,bTriEditCommandGroup);
end;

function TWeb.HrExecCommand(ucmdID: cardinal;
  const pVarIn: OleVariant; var pVarOut: OleVariant; bPromptUser,
  bTriEditCmdGroup: boolean): HResult;
var dwCmdOpt:DWORD;
begin
   result := S_OK;
   if DocCmd = nil then
      Exit;
   if (bPromptUser) then
      dwCmdOpt := MSOCMDEXECOPT_PROMPTUSER
   else
      dwCmdOpt := MSOCMDEXECOPT_DONTPROMPTUSER;
   if (bTriEditCmdGroup) then
      result := DocCmd.Exec(@GUID_TriEditCommandGroup,ucmdID,dwCmdOpt,pVarIn,pVarOut)
   else
      result := DocCmd.Exec(@CMDSETID_Forms3,ucmdID,dwCmdOpt,pVarIn,pVarOut);
end;

procedure TWeb.ToggleBullet;
begin
  if TheDoc=nil then
     exit;
  SpecialCommand(IDM_UnORDERLIST,false,true,false,Null);
  Modified:=true;
end;

procedure TWeb.ToggleNumbering;
begin
  if TheDoc=nil then
     exit;
  SpecialCommand(IDM_ORDERLIST,false,true,false,Null);
  Modified:=true;
end;

procedure TWeb.Align(IDM:integer);
begin
  if TheDoc=nil then
     exit;
  SpecialCommand(IDM,false,true,false,Null);
  Modified:=true;
end;

procedure TWeb.SetBackgroundColor(Color:TColor);
begin
  if TheDoc=nil then
     exit;
  TheDoc.ExecCommand('BackColor',false,Color);
  Modified:=true;
end;

function TWeb.SelText:string;
var TextRange:IHtmlTxtRange;
begin
  Result:='';
  TextRange:=GetTextRange;
  if TextRange=nil then
     exit;
  Result:=TextRange.text;
end;

procedure TWeb.Indent(Indent:boolean);
begin
  if TheDoc=nil then
     exit;
  if Indent then
     TheDoc.ExecCommand('Indent',false,0)
  else
     TheDoc.ExecCommand('Outdent',false,0);
  Modified:=true;
end;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美情侣在线播放| 亚洲chinese男男1069| 国产精品亚洲专一区二区三区 | 国产精品国产精品国产专区不片| 国产一区二三区好的| 久久精品一区二区三区av| 国产福利视频一区二区三区| 中日韩av电影| 在线看国产日韩| 日韩国产欧美视频| 久久综合色鬼综合色| 成人性生交大片免费看视频在线| 一区二区中文字幕在线| 一本一道久久a久久精品综合蜜臀| 亚洲乱码中文字幕| 欧美久久高跟鞋激| 日本va欧美va瓶| 中文字幕二三区不卡| 欧美色爱综合网| 国产一区二区三区免费| 亚洲欧洲成人自拍| 日韩一区二区三区免费观看| 国产精品一区二区在线观看不卡| 欧美韩日一区二区三区四区| 在线观看日韩一区| 蜜桃av一区二区在线观看| 中文字幕不卡三区| 欧美区在线观看| 国产成人99久久亚洲综合精品| 亚洲综合在线电影| 久久看人人爽人人| 欧美色综合影院| 国产成人av电影免费在线观看| 亚洲一区影音先锋| 久久久久成人黄色影片| 91美女在线观看| 国产一区二区三区四区五区入口| 一区二区日韩电影| 久久午夜国产精品| 欧美高清你懂得| 色呦呦日韩精品| 国产伦精品一区二区三区免费| 亚洲国产综合人成综合网站| 亚洲国产高清aⅴ视频| 欧美日韩国产首页在线观看| 成人高清伦理免费影院在线观看| 日韩电影一二三区| 亚洲综合区在线| 欧美激情一区二区三区不卡 | 国产91综合一区在线观看| 亚洲成av人综合在线观看| 欧美国产精品v| 精品国精品国产| 欧美日韩一级黄| 92精品国产成人观看免费| 国产乱子轮精品视频| 日日欢夜夜爽一区| 亚洲一区免费视频| 亚洲丝袜美腿综合| 国产精品免费久久| 日本一二三不卡| 久久久高清一区二区三区| 日韩一区二区精品葵司在线| 欧美性高清videossexo| 北岛玲一区二区三区四区| 国产在线精品不卡| 国产一区免费电影| 蜜臀av性久久久久蜜臀aⅴ| 亚洲www啪成人一区二区麻豆| 亚洲视频一区在线观看| 亚洲欧洲av另类| 久久久午夜精品| 国产婷婷精品av在线| 91精品国产综合久久久久久久| 欧美性生活大片视频| 91福利区一区二区三区| 一本色道久久综合亚洲aⅴ蜜桃| 播五月开心婷婷综合| jizz一区二区| 91成人看片片| 欧美年轻男男videosbes| 欧美日本一区二区| 欧美一区午夜精品| 欧美成人精精品一区二区频| 欧美一级视频精品观看| 精品成人一区二区| 中文字幕不卡一区| 亚洲欧美日韩一区二区 | 久久国产精品无码网站| 久久成人免费网站| 国产美女娇喘av呻吟久久| 丁香啪啪综合成人亚洲小说 | 免费xxxx性欧美18vr| 奇米亚洲午夜久久精品| 精品一区二区三区欧美| 国产成人在线免费| 色欲综合视频天天天| 91精品国产一区二区三区香蕉| 日韩午夜激情视频| 久久亚洲综合av| 亚洲免费毛片网站| 日韩国产欧美在线观看| 国产老女人精品毛片久久| 成人精品免费网站| 欧美天天综合网| 日韩精品一区在线观看| 中文字幕av不卡| 一区二区三区精品视频在线| 蜜臀av性久久久久蜜臀aⅴ流畅| 国产成人亚洲精品青草天美| 色狠狠av一区二区三区| 日韩欧美你懂的| 一区免费观看视频| 蜜臀久久99精品久久久画质超高清| 成人一区二区视频| 欧美日韩精品一区二区三区| 欧美va天堂va视频va在线| 中文字幕一区二区三区视频| 天天色综合天天| 99久久久无码国产精品| 欧美成人精品二区三区99精品| 国产精品久久久久婷婷 | 狠狠色丁香婷婷综合| caoporn国产精品| 日韩三区在线观看| 亚洲情趣在线观看| 国产精品主播直播| 91国内精品野花午夜精品| 久久久蜜桃精品| 亚洲一级二级在线| 成人久久久精品乱码一区二区三区 | 亚洲同性gay激情无套| 日本aⅴ免费视频一区二区三区| 欧美日韩综合在线免费观看| 久久蜜桃av一区二区天堂| 亚洲一区在线观看网站| 高清成人免费视频| 欧美一区二区日韩一区二区| 亚洲精品中文字幕在线观看| 国产在线观看一区二区| 69堂国产成人免费视频| 亚洲欧美怡红院| 国产乱子伦视频一区二区三区| 91精品国产综合久久久久久久| 一区二区三区视频在线观看| 成人综合激情网| 精品国产sm最大网站| 日韩精品一区第一页| 日本韩国欧美国产| 国产精品美女久久久久久久久| 国产精品一级二级三级| 欧美xxxxx裸体时装秀| 日韩成人午夜电影| 欧美久久一二区| 亚洲电影视频在线| 91成人网在线| 洋洋av久久久久久久一区| 色哟哟一区二区三区| 国产精品成人一区二区三区夜夜夜| 国产麻豆视频精品| 久久久久久久久久久99999| 日本aⅴ免费视频一区二区三区 | www.亚洲精品| 国产精品毛片大码女人| 国产精品一区二区不卡| 2022国产精品视频| 精一区二区三区| 精品国产露脸精彩对白| 国产在线不卡一区| 久久免费美女视频| 国产一区二区成人久久免费影院| 久久亚洲精华国产精华液| 久久99精品网久久| 久久色.com| 成人app软件下载大全免费| 国产精品视频第一区| 成人av免费在线播放| 亚洲欧洲日产国码二区| 91丨九色丨尤物| 午夜婷婷国产麻豆精品| 制服视频三区第一页精品| 蜜桃av一区二区三区电影| 2020国产精品自拍| 粉嫩嫩av羞羞动漫久久久 | 亚洲免费看黄网站| 精品视频一区三区九区| 日本免费在线视频不卡一不卡二| 欧美一区二区三区在线| 九九久久精品视频| 国产精品福利电影一区二区三区四区| 一本大道av一区二区在线播放| 亚洲午夜一区二区| 日韩视频一区二区三区| 国产精品一级在线| 自拍偷在线精品自拍偷无码专区| 色吧成人激情小说| 蜜桃av一区二区在线观看| 欧美激情一区不卡| 欧美亚洲国产一卡| 精品无码三级在线观看视频|