ListBox.DisclosureWidgetPaint

From Xojo Documentation

Event


ListBox.DisclosureWidgetPaint(g As Graphics, row As Integer, ByRef x As Integer, ByRef y As Integer, ByRef width As Integer, ByRef height As Integer) As Boolean

New in 2017r1

Supported for all project types and targets.

Invoked for hierarchical ListBoxes when the framework needs to draw the disclosure triangle for a folder row. This is invoked after CellBackgroundPaint and before CellTextPaint.

Notes

The left, top, width and height parameters:

  • Default to the coordinates for drawing the built-in widget
  • These coordinates are also used for hit testing to determine if a mousedown should toggle the row's expanded state.
  • Are ByRef so the user can specify the location of the rectangle used for hit testing when drawing their own widget, if for instance the hit area is smaller than the drawn widget.
  • Setting width or height to zero will completely hide the triangle and no hit testing will be done.
  • Returning False causes the framework widget to be drawn.
  • Returning True prevents the framework from drawing its own disclosure widget, signaling that the event has performed all of the necessary drawing.
  • Changing the Width parameter and returning True will offset the graphic object that is provided in the following CellTextPaint event by the same offset. i.e. if the supplied Width is 10, but the code changes it to 5 the graphic object in the CellTextPaint event would be offset by 5 pixels to the left.