Working with IProgressIndicator Parts

The following tasks are associated with using an IProgressIndicator* part in visual composition. Tasks that are common to many parts are described in related topics.

Selecting PM compatibility
You can define either a native system progress indicator or an OS/2 Presentation Manager (PM) progress indicator. The two styles are functionally equivalent. To provide a PM-compatible progress indicator, open the style property in the IProgressIndicator* property sheet and set the pmCompatible style to on.

Selecting the orientation
By default, the progress indicator is horizontal. For a vertical progress indicator, open the style property in the IProgressIndicator* property sheet. Then, set the vertical style to on and the horizontal style to off.

Defining a primary scale
To define a primary scale, specify the scale size and location.

Drawing a value scale
To display scale tick marks with value text, use custom logic. Open the pop-up menu of the composite part from the free-form surface and connect the ready event of the composite part to Custom logic for the IProgressIndicator* part. Enter C++ code to set the size and text for each tick mark you want to display.

For example, if you want to show percentage of completion with a primary scale marked at ten-percent intervals and a secondary scale marked at five-percent intervals, you could enter the following code:

  int i;
  target->setPrimaryScale(IProgressIndicator::scale1);
  target->setTicks(IProgressIndicator::scale1, 101);
  for (i = 0; i < 101; i += 10)
  {
    target->setTickLength(i, 10);
    target->setTickText(i, IString(i));
  }
  target->setPrimaryScale(IProgressIndicator::scale2);
  target->setTicks(IProgressIndicator::scale2, 101);
  for (i = 0; i < 101; i += 5)
  {
    target->setTickLength(i, 5);
    target->setTickText(i, IString(i));
  }

Setting the home position
To define the home position for the progress indicator, set the homePosition property in the IProgressIndicator* property sheet. With the <default> property value, the home position is at the left end of a horizontal progress indicator or at the bottom end of a vertical progress indicator. Alternatively, select one of the following choices in the value column:

The location of the home position depends on the orientation of the progress indicator and the home position value you specify:

Location of the home position

homeBottomLeft homeTopRight
Horizontal orientation Left end of the shaft Right end of the shaft
Vertical orientation Bottom end of the shaft Top end of the shaft

Setting the initial position
To initially position the arm somewhere other than at the home position, set either of the following properties in the IProgressIndicator* property sheet. Enter the property value in the value column.

armTickOffset
Number of progress increments (ticks) from the home position

armPixelOffset
Number of pixels from the home position

Positioning to ticks
To force the arm to the nearest tick mark whenever it is moved, open the style property in the IProgressIndicator* property sheet and set the snapToTickMark style to on.

Showing progress
To advance the arm, indicating progress, connect the source of your progress information to the IProgressIndicator* armTickOffset attribute, providing the new tick location of the arm.

To color the area of progress, open the style property in the IProgressIndicator* property sheet and set the ribbonStrip style to on.


Related procedures
Common Tasks for Control Parts
Setting Part Style Properties
Setting Part Color Properties
Setting Part Font Properties
Setting Part Handlers Properties
Setting Part Framing Properties
Working with VisualAge User Interface Parts

Related references
IProgressIndicator
Property Settings -- IProgressIndicator
Portability -- IProgressIndicator