AcManForm.pas
上传用户:fh681027
上传日期:2022-07-23
资源大小:1959k
文件大小:2k
源码类别:

Delphi控件源码

开发平台:

Delphi

  1. unit AcManForm;
  2. interface
  3. uses
  4.   Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  5.   Dialogs, ActnMenus, ToolWin, ActnMan, ActnCtrls, ExtActns, StdActns,
  6.   ActnList, ImgList, StdCtrls, ComCtrls, BandActn;
  7. type
  8.   TForm1 = class(TForm)
  9.     ActionManager1: TActionManager;
  10.     RichEdit1: TRichEdit;
  11.     ImageList1: TImageList;
  12.     EditCut1: TEditCut;
  13.     EditCopy1: TEditCopy;
  14.     EditPaste1: TEditPaste;
  15.     EditSelectAll1: TEditSelectAll;
  16.     EditUndo1: TEditUndo;
  17.     EditDelete1: TEditDelete;
  18.     RichEditBold1: TRichEditBold;
  19.     RichEditItalic1: TRichEditItalic;
  20.     RichEditUnderline1: TRichEditUnderline;
  21.     RichEditStrikeOut1: TRichEditStrikeOut;
  22.     RichEditBullets1: TRichEditBullets;
  23.     RichEditAlignLeft1: TRichEditAlignLeft;
  24.     RichEditAlignRight1: TRichEditAlignRight;
  25.     RichEditAlignCenter1: TRichEditAlignCenter;
  26.     ActionToolBar1: TActionToolBar;
  27.     ActionMainMenuBar1: TActionMainMenuBar;
  28.     ActionToolBar2: TActionToolBar;
  29.     FileOpen1: TFileOpen;
  30.     FileSaveAs1: TFileSaveAs;
  31.     FilePrintSetup1: TFilePrintSetup;
  32.     FileRun1: TFileRun;
  33.     FileExit1: TFileExit;
  34.     SearchFind1: TSearchFind;
  35.     SearchFindNext1: TSearchFindNext;
  36.     SearchReplace1: TSearchReplace;
  37.     SearchFindFirst1: TSearchFindFirst;
  38.     CustomizeActionBars1: TCustomizeActionBars;
  39.     HelpContents1: THelpContents;
  40.     ActionToolBar3: TActionToolBar;
  41.     ActionShowStatus: TAction;
  42.     procedure ActionShowStatusExecute(Sender: TObject);
  43.   private
  44.     { Private declarations }
  45.   public
  46.     { Public declarations }
  47.   end;
  48. var
  49.   Form1: TForm1;
  50. implementation
  51. {$R *.dfm}
  52. procedure TForm1.ActionShowStatusExecute(Sender: TObject);
  53. var
  54.   memStr, memStr2: TMemoryStream;
  55. begin
  56.   memStr := TMemoryStream.Create;
  57.   try
  58.     memStr2 := TMemoryStream.Create;
  59.     try
  60.       ActionManager1.SaveToStream(memStr);
  61.       memStr.Position := 0;
  62.       ObjectBinaryToText(memStr, memStr2);
  63.       memStr2.Position := 0;
  64.       RichEdit1.Lines.LoadFromStream(memStr2);
  65.     finally
  66.       memStr2.Free;
  67.     end;
  68.   finally
  69.     memStr.Free;
  70.   end;
  71. end;
  72. end.