Problem: 1304847
Title: (Drag and Drop) TTEView should not use its extent
Received: Nov 28 1995 10:49AM
2. TTEView should not use its extent but rather the extent of its scroller as the drop hilite region. Maybe this is true for all views and this behavior should be implemented in TView::DoMakeDropHiliteRegion. For a TTEView this is pretty important, since the TTEView might resize dynamically and therefor might be vertically smaller than the scroller. The user sees the extent of the scroller as the target for dropping, though. You can test this behavior using DemoText. Drag some Text from within the text-area out of the window and back in again. Below you will find a solution for this problem.
RgnHandle TTEView::DoMakeDropHiliteRegion () { TScroller* aScroller = NULL; RgnHandle dropRegion = NULL; VRect visibleExent; aScroller = this->GetScroller (kImmediateSuperView); if (aScroller) { visibleExent = aScroller->GetVisibleExtent (); this->SuperToLocalVRect (visibleExent); dropRegion = MakeNewRgn (); RectRgn (dropRegion, visibleExent.ToRect ()); } else dropRegion = Inherited::DoMakeDropHiliteRegion (); return dropRegion; }