Archive: What was new in WPTools 8

<< Click to Display Table of Contents >>

Navigation:  New Features in WPTools 9 >

Archive: What was new in WPTools 8

1) Dynamic/Live database tables in the document (included in "Premium" and Bundle editions)

 

Do you need to present the user the result of a database query and also print it? With WPTools' dynamic tables the user can not only browse the result of the query, but also change the appearance of the table and the data cells and print it in WYSIWYG manner.

In contrast to "data-grid" solutions, it is also possible to copy part of the created tables and paste them directly into a word processor program, such as MS Word or, of course, TWPRichText.

 

This is a new tool we are really excited about. It is consequently based on the powerful RTF-Engine classes of WPTools so it will not add a lot of "bloat" to your application since it reuses features which are in WPTools anyways. For example styles. With the new dynamic tables you can set up a style for each column - that style is stored as a string which is encoded in a readable format (WPCSS - our format to save styles also in WPTOOLS format).

 

Please note: The License for this tool does not include the production of software which is designed to attach to "general" databases which can be used for any tasks - this means it may not be used in a universal database application or reporting tool.

 

This is an example for a dynamic table created from the "BIOLIFE" database:

 

    dynamic_table

 

There is no code required to create this sortable table. It is all done by TWPTextProducerDB

 

 

Live table can be created using the API AddDynamicGrid and GridUpdate - but the best option is to use the new TWPTableProducer and TWPTableProducerDB component. This "Producer" components contain collections of "Blocks" which each can contain some formatted text and the description of columns to build one or more table rows. Using link properties "ClientName" and "NextName" a chain can be built to display relational data.

 

 

  tableproducer_simple_master_client

Above is a rather simple example for an automatically created table. It just uses a master and a client "Block". The master defines 3 columns and contains a "TemplateText" which is displayed before the client data. If you need more features - a lot is possible. You can split up the columns into multiple rows, use merged cells (horizontally and vertically).

 

Since a template lies behind each of the data cells, it is also possible to make changes to the cells. And all cells which are based on the same template will reflect the change. So it is easy to change the background color for all master rows.

 

Once you got use to this tool you probably will use it a lot to display and print lists or simple reports (such as invoices) right with WPTools. Instead of special export tools for your favorite "grid" control, you can display the data right in the word processor. This makes it possible to save the text as RTF, optionally as DocX or PDF right away - and, best of all, the user of your application can also change the document if they wish too. Such as changing the page size, margins, header and footer.

 

Components which serve for this new feature:

TWPTableProducer

TWPTableProducerDB

TWPDataSetAdapter

API: WPRichText.AddDynamicGrid() and Paragraph.GridUpdate()

 

 

2) Improved TWPMMDataProvider

 

Using this component it is even easier to create a form to display text and images from a database. It also support updating the database when the user changes the text in a field inside of the editor.

 

It now also supports fields which store the name of a certain image to be loaded into an image object.

 

3) Sorting and Filtering in tables.

 

Now it is possible to sort a table by comparing text in a certain column. Similarly it is also possible to hide rows which meet certain criteria. The sorting logic has been developed carefully, so it is possible to even sort a table with mixed data rows such as in the screen shot above. Rows which belong to a certain "master" row, will be handled as if they were children of that row, this means that sorting will not move the data apart and filtering will hide the sub data row when the master data row was also hidden.

 

API: WPRichText.TableFilterSort

 

3) Improved style scrolling component - TWPStyleScroller.
 

With this component the user can quickly select a paragraph styles for the selected text.

 

style_scroller

 

4) Numbering has been revised.

 

Numbering now allows the use of multiple outline groups in one document. When appending a document in WPT format, it is now (optionally) possible that the included outline groups are added which makes sure, that the numbering starts new for each appended text.

 

The Distance between number text and headline is now automatically adjusted:

 

adjust_number_distance

 

 

The number dialog has been updated and it now also allows the creation of new and additional outline definitions.

While the numbering dialog is open, the current numbers in the document are being highlighted.

Using the context menu of the number items in the dialog it is possible to replace a number- or outline style in the document.

 

  outlines_and_numbering

 

 

5) Rotated Labels

 

The improved TWPTextObject makes it possible to display a vertical label in a table.

 

 Example: ATable.rows[0].cols[0].SetTextObject( '', 'SomeText', [wpTextRotate90]);

 

This feature is not supported in Delphi 5, 6 and 7.

 

 

6) Dynamic Objects

 

This objects are displayed for a paragraph and make it possible to add clickable buttons to a paragraph or cell.

 

(used for selection marks, cursor and column sort buttons.)

 

7) Live Binding

 

The TWPRichText now supports LiveBinding

 

8) Interactive Cursor and Selection - with touch support

 

    clip0216

clip0217

9) Touch support for scrolling and zooming

 

When a touch screen is used, the text can be scrolled and zoomed using gestures automatically.  

Touch.InteractiveGestures := [] disables the touch support if necessary.

 

 

10) function TParagraph.CharAttrModify()

 

Using this new function it is now possible to modify the attributes of text of a TParagraph directly.

This will not change the attributes which are used by all characters, but the "CharAttr" assoziated with each singular character.

 

procedure TParagraph.CharAttrModify(

      WPAT_Code : Integer;

      Value : Integer;

      ModifyMode : TWPCharAttrModifyMode = wpSetValue;

      StartPos : Integer = 0;

      Len : Integer = MaxInt );

 

TWPCharAttrModifyMode = (wpSetValue, wpSetColorValue, wpDelete, wpAddValue, wpSubtractValue {not negative!} , wpOrValue, wpAndNotValue);

 

 

11) Much enhanced footnotes in WPTools "Premium"

 

Footnotes were in WPTools "Premium" since many years now. But with WPTools 8.01 the support was much enhanced. Any footnote may now be longer than one page, in fact it can span multiple pages! (If you need the old behavior which created a new page when a footnote did not fit on the current, you can still activate this in in the property FormatOptionsEx.)

 

footnote_page_span

 

Other improvements and fixes:

 

+ Print a TWPTextObject as bitmap. This is useful to hide the text from mail service applications (usually printer driver)

  which analyse the text on a page to read the address a letter should be sent to. (wpPrintAsBitmap)

+ TableAdd can create up to 3 table header and up to 3 footer rows.

+ TParagraph.QuickFind('{~*~}' ... can be used to locate tokens in the text.

+ WPGutter: Collapse grouped areas in a table

+ ValueEdit - preserve value loaded from DFM

+ MailMerge - can be preformed in a "ReadOnly" fashion

+ MailMerge - LoadImageFromFile

and hundreds of more small changes to improve the editing experience

* GetCharAttr has new options