4D Write Pro: Handle view properties by programming

4D Write Pro documents can be displayed in different modes (draft, page and embedded), each with their own viewing options. For example in Page view mode, you can choose to hide both the vertical and the horizontal rulers, but keep the headers and footers visible. The same goes for many other display properties such as zoom, spell check, page frames, etc. Thirteen different viewing options can be defined. The good news is that rather than handling all of these properties manually, it can now be done programmatically.

HDI: View settings

4D Write Pro view settings are not a part of document. This is what enables having multiple view modes for a single document. A typical example is to display the same document differently, according to the context. When you read a document, horizontal and vertical rulers are usually useless. It’s the same for spell check and page frames. But you do want to see the background so you can get a good idea of the final print rendering.

New commands

Scenario: I want to see the page frames, but I don’t need the spell checker…


WP SET VIEW PROPERTIES(*;"WParea";New object(wk visible page frames;True;wk auto spellcheck;False))

What about getting the properties already set?

The settings are returned by the WP Get view properties command. It returns an object with all of the view properties at once!

Check out the HDI to see the new commands in action. More details can be found on the doc center.

Roland Lannuzel
• Product Owner & 4D Expert •After studying electronics, Roland went into industrial IT as a developer and consultant, building solutions for customers with a variety of databases and technologies. In the late 80’s he fell in love with 4D and has used it in writing business applications that include accounting, billing and email systems.Eventually joining the company in 1997, Roland’s valuable contributions include designing specifications, testing tools, demos as well as training and speaking to the 4D community at many conferences. He continues to actively shape the future of 4D by defining new features and database development tools.