Command 24: Draw lines and background, Page Size, Force Pagecount

[Top]  [Chapter]  [Previous]  [Next]

Using this command various page size and drawing options can be changed.

 

paramA selects the id of the option, paramB changes it.

 

 

1) Set the current and, at the same time, the default page size.

 

ParamA can be one of this IDs, paramB is expected to be a twip value.

    WIPR_PAGE_WIDTH = 1;

    WIPR_PAGE_HEIGHT = 2;

    WIPR_PAGE_LEFT_MARGIN = 3;

    WIPR_PAGE_RIGHT_MARGIN = 4;

    WIPR_PAGE_TOP_MARGIN = 5;

    WIPR_PAGE_BOTTOM_MARGIN = 6;

    WIPR_PAGE_HEADER_MARGIN = 7;

    WIPRPAGE_FOOTER_MARGIN = 8;

Alternatively the page size can be changed using the interface PageSize.

 

 

2) Select the current page drawing mode:

 

a) Select the mode:

    WIPR_ED1_PAGE_DRAW_MODE = 9;

 

This is a bitfield. The following values are possible and be combined:

1: draws one bitmap in the background (Watermark) - this can be toggled using "wpaShowWatermark".

 

2: draw two bitmaps in the background, but only on screen. This can be used to draw a simulated notebook.

The images which are drawn can be selected using with the Background Image Commands. Use action wpaShowBackgroundImage to change the state.

 

4: draw a rectangle or lines around the page.

The display can be toggled using the action wpaShowAddressArea.

You can select the line mode using WIPR_ED1_PAGE_LINE_MODE.

 

8: draw and print a folding line at 1/3 of the page. Use Action wpaShowFoldLine.

 

32: draw and print a line through the unused area at the bottom of a page. Action wpaShowInvalidateAllPages toggles the option.

 

64: draw and print a line through the unused area at the bottom of last page. Action wpaShowInvalidateLastPage toggles the option.

 

128: Draw the page number in the lower right corner.

 

b) Select the line mode ("Address Area")

    WIPR_ED1_PAGE_LINE_MODE = 10; // 0=adress top-left, 1=addres top right, 2=lineoffset

 

ParamB can be

0 : Draw a rectangle at the top left area

1 : Draw a rectangle at the top right area

2 : Draw lines in a certain offset of the borders of the page. (Don't mix up with the margins)

3 : Draw lines in a certain offset of the borders of the page.

    Exchange the left and right offset for even pages.

4:  Draw the lines only on the first page.

 

Use this IDs to set the offset values in twips. If a value remains 0, the line is not drawn.

    WIPR_ED1_PAGE_LINEOFFSET_LEFT = 11;

    WIPR_ED1_PAGE_LINEOFFSET_RIGHT = 12;

    WIPR_ED1_PAGE_LINEOFFSET_TOP = 13;

    WIPR_ED1_PAGE_LINEOFFSET_BOTTOM = 14;

 

Note: You need to use Command(24, 9, 4) to activate the display.

 

Example: Draw lines - all offsets at 360

Memo.TextCommand(24, 9, 4);

Memo.TextCommand(24, 10, 2);

Memo.TextCommand(24, 11, 360);

Memo.TextCommand(24, 12, 360);

Memo.TextCommand(24, 13, 360);

Memo.TextCommand(24, 14, 360);

clip0212

 

 

3) Force a certain page count in the editor

 

a)     WIPR_ED1_PAGES_MINCOUNT = 15

 

Forces the text to have at least the given number of pages. The added pages are drawn empty.

 

b)     WIPR_ED1_PAGES_MAXCOUNT = 16

 

Any additional pages than the given number are not displayed.

On screen a "plus sign" is displayed if the page count exceeds the count of displayed pages:

clip0213

 

c) WIPR_ED1_PAGES_MULTIPLICATOR = 18

 

Forces the page count to be dividable by the given value. If required, empty pages are appended.

 

Please note, that a second editor can show the same text with a different count of pages.

For example the thumbnail view will display less then X pages unless You also execute the same code for "Memo2".

 

4) Read the current page Count

 

Use either TextCursor.PageCount or this command with the id WIPR_ED1_PAGECOUNT = 17

 

 

Note:

In case You cannot use the COM Interface IWPMemo, this feature is also available by sending the windows message 1031 to the editor.

Parameters wparam as paramA, lparam as paramB.

If you need to modify editor#2, just add the value 100 to wparam.

Also see "TextDynamic as Popup Editor (method wptextCreateDialog)".

 


[command_24_draw_lines__page_si.htm]    Copyright © 2007 by WPCubed GmbH