Level Indicators
Use a level indicator to provide information about the level or amount of something in a graphical manner. There are three types of level indicator:
- Capacity
- Rating
- Relevancy (Use this style in a Cocoa application to display a relevance indicator. For more information on the use of this control, see "Relevance Indicators" (page 255).)
Capacity Indicators
Use a capacity indicator to provide information about the level or amount of something that has well defined minimum and maximum values. For example, you might use a capacity indicator to show the current level of storage-space usage on a server or the charge left in a battery.
There are two styles of capacity indicator, continuous and discrete. The continuous capacity indicator is a translucent track that is filled with a colored bar that indicates the current capacity value. The discrete capacity indicator is a row of separate, rectangular segments equal in number to the maximum value set for the control. These segments are stretched or shrunk to a uniform width to fit the specified length of the capacity indicator. The discrete capacity indicator displays the current capacity value rounded to the nearest integer. This means that the segments in the discrete capacity indicator are either completely filled or empty, never partially filled.
The default color of the fill in both capacity indicator styles is green. If you define a value for a warning level, the fill color changes to yellow when it reaches that value. If you define a value for a critical level, the fill color changes to red when it reaches that value.
You can specify which end of the indicator is critical (red) by setting appropriate values. If you define a critical value that is greater than the warning value, the fill is green at values less than the warning level, yellow between the warning and critical levels, and red above the critical level. (This is how the warning and critical values are defined in the continuous capacity indicator shown in Figure 14-40 (page 257).) This orientation is useful if you need to display a warning when a capacity is approaching the maximum value. If you define a critical value that is less than the warning value, the fill is red below the critical value, yellow between the critical and warning values, and green above the warning value (up to the maximum). This orientation is useful if you need to warn the user when a capacity is approaching the minimum value.
Both continuous and discrete capacity indicators allow the display of tick marks above or below the indicator control to give context to the level shown by the fill. However, only the continuous capacity indicator should display the tick marks because the number and width of the segments in the discrete capacity indicator provide similar context.
Figure 14-40 (page 257) shows different states of a continuous capacity indicator.
Figure 14-40 A continuous capacity indicator displaying values in three different ranges Level in standard range
Level in warning range
Level in critical range
Figure 14-41 (page 258) shows different states of a discrete capacity indicator.
Figure 14-41 A discrete capacity indicator displaying values in three different ranges Level in standard range
Level in warning range I ii ii ii ii il II II
Level in critical range
Carbon: Continuous and discrete capacity indicators are not available in Carbon.
Cocoa: Continuous and discrete capacity indicators are available in Interface Builder in the Controls palette. You can change the style from discrete to continuous in the Attributes pane of the NSLevelIndicator Inspector.
Rating Indicator
The rating indicator displays a number of stars that corresponds to the rating of something. A rating indicator should be part of a list or table view because it conveys the relative rankings of different members in a category, such as favorite images or most-visited webpages.
By default, the rating indicator displays stars, but you can supply a custom image to replace the stars. Although this section assumes that the rating indicator displays stars, the information applies equally to an image you supply.
The rating indicator does not display partial stars. Instead, it rounds the current value to the nearest integer to display only whole stars. The stars in the rating indicator are not expanded or shrunk to fit the specified length of the control and no space is added between them.
You can make the rating indicator editable to allow a user to increase or decrease the ranking of a table or list member.
Figure 14-42 (page 258) shows rating indicators displaying different values.
Figure 14-42 A rating indicator showing different ratings ★★★★★★★★★★
Carbon: The rating indicator is not available in Carbon.
Cocoa: The rating indicator is available in Interface Builder in the Controls palette. Start with a discrete level indicator and change its style to rating in the Attributes pane of the NSLevelIndicator Inspector.
Average user rating: 5 stars out of 1 votes
Post a comment