Changeset 793 for cprs/branches/tmg-cprs/CPRS-Chart/TMG_Extra/HTMLEdit
- Timestamp:
- Jun 10, 2010, 3:13:12 PM (15 years ago)
- Location:
- cprs/branches/tmg-cprs/CPRS-Chart/TMG_Extra/HTMLEdit
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
cprs/branches/tmg-cprs/CPRS-Chart/TMG_Extra/HTMLEdit/TMGHTML2.pas
r698 r793 122 122 function MoveCaretToEnd : boolean; 123 123 function MoveCaretToPos(ScreenPos: TPoint) : HRESULT; //kt added 124 procedure InsertHTMLAtCaret(HTMLText : AnsiString); //kt 4/21/10 124 125 procedure InsertTextAtCaret(Text : AnsiString); //Note: Text is NOT HTMLtext 125 126 property HTMLText:string read GetHTMLText write SetHTMLText; … … 691 692 end; 692 693 694 procedure THtmlObj.InsertHTMLAtCaret(HTMLText : AnsiString); 695 var 696 Range: IHTMLTxtRange; 697 begin 698 Range:= GetTextRange; 699 Range.pasteHTML(HTMLText); 700 end; 701 693 702 procedure THtmlObj.InsertTextAtCaret(Text : AnsiString); 694 703 //kt added. Note: inserts external format (not HTML markup) … … 754 763 procedure THtmlObj.SubMessageHandler(var Msg: TMessage); 755 764 //Called from parent's EDMessageHandler, or from GlobalMsgHandler 765 766 const 767 FontSizes : array [0..6] of byte = (8,10,12,14,18,24,36); 768 756 769 var i : Integer; 757 770 WinControl : TWinControl; 771 TextSize : integer; 758 772 759 773 begin … … 820 834 Msg.Result := 1; //Handled 821 835 end; 836 $31..$38 : begin 837 if CtrlToBeProcessed = true then begin 838 TextSize := Msg.WParam-$31; 839 if (TextSize >= 0) and (TextSize <=6 ) then begin 840 SetFontSize(FontSizes[TextSize]); 841 CtrlToBeProcessed := False; 842 end; 843 end; 844 end; 822 845 { 823 846 VK_RETURN : if CtrlReturnToBeProcessed then begin … … 854 877 Msg.Result := 1; //Handled 855 878 end; 879 Ord('Q') : if CtrlToBeProcessed then begin 880 //kt if not FEditable then exit; 881 Outdent; 882 Msg.Result := 1; //Handled 883 exit; 884 end; 885 Ord('W') : if CtrlToBeProcessed then begin 886 //kt if not FEditable then exit; 887 Indent; 888 Msg.Result := 1; //Handled 889 exit; 890 end; 891 Ord('D') : if CtrlToBeProcessed then begin 892 //kt if not FEditable then exit; 893 FontDialog; 894 Msg.Result := 1; //Handled 895 exit; 896 end; 897 { 898 Ord('.') : if CtrlToBeProcessed then begin 899 //kt if not FEditable then exit; 900 ToggleBullet; 901 Msg.Result := 1; //Handled 902 exit; 903 end; 904 Ord('N') : if CtrlToBeProcessed then begin 905 //kt if not FEditable then exit; 906 ToggleNumbering; 907 Msg.Result := 1; //Handled 908 exit; 909 end; 910 Ord(';') : if CtrlToBeProcessed then begin 911 //kt if not FEditable then exit; 912 TextForeColorDialog; 913 Msg.Result := 1; //Handled 914 exit; 915 end; 916 Ord('''') : if CtrlToBeProcessed then begin 917 //kt if not FEditable then exit; 918 TextBackColorDialog; 919 Msg.Result := 1; //Handled 920 exit; 921 end; 922 } 856 923 end; {case} 857 924 end; -
cprs/branches/tmg-cprs/CPRS-Chart/TMG_Extra/HTMLEdit/TMGHTML2.~pas
r698 r793 60 60 FEditable: boolean; 61 61 ColorDialog: TColorDialog; 62 AllowNextBlur : boolean; 63 procedure SetMsgActive (Active : boolean); 62 AllowNextBlur : boolean; 64 63 function GetHTMLText:string; 65 64 procedure SetHTMLText(HTML:String); … … 91 90 public 92 91 {end public} 93 PopupMenu: TPopupMenu; 92 PopupMenu: TPopupMenu; 94 93 KeyStruck : boolean; // A VERY crude determiner as to if Modified. 95 94 NextControl : TWinControl; 96 95 PrevControl : TWinControl; 97 constructor Create(Owner:TControl; Application : TApplication); 96 procedure SetMsgActive (Active : boolean); 97 constructor Create(Owner:TControl; Application : TApplication); 98 98 destructor Destroy; override; 99 procedure Clear; 99 procedure Clear; 100 100 procedure ToggleBullet; 101 101 procedure ToggleItalic; … … 122 122 function MoveCaretToEnd : boolean; 123 123 function MoveCaretToPos(ScreenPos: TPoint) : HRESULT; //kt added 124 procedure InsertHTMLAtCaret(HTMLText : AnsiString); //kt 4/21/10 124 125 procedure InsertTextAtCaret(Text : AnsiString); //Note: Text is NOT HTMLtext 125 126 property HTMLText:string read GetHTMLText write SetHTMLText; … … 689 690 Result := FCaret.MoveCaretToPointer(FTMGDisplayPointer,Integer(True),CARET_DIRECTION_INDETERMINATE); 690 691 FCaret.Show(Integer(True)); 692 end; 693 694 procedure THtmlObj.InsertHTMLAtCaret(HTMLText : AnsiString); 695 var 696 Range: IHTMLTxtRange; 697 begin 698 Range:= Self.GetTextRange; 699 Range.pasteHTML(HTMLText); 691 700 end; 692 701
Note:
See TracChangeset
for help on using the changeset viewer.