Command WR SET DOC PROPERTY

4D Write

WR SET DOC PROPERTY

version 6.5 (Modified)


WR SET DOC PROPERTY (area; property; value)

ParameterTypeDescription
areaLongint4D Write area
propertyIntegerNumber of the property to set
valueNumberValue for the selected property

Description

The WR SET DOC PROPERTY command allows you to modify the document properties in the 4D Write area referenced by area.

The meaning given to the value parameter depends on the property value used. property and value can be set using constants.

The constants of the "WR Document properties" theme are described below.

The following constants can be used with WR SET DOC PROPERTY and WR Get doc property. You can also use the constants of the "WR Parameters" theme to set the values:

Constants (value)Allows setting or getting:
wr first page (0)the first page number (1 by default). If you set, for example,
the value 10, the 2nd page will be number 11, etc.
wr view mode (1)the document view mode: wr page mode (0) or
wr normal mode (1)
wr view rulers (2)the display status of the ruler: wr hidden (0) or wr displayed (1)
wr view frames (3)the display status of text frames: wr hidden (0) or wr displayed (1)
wr view headers (4)the display status of headers: wr hidden (0) or wr displayed (1), does
not apply to the first page header if it is different from
others (use 'wr view first page header')
wr view footers (5)the display status of footers: wr hidden (0) or wr displayed (1), does
not apply to the first page footer if it is different from
others (use 'wr view first page footer')
wr view pictures (6)the display status of pictures: wr hidden (0) or wr displayed (1)
wr view Hscrollbar (7)the display status of horizontal scrollbars: wr hidden (0) or
wr displayed (1)
wr view Vscrollbar (8)the display status of vertical scrollbars: wr hidden (0) or
wr displayed (1)
wr view statusbar (9)the display status of the status bar: wr hidden (0) or wr displayed (1)
wr view menubar (10)the display status of the menu bar: wr hidden (0) or wr displayed (1)
wr view standard palette (11)the display status of the standard tool palette : wr hidden (0) or
wr displayed (1)
wr view format palette (12)the display status of the format toolbar: wr hidden (0) or
wr displayed (1)
wr view style palette (13)the display status of the style toolbar: wr hidden (0) or wr displayed (1)
wr view borders palette (14)the display status of the borders toolbar: wr hidden (0) or
wr displayed (1)
wr view invisible chars (15)the display status of invisible characters: wr hidden (0) or
wr displayed (1)
wr view references (16)the display status of references: wr hidden (0) or wr displayed (1)
wr view column separators (17)the presence of a vertical separator between columns in
multi-columns mode - corresponds to the Vertical
separator option in the Columns dialog box:
wr hidden (absence) (0) or wr displayed (presence) (1)
wr different on first page (18)if headers and footers are different on first page - corresponds
to the 'Different on first page' option in the Preferences
dialog box: wr similar (0) or wr different (1)
wr different left right pages (19)if headers and footers are different between left and right
pages - corresponds to the 'Different on left and right pages'
option in the Preferences dialog box: wr similar (0) or wr different (1)
wr widow orphan (20)if widow and orphan are taken into account - corresponds to
the 'Widow and Orphan Control' option in the Preferences
dialog box: wr ignored (0) ou wr managed (1)
wr unit (21)the document current unit - corresponds to the 'Unit' pop up
menu in the Preferences dialog box: wr centimeters (0), wr inches (1)
or wr pixels (2)
wr default tab (22)the default "automatic" tab spacing expressed in the current
document unit - corresponds to the 'Default Tab Spacing'
area in the Preferences dialog box (by default 0.5 inches;
1.3 centimeters; 36 pixels)
wr language (23)the language associated with the document (American
English = 1033, Australian English = 3081, English = 2057,
Catalan = 1027, Danish = 1030, Dutch = 1043, Finnish = 1035,
French = 1036, French Canadian = 3084, German = 1031,
Italian = 1040, Norwegian Bokmal = 1044, Norwegian
Nynorsk = 2068, Portuguese Brazil = 1046, Portuguese
Iberian = 2070, Spanish = 1034, Swedish = 1053,
Russian = 1049, Czech = 1029, Hungarian = 1038,
Polish = 1045)
wr number of columns (24)the number of columns of the document
wr columns spacing (25)the spacing value between each column expressed in the
current document unit - corresponds to the 'Spacing' area
of the Columns dialog box.
wr binding (26)the binding size expressed in the current document unit
- corresponds to the 'Binding' area in the Preferences dialog
box
wr opposite pages (27)the opposite pages mode of the document - corresponds to
the 'Opposite pages' option in the Preferences dialog box:
wr single sided pages (0) or wr double sided pages (1)
wr right first page (28)if the first page is a left page or a right page - right page by
default: wr left page (0) or wr right page (1)
wr text inside margin (29)the margin between the left side of the text and the left side
of the paper for a right page, right sides for a left page,
expressed in the current document unit
wr text outside margin (30)the margin between the right side of the text and the right
side of the paper for a right page, left sides for a left page,
expressed in the current document unit
wr text left margin (29)the margin between the left side of the page and the left side
of the paper expressed in the current document unit
wr text right margin (30)the margin between the right side of the page and the right
side of the paper expressed in the current document unit

If the 'Different on first page' option in the Preferences dialog box has been selected, the following constants should be used for all pages except for the first one:


wr text top margin (31)the margin between the top of the page body and the top edge
of the paper expressed in the current document unit, use 'wr
first page top margin' for the first page if different from
others
wr text bottom margin (32)the margin between the bottom of the page body and the
bottom edge of the paper expressed in the current document
unit, use 'wr first page bottom margin' for the first page if
different from others
wr header top margin (33)the margin between the top of the page header and the top
edge of the paper expressed in the current document unit,
use 'wr header 1st page top margin' for the first page if
different from others
wr header bottom margin (34)the margin between the bottom of the page header and the
top edge of the paper expressed in the current document unit,
use 'wr header 1st page bottom mg' for the first page if
different from others
wr footer top margin (35)the margin between the top of the page footer and the bottom
edge of the paper expressed in the current document unit, use
'wr footer 1st page top margin' for the first page if different
from others
wr footer bottom margin (36)the margin between the bottom of the page footer and the
bottom edge of the paper expressed in the current document
unit, use 'wr footer 1st page bottom mg' for the first page if
different from others

wr paper width (37)the paper width expressed in the current document unit (*)
wr paper height (38)the paper height expressed in the current document unit (*)
wr dead left margin (39)the non-printable area reserved by the printer on the left of
the paper, expressed in the current document unit (this value
cannot be set; it can only be read) (*)
wr dead top margin (40)the non-printable area reserved by the printer at the top of
the paper, expressed in the current document unit (this value
cannot be set; it can only be read) (*)
wr printable width (41)the horizontal printable area starting from the dead left
margin (this value cannot be set; it can only be read). The
right dead margin equals the paper width; the left dead
margin-the printable width
wr printable height (42)the vertical printable area starting from the top left margin
(this value cannot be set; it can only be read). The
bottom dead margin equals the paper height; the top dead
margin-the printable height
wr data size (43)the size of the document in bytes (this value cannot be set; it
can only be read)
wr undo buffer size (44)the size of the undo buffer in bytes (this value cannot be set; it
can only be read)
wr horizontal splitter (45)the display status of the horizontal splitter: wr hidden (0) or
wr displayed (1)
wr vertical splitter (46)the display status of the vertical splitter: wr hidden (0) or
wr displayed (1)
wr links color (47)the color of the hyperlinks, while they are not visited
wr visited links color (48)the color of the hyperlinks once they have been visited
wr view frame area (49)the presence of a frame around the area in the form:
wr hidden (no frame) (0) or wr displayed (frame)(1)

The following constants (50 to 57) should be used for the first page of your document when the 'Different on first page' option in the Preferences dialog box has been set.


wr view first page header (50)the display status of the first page header: wr hidden (0) or
wr displayed (1), use 'wr view headers' for the other pages
wr view first page footer (51)the display status of the first page footer: wr hidden (0) or
wr displayed (1), use 'wr view footers' for the other pages
wr first page top margin (52)the margin between the top of the first page body and the top
edge of the paper expressed in the current document unit, use
'wr text top margin' for the other pages
wr first page bottom margin (53)the margin between the bottom of the first page body and the
bottom edge of the paper expressed in the current document
unit, use 'wr text bottom margin' for the other pages
wr header 1st page top margin (54)the margin between the top of the first page header and the
top edge of the paper expressed in the current document unit,
use 'wr header top margin' for the other pages
wr header 1st page bottom mg (55)the margin between the bottom of the first page header and
the top edge of the paper expressed in the current document
unit, use 'wr header bottom margin' for the other pages
wr footer 1st page top margin (56)the margin between the top of the first page footer and the
bottom edge of the paper expressed in the current document
unit, use 'wr footer top margin' for the other pages
wr footer 1st page bottom mg (57)the margin between the bottom of the first page footer and
the bottom edge of the paper expressed in the current
document unit, use 'wr footer bottom margin' for the other
pages


wr draft mode (58)the document text entry mode: wr wysiwyg (0) or wr draft (1)
wr column width (59)the column width expressed in the current document unit
(this value cannot be set; it can only be read).

(*) When you set the paper size programmatically, 4D Write will consider that a "virtual" printer device is used. The program will set the dead margins to zero and the printable area will be equal to the paper size. This feature is useful for documents which are not intended to be printed.

Examples

1. You want to display a 4D Write area on screen without its menus and rulers:

   If(Form event=On load)
      WR SET DOC PROPERTY(Area;wr view menubar;wr hidden)
      WR SET DOC PROPERTY(Area;wr view rulers;wr hidden)
   End if

2. This method allows the user to display or hide the scroll bars:

   C_LONGINT(ScrollStatus)
   ScrollStatus:=WR Get doc property(Area;wr Hscrollbar)   `Constant=7
   ScrollStatus:=ScrollStatus+WR Get doc property(Area;wr Vscrollbar)   `Constant=8
   If (ScrollStatus>0)
      CONFIRM("At least one scroll bar is displayed, do you want to hide them?")
      If (OK=1)
         WR SET DOC PROPERTY(Area;wr Hscrollbar;wr hidden)
         WR SET DOC PROPERTY(Area;wr Vscrollbar;wr hidden)
      End if 
   Else 
      CONFIRM("Scroll bars are hidden, do you want to display them?")
      If (OK=1)
         WR SET DOC PROPERTY(Area;wr Hscrollbar;wr displayed)
         WR SET DOC PROPERTY(Area;wr Vscrollbar;wr displayed)
      End if 
   End if 

See Also

WR Get doc property.