comp • gb.form • stock

Stock (gb.form)

This class is used for returning predefined icons.

You should not have to use this class directly to get these icons. Use the Picture class as an array instead.

This class is static.
This class acts like a
Returns an icon from the stock.
read-only
static array.

Static properties

Static methods
Return or set the Stock class debugging mode.
Debug  
Return a string array of all possible stock icon names.
Icons  
Return a string array of all possible stock icon names.
List  
Return the names of all possible stock icon sizes.
Sizes  
Return a list of all icon themes that were detected on the current system.
Themes  
Return the icon pixel size from a string size like "small", "medium", and so on.
GetSize  
Refresh the current stock icon theme.
Refresh  

Examples

If we had a ToggleButton then this click event would change the stock icon displayed.

Public Sub ToggleButtonDetail_Click()
  If ToggleButtonDetail.Value Then
    ToggleButtonDetail.Picture = Stock["16/view-icon"]
  Else
    ToggleButtonDetail.Picture = Stock["16/view-detail"]
  End If
End

And this next example does exactly the same as above. But here we use a Picture class to load the stock icon.

Public Sub ToggleButtonDetail_Click()
  If ToggleButtonDetail.Value Then
    ToggleButtonDetail.Picture = Picture["icon:/16/view-icon"]
  Else
    ToggleButtonDetail.Picture = Picture["icon:/16/view-detail"]
  End If
End