📄 upgrade.txt
字号:
WPTools 5 - THE NATIVE DELPHI EXPRESS TEXTER
CopyRight (C) 2004 by WPCubed GmbH and Julian Ziersch
http://www.wptools.de
---------
What's new - please see history.txt and PDF manua!
---------
Please backup your projects and data before loading with WPTools 5
---------
WPTools 5 supports Delphi 2005 Win32, Delphi 5-7 and C++Builder 5 & 6
---------
We highly recommend to to first examine the included demos
before starting to convert a WPTools 4 project.
The following features have not been ported form WPTools 4 to WPTools 5 yet:
- RB interface has not been completely implemented yet
- QuickReport support is not planned
Please check out the demo 'Localization - it works slightly different to V4.
---------
C++Builder Users: Please check out the PDF Manual.
If the HPP files are recreated the compiler will
find 3 errors in wprtedefs.hpp. Please delete those
three lines. (all start with 'operator')
---------
If you use TWPRichText.Clear please note that this will absolutely
clear the text buffer. Most text adding operations (such as AddTable)
will fail immediately after Clear; You need to use the procedure
CheckHasBody to make sure a new body text block has been created
unless you do not need to create a different text block (such as
header or footer) first.
If you create text or load it and need to print it right away
(or export to PDF) and call to ReformatAll is required!
---------
This text explains some of the changes you will come across when you upgrade your project to WPTools 5.
For the newest information please check out our bulletin board at
http://wpcubed.com/forum/viewforum.php?f=13
A) Changed unit names
The units WPDefs, WPObj, WPPrint, WPLabel,
WPRtfTXT, WPRtfPA, WPrtfIO, WPRTFInp,
WPEmOBJ, WPJpgObj, WPGifOBJ,
WPXMLFile, WPReadHT, WPWrtHT, WPReader, WPWrite2, WPWrtRTF
have been removed. Please now use
WPRTEDefs, WPRTFPaint - for the RTF-Engine
WPIO - for all reader and writer units and the graphic support
WPCtrMemo, WPCtrRich - for the memo control
WPCtrLabel - for the Richtext label
IMPORTANT: If the property "AllowMultiView=TRUE" a TWPRichText on a form remains
empty until it was used the first time.
This is effect is required to make it possible to attach several TWPRichText
objects to the same RTFData object.
The property RTFText has priority over the property Header. If any text has been
set in 'RTFText' it will overwrite the PageWidth values preset in 'Header'
In AllowMultiView mode the properties EditBoxMode, ViewOptions and Header
cannot be changed in the IDE!
B) Some properties use a different type:
"WorkOnText"
Instead of
WPRichText1.WorkOnText := wpBody write
WPRichText1.WorkOnText := wpIsBody
Instead of
RtfTextEdit.WorkOnText := TWPWorkOnOptions(WorkOnText.ItemIndex); write
RtfTextEdit.WorkOnText := TWPPagePropertyKind(WorkOnText.ItemIndex);
FormatOptions contains all properties used to be in ViewOptions
and require a reformat of the text.
OpenCodesAtCP and other procedures do not any longer work with a
TList object. Instead a TWPTextObjList is used.
OnYPosChanged is not supported anymore. Please use OnChangeCursorPos
Header.StoreOptions / Header.LoadOptions have been moved to the TWPRTFDataCollection,
WPRichText1.HeaderFooters. But they are only there for compatibiulity reasons.
Please use format strings (see LoadFromFile(filename, formatstring)). The options for
the format strings are described in the HLP at TWPToolsReaderWriter.SetOptions.
C-1) TLine and PTLine is not used anymore
Any character can now be identified by its host paragraph (par : TParagraph) and
the position (pos_in_par : Integer). The format routine still vurtually split up
a paragraph into lines, the offset and lengths of this lines can be retrieved
using the TParagraph functions LineOffset and LineEndOffset.
C-2) PTAttr and TAttr is not used anymore
Characters in WPTools 5 have their own set of properties. This properties have
priority over the properties of the paragraph or the span codes the text is located in.
But the properties aree not located in records which are stiored "parallell"
to the character itself. Instead only a 3 byte number is stored which is used as
index into a table of character properties, the AttrCache. This means that it is not possible
to simply change the attribute of a character by changing a value in the memory.
Instead the value must be changed and a new index in the AttributeCache must be found which
reflects the changed attribute record.
This is automatically done by the various and very powerful attribute interface classes,
most important WPRichText.TextCursor.
D) Removed functions
"Set_ParBorderFinish"
Please use ASetAdd(WPAT_BorderFlags, WPBRD_DRAW_Finish);
"InputTextFieldNameMask"
Please use the optional 'FieldMask' parameter of InputTextFieldName
"AsANSIString" does not create a fixed-cpi text representation of the
text. It is a specialized version of the 'AsString' functionliyt to make
it possible to provide a format string, such as 'HTML-onlybody,';
"CreateDynamic" . this special constructor is not required anymore.
A TWPRichText can be used to process and render formatted text even if it was
created just like this: WPRichText1 := TWPRichText.Create(nil);
No parent form is required!
But please note that the broadcast system which is used by a TWPRichText
component requires a Handle. Since without this system the text will not
be formatted you need to start formatting using "WPRichText1.ReformatAll;"
Memo.TxtObjLst does not exist anymore. In WPTools 5 each paragraph has its own
list of contained objects. Usually you can retrieve the properties which used
to be extracted from TxtObjLst directly from the class TWPTxtObj, so
instead of
for i:=TempList.Count-1 downto 0 do
BListBox.Items.Add(WPRichText1.Memo.TxtObjLst.Names[Integer(TempList[i])]) ;
you will write
for i:=TempList.Count-1 downto 0 do
BListBox.Items.Add(WPRichText1.Memo.TxtObjLst.Names[Integer(TempList[i])]) ;
with to be an instance of the class TWPTextObjList
BookmarkAtParLin now use a PosInPar position and returns the bookmark as TWPTextObj
BookmarkAtXY uses a TWPTextObj reference instead of a "var tag : Integer"
BookmarkAtCP returns a TWPTextObj instead of a string. You can read out the property 'Name'
** Renamed propcedures
SelectCode = CodeSelect
E) Current writing mode:
Code such as
var
a : TAttr;
begin
a := RtfTextEdit.Attr;
include(a.Style, afsBold);
RtfTextEdit.Attr := a;
end;
Should not be used! Please rplace this code with
something like RtfTextEdit.CurrAttr.AddStyle([afsBold]);
Character styles:
Please note that the following afsXXX are obsolete
afsAutomatic
afsIsInsertpoint
F) TWPObject changes
The Constructor was
constructor Create(AOwner: TComponent); override;
it is now
constructor Create(RTFData: TWPRTFDataCollection); virtual;
Procedure
procedure TWPObject.Paint;
has been replaced by
procedure TWPObject.Paint(toCanvas: TCanvas; BoundsRect : TRect);
F) Footnote support
function FootNoteInsert(C: Char; nr: Longint; const str: string;
Format : string = 'ANSI'): TWPTextObj;
function FootNoteGet(var tag: Integer; var nr: Longint; var str: string;
Format : string = 'ANSI'): TWPTextObj;
function FootNoteAtCP: TWPTextObj;
function FootnoteFindNext(var obj: TWPTextObj; var pos: Longint): Boolean;
function FootnoteFindPrior(var obj: TWPTextObj; var pos: Longint): Boolean;
procedure FootnoteGetList(list: TStrings; numbers, chars: Boolean);
Integer 'Tags' are not any longer used.
Note: In WPTools Standard footnotes can only use text in ANSI format. Only
WPTools Premium supports footnote printing and loading and saving in
RTF format.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -