Core Resources panel

Core resources are a set of resources which form the basis of all widgets: in Motif, all widgets are ultimately derived from a base widget class known as Core.

The Core resources have been extracted into a separate resource panel within WorkShop Visual. There are a large number of such Core resources, so in WorkShop Visual these resources have been logically grouped into categories laid out in separate pages.

The Core Resources Panel can be accessed by selecting the 'Core resources' option within the Widget menu at the top of the WorkShop Visual display.

At the top of the Core Resource Panel is an Option Menu for selecting logical pages of the Core resources.

The Display page contains resources associated with the actual appearance of the widget concerned: these are generally color and pixmap resources: the values of each resource can be typed in directly; alternatively, click on the button to the left of the resource text entry field to display a Font, Pixmap or Color Selector dialog.

The Dimensions page allows you to explicitly set x,y coordinates for a widget, as well as width, height and various surrounding border dimensions.

The Settings page contains various Boolean and Scalar valued resources. For example, the Sensitive resource allows you to specify whether a widget is sensitive to user input. You can associate private data with a widget using the User data resource field: any data specific to the widget instance can be declared here, for example, a pointer to a per-instance data structure.

The Code Generation page allows you to control the form which the generated code for the widget will take. The storage class option can be used to modify the storage allocation for the widget in the generated code. The Code structure can be used to determine how the code generated for the widget and its children is structured. The C++ Access option allows you to specify whether the generated elements of the class have Public, Private, or Protected access from other parts of the application.

In Microsoft Windows mode some widgets cannot be mapped to objects on Microsoft Windows and therefore cannot be given a C++ class structure. In such a case this option cannot be selected.

In addition, the Code Generation page allows you to specify (in the case of C++ code) the C++ class name for the current widget and it's associated elements, as well as specifying Base (inherited) and Instance class names. WorkShop Visual is distributed with a set of classes for C++ sites but these can be treated purely as examples and the user is free to override or re-specify the widget class hierarchy and inheritance tree as circumstances demand.

By default, WorkShop Visual generates code to manage widgets within the design. If a particular widget is not to be managed when an instance of that widget is created, you can specify such by clicking on the Managed toggle within the Code Generation page.

The "Include in Resource Bindings" toggle makes the selected widget's resource bindings tight.

In Microsoft Windows mode, WorkShop Visual generates OnSize message handlers to provide some resize behaviour when the user resizes a dialog. The MFC OnSize handler toggle controls whether the code for these handlers is generated.

Lastly on the Code Generation page, you may specify FrameMaker documents and markers to build in an on-line help system for your application using the Help callback and Activate callback fields. You can either enter these directly, or press the Help and Activate callback resource buttons to pop up the Help documents and markers dialog. The Activate callback is only relevant to button widgets. WorkShop Visual will generate a pre-defined callback which arranges for the relevant document and marker to be displayed by FrameMaker.

The Drop Site page contains settings for specifying Drag and Drop operations for the widget. Drag and Drop is a method of transferring data between objects using the mouse; in Motif any widget can function as a Drag and/or a Drop site and the transfer can be any type of data. The data transferred is, however, given a Target Type and a protocol is required to ensure that the Drop Site will correctly understand the transferred data and will handle the Drag data Target Type.

The cursor changes when Drag and Drop operations are in progress: Drag and Drop Sites produce visual effects when the drag icon passes through them. You can specify the visual effect using the Animation Mask, Pixmap, Depth and Style resources. Pixmap resources can be entered directly, or click on the resource button to pop up the Pixmap Selector dialog.

The Import Targets resource is for specifying the Target Type of data which the Drop Site will handle. This can be entered as a simple item, or a list of strings. Motif supports a large range of pre-defined Target Types and you should consult your Programming Manuals for more details.

The Operations toggles are for specifying the nature of the data transfer: you can specify whether data is copied, linked, moved, or transferred using the default mechanism by setting the appropriate toggle.

You can also associate with the Drop Site your own application procedures which will perform the data transfer. Type in the name of your drag and/or drop procedure into the fields provided.

For more information concerning Drag and Drop, please consult your OSF/Motif Programming Manual.

NOTES

Primitive and Manager resources are included in the Core Resource Panel for convenience: background color is such an example.

Drag and Drop is new in Motif 1.2. Every Drop Site MUST have a drop procedure; Drag procedures are optional.

HINTS

Some Core resources, notably dimensions, may not appear to take effect due to constraints placed upon the widget by other widgets within the interface.

  • Color Selector dialog
  • Font Selector dialog
  • Pixmap Selector dialog
  • Building online help
  • Declare Methods Panel
  • Declare Callbacks dialog
  • Microsoft Windows Mode
  • About WorkShop Visual
  • Microsoft Windows Mode
  • About WorkShop Visual