KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: How to customize the default 4D Write stylesheet
PRODUCT: 4D | VERSION: 13.3 | PLATFORM: Mac & Win
Published On: July 25, 2013

A 4D Write Area uses a style sheet by default. The default style sheet is assigned the number 1 and is given the name "Normal." The default style sheet cannot be changed via the Property List, however it can be done programmatically.

The following code can be called from the 4D Write object method during the On Load event or following a call to WR New Offscreen area. This technique does not work for a 4D Write area established using Open external window.

C_POINTER($WriteArea_P;$1)
C_LONGINT($OS_L)

$WriteArea_P:=$1

PLATFORM PROPERTIES($OS_L)

If ($OS_L=Mac OS)
    WR SET STYLESHEET FONT ($WriteArea_P->;1;"Lucida Grande")
    WR SET STYLESHEET TEXT PROP ($WriteArea_P->;1;wr font size;13;1)
Else
    WR SET STYLESHEET FONT ($WriteArea_P->;1;"Tahoma")
    WR SET STYLESHEET TEXT PROP ($WriteArea_P->;1;wr font size;12;1)
End if

WR UPDATE STYLESHEET ($WriteArea_P->;1)


The above example only shows two of the many properties that can be set for a 4D Write Style Sheet. See the documentation for complete information about 4D Write Style Sheets.