GenView: 5 The GenViewControl

Up: GEOS SDK TechDocs | Up | Down | Prev: 4 Advanced Concepts and Uses | Next: 5.1 GenViewControl Instance Data

GenViewControlClass works with GenView objects to provide a number of features to your user interface. It is a subclass of GenControlClass and works with the GenToolControl to implement tool bars and tool boxes for the view.

For the controller to interact with a GenView, the view must have the GVA_CONTROLLED flag set in its GVI_attrs field. The GenViewControl will interact with all views having this flag set.

The GenViewControl features and tools are shown in GenViewControl Features and Tools . All GenViewControl objects must be placed on the MGCNLT_ACTIVE_LIST and GAGCNLT_SELF_LOAD_OPTIONS GCN lists. The view itself should be on the GAGCNLT_CONTROLLED_GEN_VIEW_OBJECTS list.

Code Display 9-6 GenViewControl Features and Tools

/* The GenViewControl supports the following features. */
  typedef		WordFlags GVCFeatures;
#define	GVCF_MAIN_100			0x4000	/* sets scale to 100% from View menu */
#define	GVCF_MAIN_SCALE_TO_FIT			0x2000	/* allows scale-to-fit in View menu */
#define	GVCF_ZOOM_IN			0x1000	/* zooms in on the document */
#define	GVCF_ZOOM_OUT			0x0800	/* zooms out on the document */
#define	GVCF_REDUCE			0x0400	/* reduces the view's scale factor */
#define	GVCF_100			0x0200	/* sets scale to 100% in View submenu */
#define	GVCF_ENLARGE			0x0100	/* enlarges the view's scale factor */
#define	GVCF_BIG_ENLARGE			0x0080	/* enlarges the scale factor twice */
#define	GVCF_SCALE_TO_FIT			0x0040	/* scales the view to fit the document */
#define	GVCF_ADJUST_ASPECT_RATIO			0x0020	/* adjusts scale for aspect ratio */
#define	GVCF_APPLY_TO_ALL			0x0010	/* applies to all active views */
#define	GVCF_SHOW_HORIZONTAL			0x0008	/* shows/hides the horizontal scroller */
#define	GVCF_SHOW_VERTICAL			0x0004	/* shows/hides the vertical scroller */
#define	GVCF_CUSTOM_SCALE			0x0002	/* allows custom scaling */
#define	GVCF_REDRAW			0x0001	/* refreshes the view window */
/* The GenViewControl provides the following tools. */
typedef		WordFlags GVCToolboxFeatures;
 #define	GVCTF_100			0x1000	/* sets the scale factor to 100% */
#define	GVCTF_SCALE_TO_FIT			0x0800	/* scales the view to fit the document */
#define	GVCTF_ZOOM_IN			0x0400	/* zooms in; enlarges the scale factor */
#define	GVCTF_ZOOM_OUT			0x0200	/* zooms out; reduces the scale factor */
#define	GVCTF_REDRAW			0x0100	/* refreshes the view window */
#define	GVCTF_PAGE_LEFT			0x0080	/* scrolls left/back one page width */
#define	GVCTF_PAGE_RIGHT			0x0040	/* scrolls right/forward one page width */
#define	GVCTF_PAGE_UP			0x0020	/* scrolls up/back one page height */
#define	GVCTF_PAGE_DOWN			0x0010	/* scrolls down/forward one page height */
#define	GVCTF_ADJUST_ASPECT_RATIO 0x0008				/* adjusts scale for aspect ratio */
#define	GVCTF_APPLY_TO_ALL			0x0004	/* applies to all active views */
#define	GVCTF_SHOW_HORIZONTAL			0x0002	/* shows/hides the horizontal scroller */
#define	GVCTF_SHOW_VERTICAL			0x0001	/* shows/hides the vertical scroller */
	/* Default features and tools */
#define GVC_DEFAULT_FEATURES				(GVCF_MAIN_100 | GVCF_MAIN_SCALE_TO_FIT |
				 GVCF_REDUCE | GCVF_ENLARGE | GVCF_BIG_ENLARGE |
				 GVCF_SCALE_TO_FIT | GVCF_ADJUST_ASPECT_RATIO |
				 GVCF_APPLY_TO_ALL | GVCF_SHOW_HORIZONTAL |
				 GVCF_SHOW_VERTICAL | GVCF_CUSTOM_SCALE)
#define GVC_DEFAULT_TOOLBOX_FEATURES (GVCTF_100 | GVCTF_ZOOM_IN | GVCTF_ZOOM_OUT)
#define GVC_SUGGESTED_SIMPLE_FEATURES (GVCF_MAIN_100 | GVCF_MAIN_SCALE_TO_FIT |
				 GVCF_ZOOM_IN | GVCF_ZOOM_OUT)
#define GVC_SUGGESTED_INTRODUCTORY_FEATURES (GVCF_MAIN_100 | GVCF_ZOOM_IN |
				 GVCF_ZOOM_OUT)
#define GVC_SUGGESTED_BEGINNING_FEATURES (GVC_SUGGESTED_INTRODUCTORY_FEATURES |
				 GVCF_MAIN_SCALE_TO_FIT)

Up: GEOS SDK TechDocs | Up | Down | Prev: 4 Advanced Concepts and Uses | Next: 5.1 GenViewControl Instance Data