예제 #1
0
Point View::ConvertFromWindow( Point p )
{
   Point sam = p;
 
   View *parent = this;	// I am my own parent.

   while ( parent != NULL )
   {
      sam.x   -= parent->Frame().left; 
      sam.y   -= parent->Frame().top; 

      parent = parent->GetParent();
   }

   return sam;
}
예제 #2
0
Rect View::ConvertToWindow( Rect box )
{
   Rect sam = box;
 
   View *parent = this;	// I am my own parent.

   while ( parent != NULL )
   {
      sam.left   += parent->Frame().left; 
      sam.right  += parent->Frame().left; 
      sam.bottom += parent->Frame().top; 
      sam.top    += parent->Frame().top; 

      parent = parent->GetParent();
   }
 

   return sam;
}