Dismiss Notice

REGISTRATION IS AFTER ADMIN ACTIVATION

DONATIONS WITH PAYPAL CLICK TO BUTTON

1 MONTH VIP - 5$; 3 MONTHS VIP - 10$; 6 MONTHS VIP - 20$; 1 YEAR VIP - 30$; 2 YEARS VIP - 50$; GOLD USER FOR LIFE VIP - 150$

DONATIONS WITH Bitcoin Address:3NRs3CK3fhXifrNYxHEZKpETDd9vNLMsMD

Dismiss Notice
The registration is approved by the Administrator. It takes about 1 day to approve your registration
Dismiss Notice
For open hidden message no need write thanks, thank etc. Enough is click to like button on right side of thread.

RichView v13.12.1 Full Source

Discussion in 'Delphi Components' started by AdminDF, Jul 19, 2013.

  1. AdminDF
    Online

    AdminDFAdminDF is a Verified Member DelphiFan Administrator Staff Member DF Staff

    v13.XX series History

    v13.12.1 (2012-Aug-28)

    v13.12 (2012-Aug-22)
    new: QuickAccess property of StyleTemplate
    chg: TRichView.UseStyleTemplates=False by default

    v13.11.1 (2012-Aug-14)

    v13.11 (2012-Aug-9)
    new: StyleTemplates - "real styles".
    See the details in the protected forums.
    If you do not want using them now, assign rv.UseStyleTemplates=False for all TRichView and TRichViewEdit controls in your project
    fixes and tweaks

    //***********************

    HOW CONVERT TO XE4
    [1] Override RV_Defs.inc with the code below.
    {*******************************************************}
    {                                                      }
    {      RichView                                        }
    {      Conditionals for RichView.                      }
    {      This file is included in all RichView PAS-files.}
    {                                                      }
    {      Copyright (c) Sergey Tkachenko                  }
    {      svt@trichview.com                              }
    {      http://www.trichview.com                        }
    {                                                      }
    {*******************************************************}

    {$B-}
    {$H+}
    {$J+}
    {$T-}

    {------------------------------------------------------------------------------}
    {                  Determining Delphi/C++Builder version                      }

    {$DEFINE RICHVIEW}

    {$IFNDEF VER80}                        {      not Delphi 1.0          }
      {$IFNDEF VER90}                      {      not Delphi 2.0          }
        {$DEFINE RICHVIEWCBDEF1}            (* C++Builder 1.0+              *)
        {$IFNDEF VER93}                    {      not C++Builder 1.0      }
          {$DEFINE RICHVIEWCBDEF3}          (* C++Builder 3.0+              *)
          {$IFNDEF VER110}                  {      not C++Builder 3.0      }
            {$DEFINE RICHVIEWDEF3}          (* Delphi 3.0+, C++Builder 4.0+ *)
            {$IFNDEF VER100}                {      not Delphi 3.0          }
              {$DEFINE RICHVIEWDEF4}        (* Delphi 4.0+                  *)
              {$IFNDEF VER120}              {      not Delphi 4.0          }
                {$IFNDEF VER125}            {      not C++Builder 4.0      }
                  {$DEFINE RICHVIEWDEF5}    (* Delphi 5.0+                  *)
                  {$IFNDEF VER130}          {      not Delphi 5.0          }
                    {$IFNDEF VER135}      {      not C++Builder 5.0      }
                      {$DEFINE RICHVIEWDEF6}(* Delphi 6.0+                *)
                      {$IFNDEF VER140}    {      not Delphi 6.0          }
                        {$IFNDEF VER145}  {      not C++Builder 6.0      }
                          {$DEFINE RICHVIEWDEF7}(* Delphi 7.0+            *)
                          {$IFNDEF VER150} {      not Delphi 7.0          }
                            {$DEFINE RICHVIEWDEF9}  (* Delphi 2005+            *)
                            {$DEFINE RICHVIEWDEF2005}(* Delphi 2005+            *)
                            {$IFNDEF VER170} {      not Delphi 2005    }
                              {$DEFINE RICHVIEWDEF10}  (* Delphi 2006+            *)
                              {$DEFINE RICHVIEWDEF2006} (* Delphi 2006+            *)
                              {$DEFINE RICHVIEWDEF2007} (* Delphi 2007 defines both VER180 and VER185 *)
                              {$IFNDEF VER180}  {      not Delphi 2006-2007    }
                                {$DEFINE RICHVIEWDEF2009}
                                {$IFNDEF VER200}
                                  {$DEFINE RICHVIEWDEF2010}
                                    {$IFNDEF VER210}
                                      {$DEFINE RICHVIEWDEFXE}
                                        {$IFNDEF VER220}
                                          {$DEFINE RICHVIEWDEFXE2}
                                            {$IFNDEF VER230}
                                              {$DEFINE RICHVIEWDEFXE3}
                                                {$IFNDEF VER240}
                                                  {$DEFINE RICHVIEWDEFXE4}
                                                {$ENDIF}
                                            {$ENDIF}
                                        {$ENDIF}
                                    {$ENDIF}
                                {$ENDIF}
                              {$ENDIF}
                            {$ENDIF}
                          {$ENDIF}
                        {$ENDIF}
                      {$ENDIF}
                    {$ENDIF}
                  {$ENDIF}
                {$ENDIF}
              {$ENDIF}
            {$ENDIF}
          {$ENDIF}
        {$ENDIF}
      {$ENDIF}
    {$ENDIF}

    {$IFDEF VER180}{$IFNDEF VER185}
    {$UNDEF RICHVIEWDEF2007} // this is D2006, not D2007
    {$ENDIF}{$ENDIF}


    {$IFDEF RICHVIEWDEF7}
    {$WARN UNSAFE_TYPE OFF}
    {$WARN UNSAFE_CODE OFF}
    {$WARN UNSAFE_CAST OFF}
    {$ENDIF}

    {------------------------------------------------------------------------------}
    { CONDITIONAL DEFINES.                                                        }
    { Do not modify this file, use Project|Options, Directories/Conditionals,      }
    { Conditional defines instead.                                                }
    {------------------------------------------------------------------------------}

    {------------------------------------------------------------------------------}
    { Defines for shrinking exe size / improving speed and memory usage by        }
    { turning off unused features.                                                }
    {------------------------------------------------------------------------------}

    {NOT$DEFINE RVDONOTUSESTYLETEMPLATES}
    {
      Define if you do not want to use TRVStyle.StyleTemplates and related functions.

    {NOT$DEFINE RVDONOTUSEALLCAPS}
    {NOT$DEFINE RVDONOTUSESOFTHYPHENS}
    {NOT$DEFINE RVDONOTUSECHARSCALE}
    {
      Define it if you do not wish to use rvfsAllCaps option, soft hyphens,
      CharScale.
      Some speed up of text drawing and formatting.
    }

    {NOT$DEFINE RVDONOTUSESMARTPOPUP}


    {NOT$DEFINE RVDONOTUSEANIMATION}
    {
      Define if you do not wish to display animations.
      Saves memory and resources.
    }

    {NOT$DEFINE RVDONOTUSETABS}
    {
      Define if you do not wish to use tab stops. All code for importing tabs will
      be excluded. But code for processing tabs (if they appeared in document) remains.
    }

    {NOT$DEFINE RVDONOTUSEJPEGIMAGE}
    {
      Define it if you do not wish to use Delphi jpeg units.
      This will cause saving images to HTML as bitmaps, and turning off special
      support for jpegs in paletted display mode.
    }

    {NOT$DEFINE RVDONOTUSEHTML}
    {
      Define it to remove all HTML-related methods.
    }

    {NOT$DEFINE RVDONOTUSERTF}
    {
      Define it to remove all RTF-export related methods
    }

    {NOT$DEFINE RVDONOTUSERTFIMPORT}
    {
      Define it to remove all RTF-import related methods.
    }

    {NOT$DEFINE RVDONOTUSERVF}
    {
      Define it to remove all RVF-related methods.
      You can do it only if you do not use TRichViewEdit. Editor requires
      RVF methods.
    }


    {NOT$DEFINE RVDONOTUSEUNICODE}
    {
      Define it to disable Unicode support.
      Cannot be activated in Delphi/C++Builder 2009+
    }
    {NOT$DEFINE RVDONOTUSECHARSPACING}
    {
      Define it to disable CharSpacing. Somewhat faster
    }

    {NOT$DEFINE RVDONOTUSETABLES}
    {
      Define, if you do not use tables. Exe-file will be smaller.
    }

    {NOT$DEFINE RVDONOTUSELISTS}
    {
      Define, if you do not use bullets and numbering
    }

    {NOT$DEFINE RVDONOTUSESEQ}
    {
      Define, if you do not use numbered sequences and footnotes
    }

    {NOT$DEFINE RVDONOTUSEINI}
    {
      Define, if you do not save/load RVStyle in ini-files and the Registry
    }

    {NOT$DEFINE RVDONOTUSEDRAGDROP}
    {
      Define, if you do not use OLE drag&drop
    }

    {NOT$DEFINE RVDONOTUSEITEMHINTS}
    {
      Define, if you do not want to use item titles (popup hints).
      Saves 4 bytes per item in memory
    }

    {NOT$DEFINE RVDONOTUSELIVESPELL}
    {
      Define, if you do not want to use live spelling.
      Saves 8 bytes per item in memory, reduces exe file size
    }

    {NOT$DEFINE RVDONOTUSELINEARPOSITIONS}
    {
      Define, if you do not need to process EM_GETSEL, EM_GETTEXTRANGE and EM_SETSEL
    }

    {NOT$DEFINE RVDONOTUSERVMEMORYSTREAM}
    {
      Disables custom (more efficient for saving large data) memory stream
      implementation. Reduces exe file size
    }

    {NOT$DEFINE RVDONOTUSEDOCPARAMS}
    {
      Define to exclude TCustomRichView.DocParameters
    }

    {NOT$DEFINE RVDONOTUSEOLECONTAINER}
    {
      Does nothing. Reserved.
    }

    {$IFDEF RVDONOTUSETABLES}
      {$DEFINE RVDONOTUSEINPLACE}
    {$ENDIF}
    {------------------------------------------------------------------------------}
    { Other defines                                                                }
    {------------------------------------------------------------------------------}
    {NOT$DEFINE RVPBEARCOMPAT}
    {
      Define to make HTML output more compatible with THTMLViewer (www.pbear.com)
      Some unnecessary tags will be saved.
    }

    {NOT$DEFINE RVFPICTURENEEDED2}
    {
      Define to add OnRVFPictureNeeded2. It is the same as OnRVFPictureNeeded,
      but called for pictures that stored in RVF, before they are loaded.
      You can provide your own picture instead of the picture stored in RVF
    }

    {NOT$DEFINE RVDRAWPARAMARKSBEFORE}
    {
      Activate to draw paragraph marks (in show-special-characters mode) not
      only at the end of paragraphs, but also before them.
    }


    {NOT$DEFINE RVEDITIGNORESESCAPE}
    {
      If defined, TRichViewEdit and TDBRichViewEdit (if IgnoreEscape=True) controls
      do not receive messages when Escape is pressed. Useful when placed in modal
      dialogs, so that editors do not steal Escape from a Cancel button.
    }


    {NOT$DEFINE RVLANGUAGEPROPERTY}
    {
      If defined, text style has additional property - Language: Cardinal
    }
    {NOT$DEFINE RVLIVESPELLEXEVENT}
    {
      If defined, RichView has additional event - OnSpellingCheckEx.
      This event has higher priority than OnSpellingCheck.
    }

    {NOT$DEFINE RVUSETEXTHOVERCOLORWITHSELECTED}
    {
      Define if you wish to return behavior of v1.2-, where text hover color was
      used even for selected text.
    }

    {NOT$DEFINE DONOTDECVSCROLLUNITS}
    {
      Define to forbid RichView to decrease vertical scrolling units automatically
      when needed (if you wish to control scrolling units yourself).
    }

    {NOT$DEFINE RVDONOTCORRECTWMFSCALE}
    {
      There is a problem in Delphi TMetafile class (wrong size) when pasting
      some metafiles from Clipboard. RichView tries to correct it.
      Turn this define on, if you have troubles with metafile sizes when pasting.
    }

    {$DEFINE RVALLOWCPBYCP}
    {
      RichView since version 1.0 does not allow to add one checkpoint just after
      another.
      When defined (default), second checkpoint is ignored.
      When not defined, RichView raises exception.
    }

    {------------------------------------------------------------------------------}
    { RTF                                                                          }
    {------------------------------------------------------------------------------}
    {NOT$DEFINE RVRECHECKRTFPARA}
    {
      If defined, when importing RTF file, paragraph properties are rechecked
      when inserting each item (otherwise, only when inserting the first paragraph's
      item). Slows reading down, but provides the same results as MS Word when
      RTF file contains contradicting data for the same paragraph (buggy RTF files)
    }

    {NOT$DEFINE RVRTFNOUNICODEFONTNAMES}
    {
      Makes sense for Unicode versions of Delphi (2009+).
      If defined, font names are converted from Unicode to the current system
      code page before saving to RTF. This conversion may lose information,
      but some RTF readers (including RichEdit and Wordpad) do not expect
      Unicode characters in font names
    }

    {NOT$DEFINE RVRTFSAVEHIGHLIGHT}
    {
      If defined, text color is saved using \highlight instead of \chcbpat
      Good for Wordpad/RichEdit, bad for MS Word.
    }

    {NOT$DEFINE RVRTFDONOTUSEPICSCALE}
    {
      If defined, picture sizes are saved only as picwgoal and pichgoal, without
      picscalex and picscaley. More precise, but size of picture in 100% is not
      defined.
    }
    {------------------------------------------------------------------------------}
    { Automatical defines:                                                        }
    {------------------------------------------------------------------------------}
    {$IFDEF RICHVIEWCBDEF1}
    {
    IME (Input Method Editor) support is disabled for Delphi 2.
    D2 has required library file - Imm.pas in sources, but does not have it in library (?!).
    So I think support for D2 is possible, but requires some IDE configuration...

    }

    {$IFNDEF RVDONOTUSEUNICODE}

    {$DEFINE RVUSEIME} // Using IME

    {$ENDIF}
    {$ENDIF}

    {$IFNDEF RICHVIEWDEF3}
    // Turning off Jpeg support for Delphi2, C++Builder 1,3
    {$DEFINE RVDONOTUSEJPEGIMAGE}

    {$ENDIF}

    {$IFNDEF RICHVIEWCBDEF3}
    // Turning off D&D support for Delphi2, C++Builder 1
    {$DEFINE RVDONOTUSEDRAGDROP}
    {$ENDIF}

    {$IFNDEF RVDONOTUSELISTS}
      {$DEFINE RVUSELISTORSEQ}
    {$ELSE}
      {$IFNDEF RVDONOTUSESEQ}
        {$DEFINE RVUSELISTORSEQ}
      {$ENDIF}
    {$ENDIF}

    {$IFDEF RICHVIEWDEF2009}
      {$DEFINE RVUNICODESTR}
      {$DEFINE RVUNICODEWINDOW}
    {$ENDIF}

    {.$DEFINE RVDEBUG}

    {.$DEFINE RVFLATSCROLLBARS}

    {.$DEFINE RVONCUT}

    {.$DEFINE RVWATERMARK}

    {.$DEFINE RVUSEBASELINE}

    {.$DEFINE RVNESTEDFORMS}

    {.$DEFINE RVOLDTAGS}


    [2] Duplicate the files…

    RVPkgDXE2.dpk
    RVPkgDXE2.dproj
    RVPkgDXE2.res

    RVDBPkgDXE2.dpk
    RVDBPkgDXE2.dproj
    RVDBPkgDXE2.res

    …and rename the endings from XE2 to XE4.

    [3] Open the files…

    RVPkgDXE4.dpk
    RVPkgDXE4.dproj

    RVDBPkgDXE4.dpk
    RVDBPkgDXE4.dproj

    …with an editor and replace all XE2 to XE4.

    [4] Open the project file RVPkgDXE4.dproj and compile it. Everytime you got the error "E2251 (…) of '…'" add the following line before the function.
    {$IFDEF RICHVIEWDEFXE4}AnsiStrings.{$ENDIF}


    This have to be done…

    …in the unit 'CRVFData.pas' you have to replace…

            SpacePos := StrScan(TmpStr, ' ');

    with

            SpacePos := {$IFDEF RICHVIEWDEFXE4}AnsiStrings.{$ENDIF}StrScan(TmpStr, ' ');


    …and in the unit 'RVItem.pas' you have to replace…

    Hint := RVFStringToString(AnsiExtractQuotedStr(P, '"'), UTF8Strings);

    with

        Hint := RVFStringToString({$IFDEF RICHVIEWDEFXE4}AnsiStrings.{$ENDIF}AnsiExtractQuotedStr(P, '"'), UTF8Strings);


    [5] Install the package

    [6] Open the project file RVDBPkgDXE4.dproj, compile and install it.

    Download
     
  2. tonicon
    Offline

    tonicon DF Member

    Gracias
     
  3. centralpoint_cahyo
    Offline

    centralpoint_cahyo DF Member

  4. peresjackass
    Offline

    peresjackass DF Junior

    thank you
     
  5. clodoaldofc
    Offline

    clodoaldofc Guest

    RE:

    valeu
     

Share This Page

Laws
Our website, law, laws, copyright and aims to be respectful of individual rights. Our site, as defined in the law of 5651 serves as a provider of space. According to the law, contrary to the law of site management has no obligation to monitor content. Therefore, our site has adopted the principle of fit and remove. Works are subject to copyright laws and is shared in a manner that violated their legal rights, or professional associations, rights holders who, adsdelphi@gmail.com I can reach us at e-mail address. Complaints considered to be infringing on the examination of the content will be removed from our site.
Donate Help To Us and Be VIP
DONATIONS WITH PAYPAL CLICK TO BUTTON
6 MONTHS VIP - 20$; 1 YEAR VIP - 30$; 2 YEARS VIP - 50$; GOLD USER FOR LIFE VIP - 150$
Social Block