Navigation: Ultimate Suite for PowerBuilder Help > Datawindow Controls >

Rating Stars

Send comments on this topic.


Rating Stars

Displays rating stars. The stars size, color, and value are all dynamic which makes it a better solution than using images.

Function Parameters

f_pbus_rating (unsignedlong ahdc, long ax, long ay, long awidth, long aheight, double currentvalue, integer maxvalue, string theme)




 Always pass GetPaintDC() in the DW Expression


 Always pass GetPaintRectX() in the DW Expression


 Always pass GetPaintRectY() in the DW Expression


 Always pass GetPaintRectWidh() in the DW Expression


 Always pass GetPaintRectHeight() in the DW Expression


 The star rating value. This value is relative to the MaxValue parameter. If MaxValue is 5, then CurrentValue can be any value between 0 and 5.


 The max star rating value. This will determine the number of stars to display.


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


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:

    if (f_pbus_rating(GetPaintDC(),
    , "", "Error")

The employee_cust_rating in this example is a field on the datawindow. Change this value. You can use a column, computed field, or hard coded value. This example will display "5" stars. Change this value in the expression to display more or less.

Previewing Your Rating Control

The star rating 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 © 2023 Werysoft Inc.