00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef SWDispRTFH
00025 #define SWDispRTFH
00026
00027 #include <vcl\SysUtils.hpp>
00028 #include <vcl\Controls.hpp>
00029 #include <vcl\Classes.hpp>
00030 #include <vcl\Forms.hpp>
00031 #include <vcl\ComCtrls.hpp>
00032 #include <vcl\StdCtrls.hpp>
00033 #include <swtext.h>
00034 #include "RxRichEditX.h"
00035
00036
00037 #define defRTFHeader "{\\rtf1\\ansi{\\fonttbl{\\f0\\froman\\fcharset0\\fprq2 Times New Roman;}{\\f1\\froman\\fcharset0\\fprq2 Times New Roman;}{\\f2\\froman\\fcharset0\\fprq2 Times New Roman;}{\\f3\\froman\\fcharset0\\fprq2 Times New Roman;}{\\f4\\froman\\fcharset0\\fprq2 Times New Roman;}{\\f7\\froman\\fcharset2\\fprq2 Symbol;}{\\f8\\froman\\fcharset2\\fprq2 Symbol;}}{\\colortbl;\\red0\\green0\\blue255;\\red0\\green200\\blue50;\\red0\\green0\\blue255;\\red0\\green200\\blue50;\\red0\\green0\\blue255;\\red255\\green0\\blue0;} "
00038 #define defRTFHeadMargin "{\\fs8\\cf1\\par\\pard} "
00039 #define defRTFTrailer "{\\fs%d \\par }}" // 24
00040
00041 #define defRTFChapterMarkPre "\\pard \\qc\\nowidctlpar{\\f1\\cf7\\fs%d\\b Chapter " // 30
00042 #define defRTFChapterMarkPost "\\par\\fs%d\\par}" // 10
00043
00044 #define defRTFVerseMarkPre "{\\fs%d\\cf1\\super " //20
00045 #define defRTFVerseMarkPost "}"
00046
00047 #define defRTFVersePre "{\\fs%d" // 24
00048 #define defRTFVersePost " }"
00049
00050 class SWDispRTF : public TRxRichEditX {
00051 protected:
00052
00053 bool FExpandNewLine;
00054 CHARRANGE FCharRange;
00055 int fontSize;
00056
00057 int __fastcall GetMySelStart ();
00058 void __fastcall SetMySelStart (int iselstart);
00059 int __fastcall getFontSize ();
00060 void __fastcall setFontSize (int iFontSize);
00061 protected:
00062 TMemoryStream * RTFStream;
00063
00064 virtual void __fastcall Loaded (void);
00065 public:
00066 __fastcall SWDispRTF (TWinControl *Owner);
00067 __fastcall ~ SWDispRTF ();
00068
00069 virtual char Display (SWModule & imodule);
00070 __property bool ExpandNewLine = { read = FExpandNewLine, write = FExpandNewLine };
00071 };
00072
00073
00074 #endif