SilverScreen Solid Modeler

Control Variables

Control Variables

Previous topic Next topic  

Control Variables

Previous topic Next topic JavaScript is required for the print function  

SilverScreenAPI

 

Control Variables

 

 

 


SilverScreen has a set of control variables that control the run-time environment. These variables may be modified by the cv_set function. The current settings of control variables may be examined by the cv_get function.

 

A number of these variables are read-only, that is, they may not be used as an argument to cv_set .

The control variables are references using defined constants that appear in silver.h . The following is a description of the variables. Variables that are marked as read-only may not be used with cv_set :

 

 

Variable Name

Description

Notes

CV_BREAK

This variable can be used to enable/disable the user's ability to interrupt execution by Control-Break. Pressing the Control-Break key can be used to break out of a program only if this variable is on.

 

CV_COMMANDS

This variable controls the display of commands. Commands will be displayed only if this variable is on.

 

CV_DEFER_PAINTING

This variable controls drawing repaint procedure: normally SilverScreen draws to the refresh buffer, and then updates to the screen buffer at the end of repaint (default value of 1). This variable allows the default behavior to change, providing more or less immediate screen update visibility.

 

Possible Values

Repaint Procedure

0

Paint to screen and to refresh buffer at the same time.

1

Paint to refresh buffer, then at the end of repaint, update screen via BitBlt (this is the default value)

2

Paint to refresh buffer, but update to screen via BitBlt every 0.25 seconds.

 

 

CV_DISPATCH_SYSCHAR

This variable controls whether the SilverScreen input system allows Windows system keys (WM_SYSCHAR) to be passed back to SilverScreen apllications via inchar/nextkey. A value of 0 means that system keys are returned to the inchar caller, otherwise they are passed through to MFC for default handling. The default value is 0.

 

CV_ENABLE_CLOSE

This variable enables or disables the System window close button on the SilverScreen frame window. The window close button will be displayed if the variable is non-zero, and will not be displayed if the variable is set to zero.

 

CV_ENABLE_DLL_IDLE_PROCESSING

This variable whether SilverScreen calls idle processing in its own frame idle routine, when the CWinApp-derived class returned via AfxGetApp is not SilverScreen (i.e. is a DLL). The default value is 1, which means that DLL idle processing is enabled.

 

CV_ERRORS

This variable controls the display of command error messages. These messages will be displayed only if this variable is on. This variable can be used in combination with the predefined variable ss_errno and the function error_text to intercept SilverScreen error messages.

 

CV_FILL_ENABLED

cv_get(CV_FILL_ENABLED) returns 1 if fill is currently enabled, and otherwise 0.

read only

CV_GRID

cv_get(CV_GRID) returns 1 if the grid is currently enabled, and otherwise 0.

read only

CV_ICON_AREA_WIDTH

This variable controls the pixel width of the icon area used in the icon and icon2 functions.

 

CV_JUMP_MENU

This variable controls the availabity of the popup Jump Menu when picking point.  If this variable is set to 0, the Jump Menu will not be available.

 

CV_MESSAGES

This variable controls the display of messages that appear at the bottom of the screen. (i.e., "Printing ...", "Sweeping ...") These messages will be displayed only if this variable is on.

 

CV_MODIFIED

cv_get(CV_MODIFIED) returns 1 if the current drawing is modified, and otherwise 0.

read only

CV_NOTATION

cv_get(CV_NOTATION) returns a number corresponding to the current setting for notation

 

CV_NOTES

If this variable is on, then NOTE and the WAIT commands will be handled normally. If the variable is off, these commands will be ignored.

 

CV_ORTHO_SNAP

cv_get(CV_ORTHO) returns 1 if ortho-snap is currently enabled, and otherwise 0.

read only

CV_PAINT_ONE_WINDOW

This variable controls the ability of the program to force repainting to occur in only the current window or in all windows.

 

CV_PASSTHROUGH_CMDUI_ENABLE

This variable determines whether SilverScreen will pass down ON_UPDATE_COMMAND_UI notifications to the DLL via the SilverScreen-defined message WM_CMDUI_ENABLE message. If set to 1, the update command UI messages are relayed to the DLL, otherwise, they are enabled automatically. The default is 0. This is documented more fully in the WinSmith manual.

 

CV_PATTERNS_ENABLED

cv_get(CV_PATTERNS_ENABLED) returns 1 if patterns are currently enabled, and otherwise 0.

read only

CV_QUICK_MENU

When selecting points, entities or primitives, the CTRL-LEFT event will normally allow the user to change the view.  This will be disallowed if this variable is set to 0.

 

CV_REDRAW_LOCAL

When the SilverScreen window is resized, SilverScreen will normally redraw the contents of the drawing windows.  This automatic redraw can be disabled by setting CV_REDRAW_LOCAL to 0.  When this is done, a refresh event (C_REDRAW or C_RESIZE) notifies that a resize has occurred.

 

CV_REFRESH

This variable controls display of the graphic area of the screen. If this variable is on, then the results of SilverScreen commands will be displayed on the screen; otherwise they will not. cv_set(CV_REFRESH, 1) is functionally equivalent to the SilverScreen command REFRESH ENABLE. cv_set(CV_REFRESH,0) is equivalent to REFRESH OFF.

 

CV_RESIZE_PERMITTED

This variable by be used to permit/disallow the resizing of the SilverScreen window. Only when the variable has the value 1 will the user will be able to alter the window’s size.

 

CV_REUSE_ICON

This variable controls the clearing of the icon area after icon prompting. It is useful to reduce screen updates when the same icon is used repeatedly.  By setting this variable to 1, the icon area will not be cleared after the prompting has occurred

 

CV_SINGLE_STEP

This is a debugging variable that can be used to halt execution whenever a command is executed. If this variable is on, commands will be displayed and the system will await a key from the keyboard.

 

CV_SNAP

cv_get(CV_SNAP) returns 1 if snap is currently enabled, and otherwise 0.

read only

CV_TRACE_INFO

This variable controls the display of the trace information in the XYZ status area.  This information appears during interactive drawing and when points and displacements are being marked. If the variable is on, and if the XYZ status area is visible, then the information is displayed; otherwise it is not.

 

CV_UNITS

cv_get(CV_UNITS) returns a number corresponding to the current setting for units of measure

read only

CV_VERY_QUIET

This is a composite variable that simultaneously sets CV_COMMANDS  and  CV_MESSAGES .

 

CV_WINDOW_BORDER

This variable controls the border color that is used for the current window. If the variable is on, the current window is displayed using the color white; otherwise the normal window color is used.

 

 

 


Initial Settings

Here are the control variable settings at the start of execution:

 

Control variable

Initial setting

CV_COMMANDS

ON

CV_ERRORS

ON

CV_MESSAGES

ON

CV_SINGLE_STEP

OFF

CV_BREAK

ON

CV_TRACE_INFO

ON

CV_REFRESH

ON

CV_NOTES

ON

CV_PAINT_ONE_WINDOW

OFF

CV_REUSE_ICON

OFF

CV_WINDOW_BORDER

OFF

 


Example

The following is an example of the use of CV_ERRORS:

 

C / C++ Code

 

 cv_set ( CV_ERRORS, 0 ); // Disable error display

 ss_command ( "redraw object \obj1 %d", the_color );

 

 if ( ss_errno )

    {

    // Handle the error

    }
 cv_set ( CV_ERRORS, 1 ); // Re-enable error display