Navigation: Ultimate Suite for PowerBuilder Help > Datawindow Controls >

Circle Progress

Send comments on this topic.

 

Circle Progress

Visually represent percentage data in a circular progress bar.

Function Parameters

f_pbus_circleprogress (unsignedlong ahdc, long ax, long ay, long awidth, long aheight, double progresspercent, string fontname, integer fontsize, integer circlethickness, string theme)

Argument

 Description

 ahdc

 Always pass GetPaintDC() in the DW Expression

 ax

 Always pass GetPaintRectX() in the DW Expression

 ay

 Always pass GetPaintRectY() in the DW Expression

 awidth

 Always pass GetPaintRectWidh() in the DW Expression

 aheight

 Always pass GetPaintRectHeight() in the DW Expression

 progresspercent

 A value representing the progress percent. You can pass any valid decimal value from 0 to 100.

 fontname

 The font to use to display the percent in the middle of the circle.

 fontsize

 The font size to use for the percent display in the middle of the circle

 circlethickness

 A pixel width of the circle outline. The higher the number, the thicker the circle.

 theme

 Pass, as a string, the color of the circle. Valid values are "BLUE", "OLIVE", "SILVER", "BLACK", "CLASSIC", "PINK", "DEEPBLUE", "PURPLE", "GREEN", "ORANGE", "RED"

Implementation

This control is rendered in a computed field on your dataobject. Start by adding a computed field to your datawindow and give it the width and height that you want. Add an expression to the computed field that will look like this:

Paint
(
    if (f_pbus_circleprogress(GetPaintDC(),
                              GetPaintRectX(),
                              GetPaintRectY(),
                              GetPaintRectWidth(),
                              GetPaintRectHeight(),
                              percent_salary,
                              "Tahoma",
                              16,
                              4,
                              "BLUE")
    , "", "Error")
)

The percent_salary in this example is another computed field on the datawindow. Change this value. You can use a column, computed field, or hard coded value. Adjust the font size so the number displayed in the circle matches the size of the circle you're creating.

Previewing Your Circle Progress Control

The circle progress control will not render in the painter portion of the datawindow painter. It will display in the preview section of the datawindow painter. To see the control in design time, open the preview panel in the datawindow painter and retrieve a row.


Copyright © 2021 Werysoft Inc.