Toolbar2000

TTBItemViewer

Properties | Methods

Description:

An item viewer is responsible for drawing a single item on the screen, and handling mouse and keyboard input directed to the item.

TTBView creates and manages item viewers.

Key Properties:

  • property BoundsRect: TRect; (Read-only) The bounding rectangle of the item. This is not valid when Show is False.
  • property Clipped: Boolean;
    (Read-only) This is True if the item would normally have been shown but the parent menu has scrolling enabled and the item could not fit in the available space. Show will always be False when Clipped is True.
  • property Item: TTBCustomItem;
    (Read-only) The item being rendered.
  • property OffEdge: Boolean;
    (Read-only) This is True if the item could not fit in the available space and is to be displayed on the parent toolbar's chevron popup menu. Show will always be False when OffEdge is True.
  • property Show: Boolean;
    (Read-only) This is True if the item will be shown, or False if it is hidden.
  • property View: TTBView;
    (Read-only) The owning TTBView component.

Key Methods:

Note: There are a lot of protected methods in TTBItemViewer which can be overridden in descendant classes to change appearance or behavior of the item viewer. Documentation for them has not been completed yet.

  • function ScreenToClient(const P: TPoint): TPoint;
    Converts a screen coordinate to a coordinate relative to the top-left corner of the item viewer.