Defining Options for a Control Class

The Options sheet of the Define Class dialog, shown in the following image, is displayed after you have specified your class options for a Control subclass in the Class sheet, and you then select the Options sheet of the dialog.

If you have defined a control image to be displayed in the Painter Control palette for the current class, that image is displayed in the Options sheet. The class options enable you to change the image of user-defined subclassed controls and optionally display them in the Painter Control palette, if required.

The picture for a control subclass must be an image file supported by the JadeMask class pictureMask property; that is, a .bmp, .gif, .ico, .jpg, .png, or .tif image that is not larger than 23 pixels by 23 pixels. Smaller images are centered on controls, if required.

To define user-defined control options

  1. Uncheck the Can be shown in the Painter’s control palette check box if you do not want the image for your control displayed in the Control palette of the JADE Painter. By default, the image is displayed in the Painter Control palette; that is, this option is checked.

    If you define or change the picture for a class, it defines or changes the picture seen by all users of that control. If a picture is not specified for the Control class and this option is checked, a blank button is displayed in the Control palette of the JADE Painter (although the bubble help still indicates the type of control).

  2. The Painter Icon Definition group box enables you to select the picture that is to be displayed on the tool of the Painter Control palette for this control for each of the four states associated with them; that is, up, down, roll over, and disabled.

    Click the Up, Rollover, Down, or Disabled option button and then click the Change button to specify a toolbar icon or to change an existing icon for the selected image state (which defaults to the Up state). The common File Open dialog (titled Select the <state> image file name) is then displayed, to enable you to select an existing graphics file whose image you want displayed for the Control subclass in the selected state.

  3. Select the existing image file from the appropriate location.

  4. Repeat steps 2 and 3 for each of the states associated with the image that you require.

    Although you do not have to define images for each state associated with the control picture, a down state image provides users with visual confirmation that the icon has been clicked.

  5. Click the Design Time Properties button if you want to specify the control properties that are listed in the Properties dialog during your Painter sessions. (A value assigned to a design-time property can be saved and used as the default value when a runtime instance of the control is created.)

    The Design Time Properties dialog is then displayed. For details, see "Selecting Your Design-Time Properties" under "Subclassing a JADE Control Class", in Chapter 5 of the JADE Developer’s Reference.

  6. Click the OK button. Alternatively, click the Cancel button to abandon your selections.

The specified class is then displayed as a subclass of the selected superclass in the Class Browser window.

When you have defined a class, you can then define methods, properties, or constants for that class. For details, see Chapter 4. In addition, your specified details for that class are displayed in the editor pane when the class is selected in the Class List of the Class Browser.