MdispControl()函数

Synopsis

Control the behavior of a MIL display window.

Format

void MdispControl(DisplayId, ControlType, ControlValue)

MIL_ID DisplayId; Display identifier
long ControlType; Window feature to change
long ControlValue; Value of the window feature

Description

This function allows you to control the behavior of the specified MIL display window. It does this by setting the state of the display window’s individual features.

The MIL display window is used, under Windows, to show images that are selected on the display, using MdispSelect or MdispSelectWindow.

The DisplayId parameter specifies the identifier of the target display.

The ControlType and ControlValue parameters specify, respectively, the display window feature to modify and the new value assigned to the feature. ControlTypes that start with M_WINDOW_… are only available under Windows.

The corresponding combinations for the ControlType and ControlValue parameters are:

ControlType Description and ControlValue
M_WINDOW_ZOOM Allow window zooming:
M_ENABLE or M_DISABLE
M_WINDOW_MOVE Allow window movement:
M_ENABLE or M_DISABLE
M_WINDOW_RESIZE Allow window resizing:
M_ENABLE (or M_NORMAL_SIZE), M_DISABLE, or M_FULL_SIZE (to force a full-size display)
M_WINDOW_OVERLAP Allow window to be overlapped by another:
M_ENABLE or M_DISABLE (keep window on top).
M_WINDOW_MENU_BAR Make the window’s menu bar visible:
M_ENABLE or M_DISABLE.
M_WINDOW_MENU_BAR_CHANGE Allow toggling the menu bar presence:
M_ENABLE or M_DISABLE.
M_WINDOW_TITLE_BAR Make the window’s title bar visible:
M_ENABLE or M_DISABLE.
M_WINDOW_TITLE_BAR_CHANGE Allow toggling the title bar presence:
M_ENABLE or M_DISABLE.
M_WINDOW_TITLE_NAME Set the display window title to a specified string (the string pointer must be casted to long).
M_WINDOW_SCROLLBAR Make the window’s scroll bars visible:
M_ENABLE or M_DISABLE.
M_WINDOW_UPDATE Allow updating of the window display: M_ENABLE or M_DISABLE.
Note: in DOS the whole screen is considered a window.
M_WINDOW_PAINT Force the window’s update and paint the whole region:
M_DEFAULT or M_NULL.
M_WINDOW_SYSBUTTON Make the window’s system button visible:
M_ENABLE or M_DISABLE.
M_WINDOW_MINBUTTON Make the window’s minimize button visible: M_ENABLE or M_DISABLE.
M_WINDOW_MAXBUTTON Make the window’s maximize button visible: M_ENABLE or M_DISABLE.
M_WINDOW_COLOR Force a window update to fill with a constant background color rather than with the selected buffer: M_ENABLE or M_DISABLE.
M_WINDOW_COLOR_CHANGE Set a background color, in Windows’ COLORREF format, to be used when M_WINDOW_COLOR is enabled.
M_WINDOW_INITIAL_POSITION_X Set the window client area’s initial leftmost X coordinate.
M_WINDOW_INITIAL_POSITION_Y Set the window client area’s initial topmost Y coordinate.
M_WINDOW_SNAP_X Restrict the leftmost X coordinate of window client area to a given multiple of the screen’s absolute coordinate. Permissible values are positive or negative integers. Positive snap values adjust the X coordinate to the closest right pixel; negative ones adjust it to the closest left pixel.
M_WINDOW_SNAP_Y Restrict the topmost Y coordinate of the window client area to a given multiple of the screen’s absolute coordinate. Permissible values are positive or negative integers. Positive snap values adjust the Y coordinate to the closest upper pixel; negative ones adjust it to the closest lower pixel.
M_WINDOW_RANGE Inform the display that the displayed buffer values will be restricted to between 10 and 245. This allows the optimization of display update. M_ENABLE or M_DISABLE (default).
M_WINDOW_OVR_WRITE Allow the overlay display buffer associated with the buffer selected on the display to be used as an overlay buffer for non-destructive annotation: M_ENABLE or M_DISABLE (default).
If enabled, the MIL identifier of this buffer can be inquired, using MdispInquire.
If disabled, the overlay buffer is invalid.
M_WINDOW_OVR_FLICKER The overlay shown on top of the buffer is allowed some flicker (to increase display speed or save memory): M_ENABLE or M_DISABLE (default).
M_WINDOW_OVR_DESTRUCTIVE The overlay shown on top of the buffer is allowed to overwrite the buffer’s content (to increase display speed or save memory): M_ENABLE or M_DISABLE (default).
M_WINDOW_BUF_WRITE Allow writing directly (destructive annotation) into the MIL buffer physically allocated in the display surface, after an MdispSelect operation: M_ENABLE or M_DISABLE (default).
If enabled, the MIL identifier of this buffer can be inquired, using MdispInquire.
If disabled, the buffer is invalid.
Note, only certain boards that support or emulate overlay can use this control.
M_WINDOW_OVR_SHOW Show the overlay:
M_ENABLE (default) or M_DISABLE.
M_WINDOW_OVR_LUT Associate a LUT with the overlay display: ControlValue is the LUT MIL identifier.
M_WINDOW_OVR_UPDATE Allow updating of the overlay:
M_ENABLE or M_DISABLE.
M_DESKTOP_CHANGE Allow the update of the Windows desktop:
M_ENABLE or M_DISABLE.
Note: M_DISABLE should be used carefully and for only short periods of time or undesirable results can occur.
M_DESKTOP_LOCK_TIMEOUT Control the Windows desktop lock timeout. When debugging an application using DIRECTDRAW, the desktop locks when a breakpoint is found in the code. A timeout value for the lock can be specified as follows: any value in milliseconds, M_DEFAULT (a generally acceptable value), or M_INFINITE (no timeout value is assigned).
The default ControlValue is M_INFINITE.
M_WINDOW_UPDATE_ON_PAINT Update the display on reception of a WM_PAINT message in Windows. M_ENABLE, M_DISABLE (update on reception of a WM_ERASEBKGND message in Windows), or M_DEFAULT (leave the choice up to MIL).
M_WINDOW_KEYBOARD_USE Activate the keys associated with the display window: M_ENABLE (default) or M_DISABLE.

The default key usage is:

+ Increase the x and y zoom factors.
Decrease the x and y zoom factors.
Pg-up Scroll the buffer up to the previous display section.
Pg-dn Scroll the buffer down to the next display section.
Up arrow Scroll the buffer up to the previous line.
Dn arrow Scroll the buffer down to the next line.
Left arrow Pan the buffer left by one pixel.
Right arrow Pan the buffer right by one pixel.
Ctrl Up arrow Scroll the buffer up to the previous display section.
Ctrl Dn arrow Scroll the buffer down to the next display section.
Ctrl Left arrow Pan the buffer left to the previous display section.
Ctrl Right arrow Pan the buffer right to the next display section.

The ‘+’ and ‘-‘ keys have the same effect as the menubar buttons (letter ‘Z’ with triangle pointing up or down); they increase and decrease the zoom factors. The other keys have the same effect as the scroll bars that appear in the window display.