GenView: 4.9 Advanced Concepts and Uses: Linking Views

Up: GEOS SDK TechDocs | Up | Prev: 4.8 Monitoring Input | Next: 4.10 Setting the Content
GVI_horizLink, GVI_vertLink, MSG_GEN_VIEW_SEND_TO_LINKS, MSG_GEN_VIEW_SEND_TO_VLINK, MSG_GEN_VIEW_SEND_TO_HLINK, MSG_GEN_VIEW_CALL_WITHOUT_LINKS

Views may be linked together either in the horizontal or the vertical dimension. Classed events may then be sent to the view's links, causing the events to propagate through all the links. Most scrolling events will be propagated through the links.

Each view may have one horizontal and one vertical link, though no links are required. The links are stored as optrs in the instance fields GVI_horizLink and GVI_vertLink , and links should be circular. In other words, if three views are linked in a single dimension, the links should be as follows: view one points to view two, view two points to view three, and view three points back to view one.

Views linked in the horizontal will share vertical scroll events; those linked in the vertical will share horizontal scroll events.

When one of the linked views receives a scrolling event, the event will automatically propagate to the view's links. Other events can be sent to all the linked views; by using @record to set up an encapsulated event, you can then send that event to the linked views with any of MSG_GEN_VIEW_SEND_TO_LINKS , MSG_GEN_VIEW_SEND_TO_VLINK , or MSG_GEN_VIEW_SEND_TO_HLINK . If you want to send an encapsulated message to a linked view without propagating the event, use MSG_GEN_VIEW_CALL_WITHOUT_LINKS .

MSG_GEN_VIEW_SEND_TO_LINKS

void	MSG_GEN_VIEW_SEND_TO_LINKS(
        EventHandle event,			/* handle of recorded event */
        optr	originator);		/* optr of view first receiving event */

This message sends a recorded event to the receiving view and then to all the view's links. Any linked view will send this message upon receiving a scrolling event.

Source: A linked view when it receives a scrolling event.

Destination: The linked View sends this to itself; it will then dispatch the passed event to itself and all views linked to it.

Parameters: event The EventHandle of the recorded event to be dispatched to all linked views. Typically this is the scrolling event received by the originator.

originator
The optr of the GenView that originally received the scrolling event and sent this message out.

Return: Nothing.

Interception: Generally not intercepted.

MSG_GEN_VIEW_SEND_TO_VLINK

void	MSG_GEN_VIEW_SEND_TO_VLINK(
        EventHandle event,			/* handle of recorded event */
        optr	originator);		/* optr of view first receiving event */

This message sends a recorded event to the receiving view and then to all the view's vertical links. It works the same as MSG_GEN_VIEW_SEND_TO_LINKS except that it restricts itself to vertically-linked views.

Source: A linked view when it receives a scrolling event, or a handler for MSG_GEN_VIEW_SEND_TO_LINKS .

Destination: The linked View sends this to itself; it will then dispatch the passed event to itself and all views linked to it.

Parameters: event The EventHandle of the recorded event to be dispatched to all vertically linked views. Typically this is the scrolling event received by the originator.

originator
The optr of the GenView that originally received the scrolling event and sent this message out.

Return: Nothing.

Interception: Generally not intercepted.

MSG_GEN_VIEW_SEND_TO_HLINK

void	MSG_GEN_VIEW_SEND_TO_HLINK(
        EventHandle event,			/* handle of recorded event */
        optr	originator);		/* optr of view first receiving event */

This message sends a recorded event to the receiving view, then to the view's horizontal links. It works the same as MSG_GEN_VIEW_SEND_TO_LINKS except that it restricts itself to horizontally-linked views.

Source: A linked view when it receives a scrolling event, or a handler for MSG_GEN_VIEW_SEND_TO_LINKS .

Destination: The linked View sends this to itself; it will then dispatch the passed event to itself and all views linked to it.

Parameters: event The EventHandle of the recorded event to be dispatched to all horizontally linked views. Typically this is the scrolling event received by the originator.

originator
The optr of the GenView that originally received the scrolling event and sent this message out.

Return: Nothing.

Interception: Generally not intercepted.

MSG_GEN_VIEW_CALL_WITHOUT_LINKS

void	MSG_GEN_VIEW_CALL_WITHOUT_LINKS(
        EventHandle		event,					/* handle of recorded event */
        MessageFlags		messageFlags);					/* flags normally sent with
							 * classed event */

This message sends the recorded event to the view and ensures the event does not get passed on to any of the recipient's links. Because the recorded event is sent to only one GenView, it is called immediately and therefore can have return values or pass pointers.

Source: Unrestricted.

Destination: Any linked GenView object

Parameters: event The EventHandle of the recorded event to be sent to only the recipient GenView.

messageFlags
A record of MessageFlags for the recorded event. If the event should return values, be sure to pass the flag MF_CALL in this record.

Return: Nothing.

Interception: Generally not intercepted.


Up: GEOS SDK TechDocs | Up | Prev: 4.8 Monitoring Input | Next: 4.10 Setting the Content