Event XbpMenuBar():measureItem Foundation
Used by the system to determine the dimensions of an owner-drawn menu item.
:measureItem := {| nItem, aDims, self | ... }
:measureItem( nItem, aDims ) --> self
xbeP_MeasureItem (1048648)
This method returns the object executing the method (self).
The xbeP_MeasureItem event is generated by the Xbase++ runtime system to determine the dimensions of a menu item which is displayed using the owner-drawing feature. Owner-drawn menu items can be of variable height. Before a menu item gets displayed for the first time, the system sends a xbeP_MeasureItem event to determine the menu item's dimensions, which must be computed by the application. Upon reception of the event, the item width and height must be stored into the respective array elements in parameter <aDims>.
The owner-drawing feature for a menu item is controlled by the XBPMENUBAR_MIA_OWNERDRAW attribute, which must be specified when the item is added to the menu bar object. Processing of the xbeP_MeasureItem event can be done within the :measureItem() method, or within the code block in the :measureItem instance variable. The method :measureItem() is executed followed by the code block in :measureItem.
The :measureItem() callback method in the XbpMenubar class does not execute any code, but is provided for user defined subclasses that redefine this method instead of using the callback code block. If owner-drawing is to be used with the XbpMenubar class itself (not a derived class), a code block must be assigned to the :measureItem callback slot.
The xbeP_MeasureItem event is sent synchronously via the :handleEvent() method of an XbpMenubar object. That means that xbeP_MeasureItem events will not be retrieved by the AppEvent()function. Because the event is usually generated while items are being added to a menu, performing lengthy operations during the processing of a xbeP_MeasureItem event is discouraged. Otherwise, responsitivity of the application's user interface may be slow.
If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.