GLG Toolkit, C / C++ API Library  Version 4.6
Zooming and Scrolling

This group contains methods for zooming, panning and scrolling GLG drawings, charts and GIS map objects. More...

Detailed Description

This group contains methods for zooming, panning and scrolling GLG drawings, charts and GIS map objects.

Functions

GlgBoolean SetZoom (char *resource_name, GlgLong type, double value=0.)
 Provides a programmatic interface to integrated zooming and panning. More...
 
GlgBoolean SetZoomMode (char *resource_name, GlgObjectC *zoom_object, char *zoom_object_resource_name, GlgZoomMode zoom_mode)
 Sets or resets a viewport's zoom mode by supplying a GIS or Chart object to be zoomed. More...
 

Function Documentation

◆ SetZoom()

GlgBoolean SetZoom ( char *  resource_name,
GlgLong  type,
double  value = 0. 
)

Provides a programmatic interface to integrated zooming and panning.

This is a wrapper for GlgSetZoom.

Parameters
resource_nameSpecifies the resource path of a child viewport to zoom or pan, or NULL to zoom or pan this viewport object. The resource path is relative to this viewport object.
typeA char value that specifies the type of the zoom or pan operation to perform. For example, 'i' may be used to zoom in. See GlgSetZoom for a list of possible values.
valueSpecifies a value for zoom and pan operations.
Returns
True if zoom operation succeeded, otherwise False.

This method performs a specified zoom or pan operation regardless of the setting of the viewport's Pan and ZoomEnabled attributes.

Zooming and panning keyboard accelerators may also be used by settings a viewport's ZoomEnabled attribute to True (the user may have to click on the viewport first to set the keyboard focus). This is especially useful for interactive testing of integrated zooming and panning in the GLG Graphics Builder.

The viewport's Pan attribute can be used to activate integrated scrollbars for scrolling the drawing, as well as scrolling charts and GIS maps.

In the Drawing Zoom Mode, if the method attempts to set a very large zoom factor which would result in the overflow of the integer coordinate values used by the native windowing system, the zoom operation is not performed and the method returns False.

The left mouse button is the default button for performing the ZoomTo operation, as well as for panning and scrolling the drawing by dragging it with the mouse. These defaults can be changed by setting the GlgZoomToButton and GlgPanDragButton global configuration resources. If the default is changed, the left-click used in the description of the affected operations changes to the click with the mouse button assigned to the respective ZoomTo or Pan operation.

◆ SetZoomMode()

GlgBoolean SetZoomMode ( char *  resource_name,
GlgObjectC zoom_object,
char *  zoom_object_resource_name,
GlgZoomMode  zoom_mode 
)

Sets or resets a viewport's zoom mode by supplying a GIS or Chart object to be zoomed.

This is a wrapper for GlgSetZoomMode.

In the Drawing Zoom Mode (default), the drawing displayed in the viewport is zoomed and panned. If the GIS Zoom Mode is set, any zooming and panning operation performed by SetZoom will zoom and pan the map displayed in the viewport's GIS Object, instead of being applied to the viewport's drawing. In the Chart Zoom Mode, the content of the chart is zoomed and panned.

Parameters
resource_nameSpecifies the resource path of a child viewport whose zoom mode to set, or NULL to zoom or pan this viewport object. The resource path is relative to this viewport object.
zoom_objectGIS or Chart object to be zoomed in the GIS and Chart zooming modes (or NULL for the Drawing zoom mode):
  • If not NULL, specifies the GIS or Chart object (or its parent if zoom_object_resource_name is not NULL).
  • If NULL, zoom_object_resource_name is used to to specify the GIS or Chart object in the GIS and Chart zooming modes as describe below.
zoom_object_resource_nameResource path of the GIS or Chart object.
  • If NULL, the GIS or Chart object supplied by the zoom_object parameter is selected as the GIS or Chart object to be zoomed.
  • If not NULL, specifies the resource path of the GIS or Chart object to be zoomed. The resource path is relative to the zoom_object parameter, or to the viewport defined by the resource_name parameter if zoom_object is NULL.
zoom_modeThe zoom mode to set:
Returns
Success or failure status.