Problem: 1304847

Title: (Drag and Drop) TTEView should not use its extent

Received: Nov 28 1995 10:49AM


This does not work as soon as you have another view in the scroller. Should be looked at with the understanding that this exact issue/fix is not right.

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;
}

Perhaps we should do something a little more generic to determine the truly visible extent.
The above "solution" does not work as advertised. All it does is change the drop _highlighting_ to the scroller's visible extent; the target area for dropping remains the TTEView visible extent.