Developer

API Reference

ScrollXYEvent

Brew Release
Brew MP 1.0.2
See Also
- Model Events
- ModelEvent
Description
This data type extends the base model event to include fields used by models that provide data specific to scrollable information in both directions. For example, a viewport widget that provides a scrolling image larger than display size to the user could register as a client of the view model, which would track the relative scroll position of the image. As the user starts panning the image in a particular angle, the viewport model would sent events to listening objects in a ScrollXYEvent, identifying the specific event code in the 'base' ModelEvent, while information specific to the event will be stored in the remaining fields of the ScrollXYEvent data structure.
Members
  • base:       The base model event, which identifies the event code and provides
                   the object with the listener it had previously registered with the
                   model framework.
  • xRange:     Defines the total value range for all the data to be scrolled in the
                   horizontal direction.
  • xVisible:   Defines the range for only the visible portion of the data to be
                   scrolled in horizontal direction-- essentially, a subset of the total
                   'range'.
  • xPosition:  Identifies the current relative position of the visible portion of the
                   data being scrolled in horizontal direction -- i.e. the first visible
                   piece of data.
  • yRange:     Defines the total value range for all the data to be scrolled in the
                   vertical direction.
  • yVisible:   Defines the range for only the visible portion of the data to be
                   scrolled in vertical direction-- essentially, a subset of the total
                   'range'.
  • yPosition:  Identifies the current relative position of the visible portion of the
                   data being scrolled in vertical direction -- i.e. the first visible
                   piece of data.
    
Definition
   typedef struct ScrollXYEvent {
   ModelEvent  base;
   uint16      xRange;
   uint16      xVisible;
   uint16      xPosition;
   uint16      yRange;
   uint16      yVisible;
   uint16      yPosition;
} ScrollXYEvent;
Comment
The units for the 'range', 'visible' and 'position' fields depend on the contents of the scrollable area. For example, a bitmapped image would likely define these fields in units of pixels, while scrollable text may use lines of text as the units of measure.
The following model events will be passed to listening objects in a ScrollXYEvent data structure.
       EVT_MDL_SCROLL_XYCHANGE
  • Follow