Three new properties:
PROP:TextLeftMargin and PROP:TextRightMargin
The PROP:TextLeftMargin, PROP:TextRightMargin properties get or set the value of left and right margins for text in ENTRY, SPIN, COMBO, TEXT, RTF controls and in drop-down LIST controls. The problem we had was that the old (pre-C7) fixed margin of 2 pixels wasn’t always correct for some of the newer fonts and font sizes. The original C7 implementation calculated margin values based upon the control’s type, its font, and where the control is placed; in a WINDOW or REPORT, and some additional aspects. However the new default margins could be incorrect in some specific situations like one which was described in the PTSS where large font sizes were not displayed correctly in a Entry control. These two new properties allow you to justify margins in all cases, and they allow you to set different values for the left and right margins.
Syntax:
?control {PROP:TextLeftMargin} = n
?control {PROP:TextRightMargin} = n
Where, n is an integer constant or expression greater or equal to 0. It sets the margin using the current units of the WINDOW or REPORT that owns the the control.
Negative values are treated as follows:
a value of -1 : the RTL uses the Windows default margin value which is dependent upon the control’s font
for all other negative values : the RTL uses the C7 default margin value which is very close to Windows default value but takes into account some additional aspects such as the control type
PROP:LastChanceHook
This is a new write-only SYSTEM property which allows you to specify the hook function invoked if an exception has occurred. The hook function allows you to display
information about the exception and choose an action:
- continue execution of the thread where exception occurred (if the exception isn’t fatal)
- stop the thread (or entire process if the exception occurred in the main process thread) without invoking the RTL exception handler
- execute the RTL exception handler
The RTL exception handler allows you to show information about the exception and asks for an action, possible actions:
- stop the thread where exception occurred
- stop the entire process
- invoke the system debugger
- generate a debug event if the program is already running under debugger
The implementation provides a far more intelligent way for handling program termination in case of some abnormal behavior then the existing ‘Do you want to GPF?” message. It also allows you to set the exit code (error level) returned by the program to the OS upon program termination without the necessity to terminate the program immediately.
Summary; this allows end users to avoid having to terminate an entire program if some error occurred in one of its threads.