Controller/View question (dealing with view bounds) 
Author Message
 Controller/View question (dealing with view bounds)


Quote:
>[...]
>    ^view bounds containsPoint: self sensor cursorPoint
>[...]
>Now here is my understanding of the above, which must be incorrect
somewhere.
>The view's bounds are just it's extent.

Strictly speaking, bounds (a Rectangle) are not extent (a Point), but you

Quote:
>But the
>sensor's cursorPoint is relative to the screen coordinates. So it seems
that
>the #containsPoint: method is non-sensical. It is comparing apples to
oranges.
>Where am I going wrong?

The sensor is a TranslatingSensor; the cursorPoint you receive is in the
widget coordinate system.

Quote:
>This background for this question is a controller which doesn't give up
>control when I click the mouse in a different area of the screen. The
reason
>is that the view always thinks it contains the cursor point.

A debugging trace could help you a lot.  Just put an expression to print the
cursorPoint and the view bounds on the Transcript someplace convenient, like
#isControlActive in the controller in question (override it in that class
with "^super isControlActive" if it is not defined).

--Vassili

--

The Object People       http://www.*-*-*.com/
  "Any sufficiently complicated C or fortran program contains
  an ad-hoc, informally-specified bug-ridden slow implementation
  of half of Common Lisp."  --Greenspun's Tenth Rule of Programming



Wed, 18 Jun 1902 08:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. C++/Views: A Model-View-Controller Library for C++

2. Looking for implementation info on Composite Model-View-Controller architecture

3. No bind on variable View (801) attempting ot open the currewnt view

4. Model View Controller

5. Model View Controller

6. Views, fields in views and run-time record declaration

7. View Position relative to Parent View

8. Looking for info about Model-View-Controller paradigm

9. Viewing (or *not* viewing) .wrl files with NS3.0b5

10. Load .wrl Files, View it, centered in View

11. Orthogonal view / 2D view

12. Model View Controller and Ada 95

 

 
Powered by phpBB® Forum Software