ET++: Stepping through a left mouse click in a button
If this is a composite, it first calls VObject::Input()
on all its children, delegating the event handling to them.
if this is a CompositeVObject. For non-composites,
Size() is 0 and the descent stage is omitted.
If the event is not handled by the VObject's decendents,
this handles the particular event depending on
its type, and for mouse events, depending on where the event occurred.
If was a left button click with no modifier keys (which would cause an object inspection),
then DoLeftButtonDownCommand is called on this VObject. Supposing that the object was
a Button, this would call
Button::DoLeftButtonDownCommand().
Command *VObject::DispatchEvents(Point lp, Token &t, Clipper *vf)
{
register Command *currCmd;
if (Size() > 0) {
VObjectIter previous(this, cIterBackward);
VObject *dip;
while (dip= previous())
if (currCmd= dip->Input(lp, t, vf))
return currCmd;
}
currCmd= gNoChanges;
[ ... code to change cursor with mouse move ... ]
switch (t.Code) {
case eEvtRightButton:
if (!(t.Flags & eFlgButDown))
currCmd= DoRightButtonDownCommand(lp, t, WindowSystem::Clicks, vf);
break;
case eEvtMiddleButton:
case eEvtLeftButton:
if (!(t.Flags & eFlgButDown)) {
if (t.Code == eEvtLeftButton) {
if (t.Flags == (eFlgShiftKey|eFlgCntlKey|eFlgMetaKey))
gProgEnv->InspectClick(this);
else
currCmd= DoLeftButtonDownCommand(lp, t, WindowSystem::Clicks);
} else
currCmd= DoMiddleButtonDownCommand(lp, t, WindowSystem::Clicks);
if (currCmd && currCmd != gNoChanges && vf)
currCmd= vf->TrackInContent(lp, t, currCmd);
}
break;
default: [ ... code to handle keys and other events ... ]
}
return currCmd;
}
Back to the method call sequence