uBaseEditorForm.pas
上传用户:yjb1804
上传日期:2021-01-30
资源大小:3105k
文件大小:10k
- unit uBaseEditorForm;
- interface
- uses
- Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
- Dialogs, dxBar, cxClasses, ExtCtrls, dxBarExtItems, ImgList, uHtmlEdit, OleCtrls,
- SHDocVw, ActnList, dxSkinsCore, dxSkinsdxBarPainter, dxSkinBlack,
- dxSkinBlue, dxSkinCaramel, dxSkinCoffee, {dxSkinDarkRoom,} dxSkinDarkSide,
- {dxSkinFoggy,} dxSkinGlassOceans, dxSkiniMaginary, dxSkinLilian,
- dxSkinLiquidSky, dxSkinLondonLiquidSky, dxSkinMcSkin, dxSkinMoneyTwins,
- dxSkinOffice2007Black, dxSkinOffice2007Blue, dxSkinOffice2007Green,
- dxSkinOffice2007Pink, dxSkinOffice2007Silver, dxSkinPumpkin, {dxSkinSeven,}
- {dxSkinSharp,} dxSkinSilver, {dxSkinSpringTime,} dxSkinStardust,
- dxSkinSummer2008, dxSkinsDefaultPainters, dxSkinValentine,
- dxSkinXmas2008Blue;
- type
- TBaseEditorForm = class(TForm)
- dxbrmngr1: TdxBarManager;
- pnlEdit: TPanel;
- dxbrbtn1: TdxBarButton;
- dxBarSubItem1: TdxBarSubItem;
- dxbrmngr1Bar1: TdxBar;
- dxbrmngr1Bar2: TdxBar;
- dxBarSubItem2: TdxBarSubItem;
- dxbrbtn2: TdxBarButton;
- dxbrbtn3: TdxBarButton;
- dxbrbtn4: TdxBarButton;
- dxbrbtn5: TdxBarButton;
- dxbrsbtm1: TdxBarSubItem;
- dxbrbtn6: TdxBarButton;
- dxbrbtn7: TdxBarButton;
- dxbrbtn8: TdxBarButton;
- pnlEditHeader: TPanel;
- dxbrmngr1Bar3: TdxBar;
- dxbrbtn9: TdxBarButton;
- dxbrdckcntrl1: TdxBarDockControl;
- il1: TImageList;
- btnFontName: TdxBarFontNameCombo;
- btnFontSize: TdxBarSpinEdit;
- dxbrclrcmb1: TdxBarColorCombo;
- pm1: TdxBarPopupMenu;
- dxbrbtn10: TdxBarButton;
- dxbrbtn11: TdxBarButton;
- dxbrbtn12: TdxBarButton;
- dxbrbtn13: TdxBarButton;
- dxbrbtn14: TdxBarButton;
- dxbrsbtm2: TdxBarSubItem;
- dxbrbtn15: TdxBarButton;
- dxbrbtn16: TdxBarButton;
- dxbrbtn17: TdxBarButton;
- dxbrbtn18: TdxBarButton;
- lbl1: TdxBarStatic;
- btnFontColor: TdxBarColorCombo;
- btnFontBackColor: TdxBarColorCombo;
- dxbrbtn19: TdxBarButton;
- dxbrbtn20: TdxBarButton;
- dxbrbtn21: TdxBarButton;
- dxbrbtn22: TdxBarButton;
- dxbrbtn23: TdxBarButton;
- dxbrbtn24: TdxBarButton;
- dxbrbtn25: TdxBarButton;
- dxbrbtn26: TdxBarButton;
- actlst1: TActionList;
- dxbrbtn27: TdxBarButton;
- dxbrbtn28: TdxBarButton;
- dxbrbtn29: TdxBarButton;
- dxbrbtn30: TdxBarButton;
- dxbrbtn31: TdxBarButton;
- actUndo: TAction;
- actRedo: TAction;
- actReplace: TAction;
- actSearch: TAction;
- actCut: TAction;
- actCopy: TAction;
- actPaste: TAction;
- actInsertImg: TAction;
- actInsertHLine: TAction;
- actInsertHyperLine: TAction;
- actAlignLeft: TAction;
- actAlignRigth: TAction;
- actInsertTable: TAction;
- actAlignMid: TAction;
- actIndenIn: TAction;
- actIndenOut: TAction;
- actStrikeLine: TAction;
- actFoneItalic: TAction;
- actFontBlod: TAction;
- actInsertHeader: TAction;
- actFontBackColor: TAction;
- actFontColor: TAction;
- actFontSize: TAction;
- actFontUnderLine: TAction;
- actFontName: TAction;
- actSelectAll: TAction;
- dlgOpen: TOpenDialog;
- dlgSave: TSaveDialog;
- dxbrbtn32: TdxBarButton;
- dxbrbtn33: TdxBarButton;
- dxbrbtn34: TdxBarButton;
- dxbrbtn35: TdxBarButton;
- dxbrbtn36: TdxBarButton;
- dxbrbtn37: TdxBarButton;
- dxbrbtn38: TdxBarButton;
- dxbrbtn39: TdxBarButton;
- dxbrbtn40: TdxBarButton;
- dxbrbtn41: TdxBarButton;
- dxbrbtn42: TdxBarButton;
- dxbrbtn43: TdxBarButton;
- dxbrbtn44: TdxBarButton;
- dxbrbtn45: TdxBarButton;
- dxbrbtn46: TdxBarButton;
- dxbrsbtm3: TdxBarSubItem;
- dxbrbtn47: TdxBarButton;
- dxbrbtn48: TdxBarButton;
- dxbrbtn49: TdxBarButton;
- pm2: TdxBarPopupMenu;
- dxbrbtn50: TdxBarButton;
- dxbrbtn51: TdxBarButton;
- dxbrbtn52: TdxBarButton;
- actInsertButton: TAction;
- actInsertLabel: TAction;
- actInsertEdit: TAction;
- htmlEdit: THtmlEdit;
- procedure actUndoExecute(Sender: TObject);
- procedure actRedoExecute(Sender: TObject);
- procedure actReplaceExecute(Sender: TObject);
- procedure actSearchExecute(Sender: TObject);
- procedure actCutExecute(Sender: TObject);
- procedure actCopyExecute(Sender: TObject);
- procedure actPasteExecute(Sender: TObject);
- procedure actInsertHLineExecute(Sender: TObject);
- procedure actSelectAllExecute(Sender: TObject);
- procedure actInsertImgExecute(Sender: TObject);
- procedure actInsertHyperLineExecute(Sender: TObject);
- procedure actInsertHeaderExecute(Sender: TObject);
- procedure actAlignLeftExecute(Sender: TObject);
- procedure actAlignRigthExecute(Sender: TObject);
- procedure actAlignMidExecute(Sender: TObject);
- procedure actInsertTableExecute(Sender: TObject);
- procedure actIndenInExecute(Sender: TObject);
- procedure actIndenOutExecute(Sender: TObject);
- procedure actStrikeLineExecute(Sender: TObject);
- procedure actFontUnderLineExecute(Sender: TObject);
- procedure actFontSizeExecute(Sender: TObject);
- procedure actFoneItalicExecute(Sender: TObject);
- procedure actFontBlodExecute(Sender: TObject);
- procedure actFontColorExecute(Sender: TObject);
- procedure actFontBackColorExecute(Sender: TObject);
- procedure actFontNameExecute(Sender: TObject);
- procedure dxbrbtn10Click(Sender: TObject);
- procedure dxbrbtn11Click(Sender: TObject);
- procedure dxbrbtn12Click(Sender: TObject);
- procedure dxbrbtn36Click(Sender: TObject);
- procedure dxbrbtn37Click(Sender: TObject);
- procedure dxbrbtn47Click(Sender: TObject);
- procedure btnFontSizeButtonClick(Sender: TdxBarSpinEdit;
- Button: TdxBarSpinEditButton);
- procedure dxbrbtn50Click(Sender: TObject);
- procedure actInsertButtonExecute(Sender: TObject);
- procedure actInsertLabelExecute(Sender: TObject);
- procedure actInsertEditExecute(Sender: TObject);
- private
- { Private declarations }
- public
- { Public declarations }
- end;
- var
- BaseEditorForm: TBaseEditorForm;
- implementation
- uses uCommon,Math, ufrmGridLineCount;
- {$R *.dfm}
- procedure TBaseEditorForm.actUndoExecute(Sender: TObject);
- begin
- htmlEdit.Undo;
- end;
- procedure TBaseEditorForm.actRedoExecute(Sender: TObject);
- begin
- htmlEdit.Redo;
- end;
- procedure TBaseEditorForm.actReplaceExecute(Sender: TObject);
- begin
- //
- end;
- procedure TBaseEditorForm.actSearchExecute(Sender: TObject);
- begin
- htmlEdit.SearchText;
- end;
- procedure TBaseEditorForm.actCutExecute(Sender: TObject);
- begin
- htmlEdit.Cut;
- end;
- procedure TBaseEditorForm.actCopyExecute(Sender: TObject);
- begin
- htmlEdit.Copy;
- end;
- procedure TBaseEditorForm.actPasteExecute(Sender: TObject);
- begin
- htmlEdit.Paste;
- end;
- procedure TBaseEditorForm.actInsertHLineExecute(Sender: TObject);
- begin
- htmlEdit.Edit.InsertHr;
- end;
- procedure TBaseEditorForm.actSelectAllExecute(Sender: TObject);
- begin
- htmlEdit.SelectAll;
- end;
- procedure TBaseEditorForm.actInsertImgExecute(Sender: TObject);
- begin
- dlgOpen.Filter:='BMP文件|*.bmp|GIF动画|*.GIF|ico图标|*.ico|所有文件|*.*';
- if dlgOpen.Execute then
- htmlEdit.Edit.InsertImage(dlgOpen.FileName);
- end;
- procedure TBaseEditorForm.actInsertHyperLineExecute(Sender: TObject);
- begin
- htmlEdit.Edit.CreateLink ;
- end;
- procedure TBaseEditorForm.actInsertHeaderExecute(Sender: TObject);
- begin
- //
- end;
- procedure TBaseEditorForm.actAlignLeftExecute(Sender: TObject);
- begin
- htmlEdit.Edit.JustifyLeft;
- end;
- procedure TBaseEditorForm.actAlignRigthExecute(Sender: TObject);
- begin
- htmlEdit.Edit.JustifyRight;
- end;
- procedure TBaseEditorForm.actAlignMidExecute(Sender: TObject);
- begin
- htmlEdit.Edit.JustifyCenter;
- end;
- procedure TBaseEditorForm.actInsertTableExecute(Sender: TObject);
- begin
- with TfrmGridLineCount.Create(nil) do
- try
- if ShowModal=mrOk then
- htmlEdit.Edit.InsertTable(StrToInt(cbCol.Text),StrToInt(cbRow.Text),StrToInt(cbBorlder.Text));
- finally
- Free;
- end;
- end;
- procedure TBaseEditorForm.actIndenInExecute(Sender: TObject);
- begin
- htmlEdit.Edit.InDent;
- end;
- procedure TBaseEditorForm.actIndenOutExecute(Sender: TObject);
- begin
- htmlEdit.Edit.OutDent;
- end;
- procedure TBaseEditorForm.actStrikeLineExecute(Sender: TObject);
- begin
- htmlEdit.Edit.StrikeThrough;
- end;
- procedure TBaseEditorForm.actFontUnderLineExecute(Sender: TObject);
- begin
- htmlEdit.Edit.UnderLine;
- end;
- procedure TBaseEditorForm.actFontSizeExecute(Sender: TObject);
- begin
- htmlEdit.Edit.FontSize(Ceil(btnFontSize.CurValue));
- end;
- procedure TBaseEditorForm.actFoneItalicExecute(Sender: TObject);
- begin
- htmlEdit.Edit.Italic;
- end;
- procedure TBaseEditorForm.actFontBlodExecute(Sender: TObject);
- begin
- htmlEdit.Edit.Bold;
- end;
- procedure TBaseEditorForm.actFontColorExecute(Sender: TObject);
- begin
- htmlEdit.Edit.ForeColor(btnFontColor.CurColor);
- end;
- procedure TBaseEditorForm.actFontBackColorExecute(Sender: TObject);
- begin
- htmlEdit.Edit.BackColor(btnFontBackColor.CurColor);
- end;
- procedure TBaseEditorForm.actFontNameExecute(Sender: TObject);
- begin
- htmlEdit.Edit.FontName(btnFontName.CurText)
- end;
- procedure TBaseEditorForm.dxbrbtn10Click(Sender: TObject);
- begin
- htmlEdit.Edit.InsertH1(DateTimeToStr(Now));
- end;
- procedure TBaseEditorForm.dxbrbtn11Click(Sender: TObject);
- begin
- htmlEdit.Edit.InsertH2(DateTimeToStr(Now));
- end;
- procedure TBaseEditorForm.dxbrbtn12Click(Sender: TObject);
- begin
- htmlEdit.Edit.InsertH3(DateTimeToStr(Now));
- end;
- procedure TBaseEditorForm.dxbrbtn36Click(Sender: TObject);
- begin
- htmlEdit.Edit.InsertH4(DateTimeToStr(Now));
- end;
- procedure TBaseEditorForm.dxbrbtn37Click(Sender: TObject);
- begin
- htmlEdit.Edit.InsertH5(DateTimeToStr(Now));
- end;
- procedure TBaseEditorForm.dxbrbtn47Click(Sender: TObject);
- begin
- //htmlEdit.Edit.InsertUnorderedList();
- end;
- procedure TBaseEditorForm.btnFontSizeButtonClick(Sender: TdxBarSpinEdit;
- Button: TdxBarSpinEditButton);
- begin
- actFontSizeExecute(btnFontSize);
- end;
- procedure TBaseEditorForm.dxbrbtn50Click(Sender: TObject);
- begin
- //htmlEdit.Edit.IN
- end;
- procedure TBaseEditorForm.actInsertButtonExecute(Sender: TObject);
- begin
- htmlEdit.Edit.InsertButton('button');
- end;
- procedure TBaseEditorForm.actInsertLabelExecute(Sender: TObject);
- begin
- htmlEdit.Edit.InsertLabel('label');
- end;
- procedure TBaseEditorForm.actInsertEditExecute(Sender: TObject);
- begin
- htmlEdit.Edit.InsertEdit('edit');
- end;
- end.