//--------------------------------------------------------------------------- #include #pragma hdrstop #include "MainImage.h" //--------------------------------------------------------------------------- #pragma package(smart_init) #pragma link "TPDocument" #pragma link "TPDocument" #pragma link "TPDocument" #pragma resource "*.dfm" TMainImageForm *MainImageForm; //--------------------------------------------------------------------------- __fastcall TMainImageForm::TMainImageForm(TComponent* Owner) : TForm(Owner) { } //--------------------------------------------------------------------------- void __fastcall TMainImageForm::Panel1DockDrop(TObject *Sender, TDragDockObject *Source, int X, int Y) { if (Panel1->DockClientCount == 1) { Panel1->Height = 150; Splitter1->Cursor = crVSplit; Splitter1->Height = 3; Splitter1->ResizeStyle = rsLine; } } //--------------------------------------------------------------------------- void __fastcall TMainImageForm::Panel1DockOver(TObject *Sender, TDragDockObject *Source, int X, int Y, TDragState State, bool &Accept) { TPoint ptClient(0, 0), ptScreen; if (Panel1->DockClientCount == 0) { ptScreen = Panel1->ClientToScreen(ptClient); Source->DockRect = Rect(ptScreen.x, ptScreen.y - 150, ptScreen.x + Panel1->Width, ptScreen.y + 3); } } //--------------------------------------------------------------------------- void __fastcall TMainImageForm::Panel1UnDock(TObject *Sender, TControl *Client, TWinControl *NewTarget, bool &Allow) { if (Panel1->DockClientCount == 1) { Panel1->Height = 1; Splitter1->Cursor = crDefault; Splitter1->Height = 1; Splitter1->ResizeStyle = rsNone; } } //---------------------------------------------------------------------------