FloaterDstClip... example for C++ Builder

The following code adjusts the destination clipping rectangle of the floater. You can test it by adding it to a new command button for the lesson described in Outlining, Dragging, and Pasting a Region. By default, the destination clipping rectangle for the floater is the full client area. This code gets the current values and uses them to reduce the size of the clipping rectangle.

void __fastcall TForm1::Button1Click(TObject *Sender)
{
   /*Declare local variables. */
   int AdjustX, AdjustY, NewLeft, NewTop, NewWidth, NewHeight;

   /*Set variables to use for adjustment increments. */
   AdjustX = Lead1->Width / 20;
   AdjustY = Lead1->Height / 20;
   /*Determine new values, based on adjustments of current values*/
   NewLeft = Lead1->FloaterDstClipLeft + AdjustX;
   NewTop = Lead1->FloaterDstClipTop + AdjustY;
   NewWidth = Lead1->FloaterDstClipWidth - (2 * AdjustX);
   NewHeight = Lead1->FloaterDstClipHeight - (2 * AdjustY);
   /*Set the clipping rectangle to the new values. */
   Lead1->SetFloaterDstClipRect(NewLeft, NewTop, NewWidth, NewHeight);
}