Hi there. Long time reader, first time caller… ( =
We’re trying to incorporate Go into an existing event infrastructure
and, at the same time, have a complex controller snuggle up next to the
GoView. The controller receives the user’s input through this event
mechanism and decides what to do about it. Mouse-clicks could be
selects, or the beginnings of drags, etc., etc.
I know overriding the GoView and providing our own DefaultTool is a
good first step, but now I’m beginning to get the sensation that I’m
ice-skating up hill. My initial idea was to subclass most (if not all)
of the GoTools (GoToolContext, GoToolPanning, etc) and replace them in
the MouseDownTools-like properties. These subclassed tools fire an
event into our infrastructure; the controller would catch this event
and, if it’s allowed, programmatically ask the view to carry out the
Is that a good approach, do you think? Anyone done anything similar and have ideas/horror stories?
I’m not looking for events at the granular level of MouseMove and Click… more at the level of ObjectSelected, ObjectMoved.
The intention is that we could fire these events from anywhere in the
program (maybe from an undo manager or a demo reel) and the view would
respond to them.
My first idea was to subscribe to GoView.ObjectGotSelection and all
those… but that sets up an infinite loop where the view does a thing
because of user input -> view fires event to controller ->
controller says, “Yes, this can happen,” and tells view to do the thing
-> view does thing -> view fires event… on and on.