00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105 #include "camtypes.h"
00106
00107
00108 #include "camelot.h"
00109
00110 #include "dragmgr.h"
00111 #include "keypress.h"
00112
00113 #include "camframe.h"
00114
00115 #include "csrstack.h"
00116 #include "gbrush.h"
00117 #include "grndrgn.h"
00118
00119 #include "oilbitmap.h"
00120 #include "osrndrgn.h"
00121
00122 CC_IMPLEMENT_DYNCREATE(DragManagerOp, Operation)
00123 IMPLEMENT_DYNAMIC_CLASS(CaptureHandler, wxEvtHandler)
00124
00125 #define new CAM_DEBUG_NEW
00126
00127
00128
00129
00130
00131
00132
00133
00134 BEGIN_EVENT_TABLE( CaptureHandler, wxEvtHandler )
00135 EVT_LEFT_UP( CaptureHandler::OnLButtonUp )
00136 EVT_RIGHT_UP( CaptureHandler::OnRButtonUp )
00137 EVT_MOTION( CaptureHandler::OnMouseMove )
00138 END_EVENT_TABLE()
00139
00140
00141
00142
00143
00144
00145
00146
00147
00148
00149
00150
00151
00152 CaptureHandler::CaptureHandler(wxWindow* pWindow)
00153 {
00154
00155 m_pWindow = pWindow;
00156 m_bHasCapture = FALSE;
00157 m_pDisplayDC = NULL;
00158 m_pBackBitmap = NULL;
00159 m_pMaskBitmap = NULL;
00160 }
00161
00162
00163
00164
00165
00166
00167
00168
00169
00170
00171
00172
00173 CaptureHandler::~CaptureHandler()
00174 {
00175
00176
00177
00178 if (m_bHasCapture)
00179 {
00180 if (m_pWindow->PopEventHandler() != this)
00181 {
00182 TRACEUSER("Gerry", _T("Popped event handler is not this one, expect a crash"));
00183 }
00184
00185 if (m_pWindow->HasCapture())
00186 {
00187 m_pWindow->ReleaseMouse();
00188 if (m_pWindow->HasCapture())
00189 {
00190 TRACEUSER("Gerry", _T("Still got capture"));
00191 }
00192 else
00193 {
00194 TRACEUSER("Gerry", _T("Capture released"));
00195 }
00196
00197 CursorStack::GSetActive();
00198 }
00199 else
00200 {
00201 TRACEUSER("Gerry", _T("Haven't got capture"));
00202 }
00203 m_bHasCapture = FALSE;
00204 }
00205 }
00206
00207
00208
00209
00210
00211
00212
00213
00214
00215
00216
00217
00218
00219 BOOL CaptureHandler::StartCapture()
00220 {
00221 TRACEUSER("Gerry", _T("CaptureHandler::StartCapture"));
00222 if (m_pWindow && !m_bHasCapture)
00223 {
00224 if (m_pWindow->HasCapture())
00225 {
00226 TRACEUSER("Gerry", _T("Already got capture"));
00227 }
00228
00229 m_pWindow->CaptureMouse();
00230
00231 if (m_pWindow->HasCapture())
00232 {
00233 TRACEUSER("Gerry", _T("Got capture"));
00234 m_bHasCapture = true;
00235 m_pWindow->PushEventHandler(this);
00236 }
00237 }
00238
00239 return(TRUE);
00240 }
00241
00242
00243
00244
00245
00246
00247
00248
00249
00250
00251
00252
00253
00254
00255
00256
00257
00258
00259 void CaptureHandler::OnLButtonUp(wxMouseEvent& event)
00260 {
00261 if (m_pWindow)
00262 {
00263 wxPoint point = event.GetPosition();
00264 point = m_pWindow->ClientToScreen(point);
00265
00266 if (DragManagerOp::CurrentManager && DragManagerOp::CurrentManager->CurrentDragInfo)
00267 {
00268 DragManagerOp::CurrentManager->CurrentDragInfo->OnMouseMove(point);
00269 DragManagerOp::CurrentManager->CurrentDragInfo->OnButtonUp(point);
00270 }
00271 }
00272
00273 TRACEUSER("Gerry", _T("CaptureHandler::OnLButtonUp"));
00274 DragManagerOp::EndDrag(1);
00275
00276
00277 }
00278
00279
00280
00281
00282
00283
00284
00285
00286
00287
00288
00289
00290
00291
00292 void CaptureHandler::OnRButtonUp(wxMouseEvent& event)
00293 {
00294 if (m_pWindow)
00295 {
00296 wxPoint point = event.GetPosition();
00297 point = m_pWindow->ClientToScreen(point);
00298
00299 if (DragManagerOp::CurrentManager && DragManagerOp::CurrentManager->CurrentDragInfo)
00300 {
00301 DragManagerOp::CurrentManager->CurrentDragInfo->OnMouseMove(point);
00302 DragManagerOp::CurrentManager->CurrentDragInfo->OnButtonUp(point);
00303 }
00304 }
00305
00306 TRACEUSER("Gerry", _T("CaptureHandler::OnRButtonUp"));
00307 DragManagerOp::EndDrag(-1);
00308
00309
00310
00311 }
00312
00313
00314
00315
00316
00317
00318
00319
00320
00321
00322
00323
00324
00325
00326
00327 BOOL CaptureHandler::SetUpSolidDrag(wxPoint StartPos)
00328 {
00329 TRACEUSER("Gerry", _T("SetUpSolidDrag(%d, %d)"), StartPos.x, StartPos.y);
00330
00331 ERROR2IF(DragManagerOp::CurrentManager == NULL ||
00332 DragManagerOp::CurrentManager->CurrentDragInfo == NULL,
00333 FALSE,
00334 _T("CaptureHandler::SetUpSolidDrag - The current drag manager is invalid"));
00335
00336 if (!DragManagerOp::CurrentManager->CurrentDragInfo->DoesSolidDrag)
00337 return TRUE;
00338
00339 if (DragManagerOp::CurrentManager->RedrawInProgress || m_pDisplayDC != NULL)
00340 return FALSE;
00341
00342
00343 wxPoint SolidDragOffset = DragManagerOp::CurrentManager->CurrentDragInfo->SolidDragOffset;
00344 wxSize DSize = DragManagerOp::CurrentManager->CurrentDragInfo->SolidDragSize;
00345
00346 m_pDisplayDC = new wxScreenDC();
00347 wxMemoryDC BackGroundDC;
00348 m_pBackBitmap = new wxBitmap(DSize.x, DSize.y);
00349
00350 if (m_pDisplayDC==NULL || m_pBackBitmap == NULL)
00351 {
00352 return FALSE;
00353 }
00354
00355
00356 wxPoint ClientPos = StartPos + SolidDragOffset;
00357
00358
00359 BackGroundDC.SelectObject(*m_pBackBitmap);
00360
00361 ClientPos = m_pWindow->ScreenToClient(ClientPos);
00362
00363
00364 m_DragRect = wxRect(ClientPos.x, ClientPos.y, DSize.x, DSize.y);
00365
00366
00367 BackGroundDC.Blit(0,0,DSize.x,DSize.y,m_pDisplayDC,m_DragRect.x,m_DragRect.y);
00368
00369 BackGroundDC.SelectObject(wxNullBitmap);
00370
00371 INT32 DragTransparency =
00372 DragManagerOp::CurrentManager->CurrentDragInfo->GetDragTransparency();
00373
00374 KernelBitmap* DragMask =
00375 DragManagerOp::CurrentManager->CurrentDragInfo->GetSolidDragMask();
00376
00377 BOOL TransparentMask = DragManagerOp::CurrentManager->CurrentDragInfo->HasTransparentMask();
00378
00379 if (DragTransparency > 0 || TransparentMask || DragMask != NULL)
00380 {
00381
00382
00383
00384
00385
00386
00387
00388
00389
00390
00391
00392
00393
00394
00395 wxImage MaskImage(DSize.x, DSize.y, false);
00396 unsigned char * pix=MaskImage.GetData();
00397 unsigned char * tpix = NULL;
00398
00399 wxImage * pTransparentMask = NULL;
00400 if (TransparentMask)
00401 {
00402 wxBitmap *pTMbitmap=DragManagerOp::CurrentManager->CurrentDragInfo->GetTransparentMask();
00403 if (pTMbitmap)
00404 pTransparentMask = new wxImage();
00405 if (!pTransparentMask)
00406 TransparentMask=FALSE;
00407 else
00408 {
00409 *pTransparentMask=pTMbitmap->ConvertToImage();
00410 tpix=pTransparentMask->GetData();
00411 }
00412 }
00413
00414
00415
00416 INT32 GreyLevel = (DragTransparency * 255) / 100;
00417
00418
00419
00420
00421
00422
00423 INT32 OrderedDither[4*4]={ 1, 9, 3,11,
00424 13, 5,15, 7,
00425 4,12, 2,10,
00426 16, 8,14, 6};
00427 INT32 x, y;
00428
00429 for (y=0; y<DSize.y; y++) for (x=0; x<DSize.x; x++)
00430 {
00431 INT32 tlevel=GreyLevel;
00432 if (TransparentMask)
00433 {
00434
00435
00436
00437 tlevel=((255*255+(255/2)) -
00438 ((255-GreyLevel)*(*tpix))
00439 )/255;
00440 tpix +=3;
00441 }
00442 BYTE thresh = (tlevel>(OrderedDither[(x&3)|((y&3)<<2)]*16-8))?0xff:0x00;
00443
00444 *pix++=thresh;
00445 *pix++=thresh;
00446 *pix++=thresh;
00447 }
00448
00449 if (pTransparentMask)
00450 delete pTransparentMask;
00451
00452 m_pMaskBitmap = new wxBitmap(MaskImage, 1);
00453 if (m_pMaskBitmap)
00454 {
00455
00456 if (DragMask)
00457 {
00458 wxMemoryDC MaskDC;
00459 MaskDC.SelectObject(*m_pMaskBitmap);
00460
00461
00462
00463
00464 CWxBitmap* pMaskBmp = (CWxBitmap*)DragMask->ActualBitmap;
00465 RGBQUAD* Palette = (RGBQUAD *) (pMaskBmp->BMInfo->bmiColors);
00466
00467
00468 Palette[0].rgbRed = Palette[0].rgbBlue = Palette[0].rgbGreen = 0;
00469 Palette[1].rgbRed = Palette[1].rgbBlue = Palette[1].rgbGreen = 255;
00470
00471
00472 Palette[0].rgbReserved = Palette[1].rgbReserved = 0;
00473
00474 UINT32 bpp=pMaskBmp->GetBPP();
00475
00476 wxMemoryDC MemDC;
00477 wxBitmap MemBitmap(DSize.x, DSize.y, bpp);
00478 MemDC.SelectObject(MemBitmap);
00479
00480 if (bpp>8)
00481 bpp=32;
00482
00483 LPBYTE MemBBits;
00484 LPBITMAPINFO MemBInfo = AllocDIB(DSize.x, DSize.y, bpp, &MemBBits);
00485
00486 GRenderRegion::StaticPlotBitmap(&MemDC, DIB_RGB_COLORS, MemBInfo, MemBBits, 0, 0, DSize.x, DSize.y, m_pMaskBitmap->GetPalette(), 0, 0);
00487
00488
00489
00490 MaskDC.Blit(0, 0, DSize.x, DSize.y, &MemDC, 0, 0, wxOR);
00491
00492
00493 MaskDC.SetBrush(*wxTRANSPARENT_BRUSH);
00494 MaskDC.SetPen(*wxTRANSPARENT_PEN);
00495 MaskDC.SelectObject(wxNullBitmap);
00496 }
00497 }
00498 }
00499 else
00500 m_pMaskBitmap = NULL;
00501
00502 DrawSolidDrag(StartPos);
00503
00504 return TRUE;
00505 }
00506
00507
00508
00509
00510
00511
00512
00513
00514
00515
00516
00517
00518
00519
00520
00521
00522
00523
00524
00525
00526
00527
00528 BOOL CaptureHandler::CleanUpSolidDrag()
00529 {
00530 TRACEUSER("Gerry", _T("CleanUpSolidDrag"));
00531
00532 if (DragManagerOp::CurrentManager == NULL)
00533 return(FALSE);
00534
00535 if (DragManagerOp::CurrentManager->CurrentDragInfo &&
00536 !DragManagerOp::CurrentManager->CurrentDragInfo->DoesSolidDrag)
00537 return TRUE;
00538
00539 if (m_pDisplayDC == NULL)
00540 return FALSE;
00541
00542 if (m_pBackBitmap)
00543 {
00544 wxMemoryDC BackGroundDC;
00545
00546
00547 BackGroundDC.SelectObject(*m_pBackBitmap);
00548
00549
00550 if (!DragManagerOp::CurrentManager->DragPending)
00551 {
00552 m_pDisplayDC->Blit(m_DragRect.x,m_DragRect.y,m_DragRect.width, m_DragRect.height,&BackGroundDC,0,0);
00553 }
00554
00555
00556 BackGroundDC.SelectObject(wxNullBitmap);
00557 }
00558
00559 if (m_pDisplayDC)
00560 {
00561 delete m_pDisplayDC;
00562 m_pDisplayDC = NULL;
00563 }
00564
00565 if (m_pBackBitmap)
00566 {
00567 delete m_pBackBitmap;
00568 m_pBackBitmap = NULL;
00569 }
00570
00571 if (m_pMaskBitmap)
00572 {
00573 delete m_pMaskBitmap;
00574 m_pMaskBitmap = NULL;
00575 }
00576
00577 m_DragRect = wxRect(0, 0, 0, 0);
00578
00579 return TRUE;
00580 }
00581
00582
00583
00584
00585
00586
00587
00588
00589
00590
00591
00592
00593
00594
00595
00596
00597
00598
00599
00600
00601
00602
00603
00604
00605
00606 BOOL CaptureHandler::CleanUpSolidDragInScreenArea(const wxRect& Area)
00607 {
00608
00609
00610
00611 if (!DragManagerOp::CurrentManager->CurrentDragInfo->DoesSolidDrag)
00612 return(FALSE);
00613
00614
00615 if (DragManagerOp::CurrentManager->DragPending || m_DragRect.IsEmpty())
00616 return(FALSE);
00617
00618 wxRect Isect(Area);
00619 if (!Isect.Intersect(m_DragRect).IsEmpty())
00620 {
00621 CleanUpSolidDrag();
00622 return(TRUE);
00623 }
00624
00625 return(FALSE);
00626 }
00627
00628
00629
00630
00631
00632
00633
00634
00635
00636
00637
00638
00639
00640
00641
00642
00643 void CaptureHandler::OnMouseMove(wxMouseEvent& event)
00644 {
00645
00646
00647 if (CCamApp::IsDisabled())
00648 {
00649
00650 return;
00651 }
00652
00653 if (DragManagerOp::CurrentManager && !DragManagerOp::CurrentManager->RedrawInProgress)
00654 {
00655 wxPoint point = event.GetPosition();
00656 point = m_pWindow->ClientToScreen(point);
00657
00658 if (DragManagerOp::CurrentManager->CurrentDragInfo)
00659 DragManagerOp::CurrentManager->CurrentDragInfo->OnMouseMove(point);
00660
00661 DrawSolidDrag(point);
00662 }
00663 }
00664
00665
00666
00667
00668
00669
00670
00671
00672
00673
00674
00675
00676
00677
00678
00679
00680
00681
00682 BOOL CaptureHandler::DrawSolidDrag(wxPoint point)
00683 {
00684
00685 if (!m_pBackBitmap || !m_pDisplayDC)
00686 return FALSE;
00687
00688
00689
00690 ERROR2IF(DragManagerOp::CurrentManager == NULL ||
00691 DragManagerOp::CurrentManager->CurrentDragInfo == NULL,
00692 FALSE,
00693 "No current drag in CaptureHandler::DrawSolidDrag!");
00694
00695
00696 if(DragManagerOp::CurrentManager->DragPending)
00697 return TRUE;
00698 if(!DragManagerOp::CurrentManager->CurrentDragInfo->DoesSolidDrag)
00699 return TRUE;
00700
00701 INT32 DragTransparency = DragManagerOp::CurrentManager->CurrentDragInfo->
00702 GetDragTransparency();
00703
00704
00705 if (DragTransparency > 0 || m_pMaskBitmap != NULL)
00706 {
00707 if (DrawTransparentDrag(point, DragTransparency))
00708 return TRUE;
00709
00710
00711
00712 }
00713
00714
00715 point += DragManagerOp::CurrentManager->CurrentDragInfo->SolidDragOffset;
00716
00717
00718 wxSize DSize = DragManagerOp::CurrentManager->CurrentDragInfo->SolidDragSize;
00719
00720
00721
00722
00723 wxMemoryDC BackDC;
00724
00725
00726 BackDC.SelectObject(*m_pBackBitmap);
00727
00728
00729 wxMemoryDC ScratchDC;
00730 wxBitmap ScratchBit(DSize.x, DSize.y);
00731
00732
00733 ScratchDC.SelectObject(ScratchBit);
00734
00735
00736 wxRect OldRect(m_DragRect);
00737
00738
00739 m_DragRect = wxRect(point.x, point.y, DSize.x, DSize.y);
00740
00741
00742 ScratchDC.Blit(0,0,DSize.x,DSize.y,m_pDisplayDC,m_DragRect.x,m_DragRect.y);
00743
00744 wxPoint Change = OldRect.GetPosition() - m_DragRect.GetPosition();
00745
00746
00747 if (!OldRect.IsEmpty())
00748 ScratchDC.Blit(Change.x,Change.y,DSize.x,DSize.y,&BackDC,0,0);
00749
00750
00751 DragManagerOp::CurrentManager->CurrentDragInfo->
00752 OnDrawSolidDrag(m_DragRect.GetPosition(), m_pDisplayDC);
00753
00754
00755 DragManagerOp::CurrentManager->CurrentDragInfo->
00756 OnDrawSolidDrag(wxPoint(-Change.x,-Change.y), &BackDC);
00757
00758
00759 if (!OldRect.IsEmpty())
00760 m_pDisplayDC->Blit(OldRect.x,OldRect.y,DSize.x,DSize.y,&BackDC,0,0);
00761
00762
00763 BackDC.Blit(0,0,DSize.x,DSize.y,&ScratchDC,0,0);
00764
00765
00766 ScratchDC.SelectObject(wxNullBitmap);
00767
00768 BackDC.SelectObject(wxNullBitmap);
00769
00770 return TRUE;
00771 }
00772
00773
00774
00775
00776
00777
00778
00779
00780
00781
00782
00783
00784
00785
00786
00787
00788
00789 BOOL CaptureHandler::DrawTransparentDrag(wxPoint point, INT32 Transparency)
00790 {
00791
00792
00793
00794 point += DragManagerOp::CurrentManager->CurrentDragInfo->SolidDragOffset;
00795
00796
00797 wxSize DSize = DragManagerOp::CurrentManager->CurrentDragInfo->SolidDragSize;
00798
00799
00800
00801 wxMemoryDC BackDC;
00802
00803
00804 BackDC.SelectObject(*m_pBackBitmap);
00805
00806
00807 wxMemoryDC ScratchDC;
00808 wxBitmap ScratchBit(DSize.x,DSize.y);
00809
00810 wxBitmap TempBitmap(DSize.x, DSize.y);
00811 wxMemoryDC TempDC;
00812
00813 wxMemoryDC MaskDC;
00814
00815
00816 ScratchDC.SelectObject(ScratchBit);
00817
00818
00819 wxRect OldRect = m_DragRect;
00820
00821
00822 m_DragRect = wxRect(point.x,point.y,DSize.x,DSize.y);
00823
00824
00825 ScratchDC.Blit(0,0,DSize.x,DSize.y,m_pDisplayDC,m_DragRect.x,m_DragRect.y);
00826
00827 wxPoint Change = OldRect.GetPosition() - m_DragRect.GetPosition();
00828
00829
00830 if (!OldRect.IsEmpty())
00831 ScratchDC.Blit(Change.x,Change.y,DSize.x,DSize.y,&BackDC,0,0);
00832
00833 TempDC.SelectObject(TempBitmap);
00834
00835
00836 DragManagerOp::CurrentManager->CurrentDragInfo->
00837 OnDrawSolidDrag(wxPoint(0,0), &TempDC);
00838
00839
00840
00841
00842
00843 MaskDC.SelectObject(*m_pMaskBitmap);
00844
00845 TempDC.Blit(0, 0, DSize.x, DSize.y, &MaskDC, 0, 0, wxAND_INVERT);
00846
00847 wxBitmap OffScreenBmp(DSize.x, DSize.y);
00848 wxMemoryDC OffScreenDC;
00849 OffScreenDC.SelectObject(OffScreenBmp);
00850
00851 OffScreenDC.Blit(0, 0, DSize.x, DSize.y, &ScratchDC, 0, 0);
00852
00853 OffScreenDC.Blit(0, 0, DSize.x, DSize.y, &MaskDC, 0, 0, wxAND);
00854
00855 OffScreenDC.Blit(0, 0, DSize.x, DSize.y, &TempDC, 0, 0, wxOR);
00856
00857
00858 BackDC.Blit(-Change.x,-Change.y, DSize.x, DSize.y, &OffScreenDC, 0,0);
00859
00860
00861 m_pDisplayDC->Blit(m_DragRect.x, m_DragRect.y, DSize.x, DSize.y, &OffScreenDC, 0, 0);
00862
00863
00864 if(!OldRect.IsEmpty())
00865 m_pDisplayDC->Blit(OldRect.x, OldRect.y, DSize.x, DSize.y, &BackDC, 0, 0);
00866
00867
00868 BackDC.Blit(0, 0, DSize.x, DSize.y, &ScratchDC, 0, 0);
00869
00870
00871 OffScreenDC.SelectObject(wxNullBitmap);
00872 TempDC.SelectObject(wxNullBitmap);
00873 MaskDC.SelectObject(wxNullBitmap);
00874 ScratchDC.SelectObject(wxNullBitmap);
00875 BackDC.SelectObject(wxNullBitmap);
00876
00877 return TRUE;
00878 }
00879
00880
00881
00882
00883
00884
00885
00886
00887 DragManagerOp *DragManagerOp::CurrentManager = NULL;
00888 CaptureHandler *DragManagerOp::TheCaptureHandler = NULL;
00889
00890
00891
00892
00893
00894 const UINT32 DEFAULT_DRAGDIST = 6;
00895 const UINT32 DEFAULT_DRAGDELAY = 400;
00896 UINT32 DragManagerOp::DragMinDist = DEFAULT_DRAGDIST;
00897 UINT32 DragManagerOp::DragDelay = DEFAULT_DRAGDELAY;
00898
00899 MonotonicTime DragManagerOp::DragStartTimer;
00900 BOOL DragManagerOp::DragPending = FALSE;
00901 BOOL DragManagerOp::DragEnded = FALSE;
00902 BOOL DragManagerOp::DragActive = FALSE;
00903
00904 wxRect DragManagerOp::DragStartRect;
00905 wxRect DragManagerOp::StillClickRect;
00906
00907 BOOL DragManagerOp::RedrawInProgress = FALSE;
00908
00909 UINT32 DragManagerOp::StatusLineStringID = 0;
00910
00911 DragInformation * DragManagerOp::CurrentDragInfo = NULL;
00912 DragTarget * DragManagerOp::CurrentDragTarget = NULL;
00913
00914
00915
00916
00917
00918
00919
00920
00921
00922
00923
00924
00925
00926
00927 DragManagerOp::DragManagerOp()
00928 {
00929 ERROR3("DragManagerOp::DragManagerOp - Illegal (default) constructor called!\n");
00930
00931 ERROR3IF(CurrentManager != NULL, "Attempt to start a drag while already dragging!");
00932 CurrentManager = this;
00933
00934 CurrentID = 0;
00935 CurrentCursor = NULL;
00936 }
00937
00938
00939
00940
00941
00942
00943
00944
00945
00946
00947
00948
00949
00950
00951
00952
00953 DragManagerOp::DragManagerOp(DragInformation *Descriptor)
00954 {
00955 ERROR3IF(Descriptor == NULL, "DragManagerOp must be given a valid DragInformation ptr");
00956 ERROR3IF(CurrentManager != NULL, "Attempt to start a drag while already dragging!");
00957
00958 AbortDrag();
00959 CurrentManager = this;
00960 CurrentDragInfo = Descriptor;
00961
00962 CurrentKeypress = NULL;
00963
00964 DragEnded = FALSE;
00965
00966 CurrentID = 0;
00967 CurrentCursor = NULL;
00968
00969
00970
00971
00972
00973
00974
00975
00976 DragMinDist = DEFAULT_DRAGDIST;
00977 DragDelay = DEFAULT_DRAGDELAY;
00978
00979 DragStartRect = wxRect();
00980 }
00981
00982
00983
00984
00985
00986
00987
00988
00989
00990
00991
00992
00993
00994
00995 DragManagerOp::~DragManagerOp()
00996 {
00997
00998 CleanUpAfterDrag();
00999
01000
01001 CurrentManager = NULL;
01002
01003 DragActive = FALSE;
01004
01005 StatusLineStringID = 0;
01006
01007 if (CurrentCursor)
01008 delete CurrentCursor;
01009 }
01010
01011
01012
01013
01014
01015
01016
01017
01018
01019
01020
01021
01022
01023
01024 wxPoint DragManagerOp::GetDragMousePos()
01025 {
01026 wxPoint MPos(0,0);
01027
01028 if( CurrentManager != NULL )
01029 MPos = CurrentManager->CurrentMousePos;
01030 return MPos;
01031 }
01032
01033
01034
01035
01036
01037
01038
01039
01040
01041
01042
01043
01044
01045 CaptureHandler *DragManagerOp::GetDragCaptureHandler()
01046 {
01047 if( CurrentManager == NULL )
01048 return NULL;
01049
01050 return TheCaptureHandler;
01051 }
01052
01053
01054
01055
01056
01057
01058
01059
01060
01061
01062
01063
01064 DragInformation * DragManagerOp::GetCurrentDragInfo()
01065 {
01066 if( CurrentManager == NULL )
01067 return NULL;
01068
01069 return CurrentDragInfo;
01070
01071 }
01072
01073
01074
01075
01076
01077
01078
01079
01080
01081
01082
01083
01084
01085
01086
01087
01088
01089
01090
01091
01092
01093
01094
01095
01096
01097 void DragManagerOp::StartDrag(DragInformation *Descriptor, CWindowID DragWindow)
01098 {
01099 if (Descriptor == NULL)
01100 {
01101
01102 TRACE( _T("NULL Descriptor given to DragManagerOp::StartDrag()\n"));
01103 return;
01104 }
01105
01106 ERROR3IF(Descriptor == NULL, "DragManagerOp must be given a valid DragInformation ptr");
01107
01108 DragManagerOp* pNewManager = new DragManagerOp(Descriptor);
01109
01110 if (Descriptor->IsAdjustDrag)
01111 {
01112 DragPending = TRUE;
01113 if (pNewManager != NULL)
01114 {
01115 pNewManager->CurrentMousePos = wxGetMousePosition();
01116 pNewManager->InitialMousePos = pNewManager->LastMousePos = pNewManager->CurrentMousePos;
01117
01118 EndDrag(-1);
01119 }
01120 return;
01121 }
01122
01123 if (pNewManager != NULL)
01124 {
01125
01126 wxWindow* pWindow = (wxWindow*)DragWindow;
01127 if (pWindow == NULL)
01128 pWindow = GetMainFrame();
01129
01130 TheCaptureHandler = new CaptureHandler(pWindow);
01131 if (TheCaptureHandler != NULL)
01132 {
01133 DragPending = TRUE;
01134
01135
01136 pNewManager->CurrentMousePos = wxGetMousePosition();
01137 pNewManager->InitialMousePos = pNewManager->LastMousePos = pNewManager->CurrentMousePos;
01138
01139
01140 BROADCAST_TO_ALL(DragMessage(DragMessage::DRAGSTARTED, pNewManager, Descriptor));
01141
01142
01143
01144 GetApplication()->CreateDragTargets(Descriptor);
01145
01146
01147
01148
01149 #if 0
01150 #ifdef _DEBUG
01151 if (pNewManager->Targets.IsEmpty())
01152 TRACE( _T("DragManagerOp::StartDrag - No drag targets specified for this drag!"));
01153 #endif
01154 #endif
01155 pNewManager->ProcessEvent(DRAGEVENT_INITIALISE);
01156
01157
01158 TheCaptureHandler->StartCapture();
01159
01160
01161 GetApplication()->RegisterIdleProcessor(IDLEPRIORITY_HIGH, pNewManager);
01162
01163
01164 DragStartTimer.Sample();
01165
01166
01167 StillClickRect = wxRect( pNewManager->InitialMousePos.x - DragMinDist,
01168 pNewManager->InitialMousePos.y - DragMinDist,
01169 DragMinDist * 2,
01170 DragMinDist * 2);
01171 SetDragActive(TRUE);
01172 }
01173 }
01174 GetMainFrame()->SetFocus();
01175 }
01176
01177
01178
01179
01180
01181
01182
01183
01184
01185
01186
01187
01188
01189
01190 void DragManagerOp::EndDrag(INT32 Flags)
01191 {
01192 if(!CurrentManager)
01193 return;
01194
01195
01196 if (TheCaptureHandler != NULL)
01197 {
01198 TheCaptureHandler->CleanUpSolidDrag();
01199 }
01200
01201 if(DragPending)
01202 {
01203
01204 wxPoint StartMouse;
01205 StartMouse.x = CurrentManager->InitialMousePos.x;
01206 StartMouse.y = CurrentManager->InitialMousePos.y;
01207 CurrentManager->CurrentDragInfo->OnClick(Flags,StartMouse);
01208 }
01209 else
01210 {
01211
01212 CurrentManager->LastMousePos = CurrentManager->CurrentMousePos;
01213 CurrentManager->CurrentMousePos = wxGetMousePosition();
01214
01215
01216 DragEventType Event = DRAGEVENT_COMPLETED;
01217 CurrentManager->ProcessEvent(Event);
01218
01219
01220 DragEnded = TRUE;
01221 }
01222
01223
01224 if (CurrentManager)
01225 CurrentManager->ProcessEvent(DRAGEVENT_DEINITIALISE);
01226
01227 SetDragActive(FALSE);
01228
01229
01230 if (CurrentManager)
01231 CurrentManager->End();
01232 }
01233
01234
01235
01236
01237
01238
01239
01240
01241
01242
01243
01244
01245
01246
01247
01248 void DragManagerOp::AbortDrag(void)
01249 {
01250 if (CurrentManager != NULL)
01251 {
01252 CurrentManager->LastMousePos = CurrentManager->CurrentMousePos;
01253 CurrentManager->CurrentMousePos = wxGetMousePosition();
01254
01255 if (TheCaptureHandler != NULL)
01256 TheCaptureHandler->CleanUpSolidDrag();
01257
01258 CurrentManager->ProcessEvent(DRAGEVENT_ABORT);
01259
01260
01261 CurrentManager->ProcessEvent(DRAGEVENT_DEINITIALISE);
01262
01263 CurrentManager->End();
01264 }
01265
01266 SetDragActive(FALSE);
01267 }
01268
01269
01270
01271
01272
01273
01274
01275
01276
01277
01278
01279
01280
01281
01282
01283
01284 DragManagerOp *DragManagerOp::GetCurrentManager(void)
01285 {
01286 return(CurrentManager);
01287 }
01288
01289
01290
01291
01292
01293
01294
01295
01296
01297
01298
01299
01300
01301
01302
01303
01304
01305
01306
01307
01308
01309
01310
01311
01312
01313
01314
01315
01316
01317
01318
01319
01320
01321
01322
01323
01324
01325
01326
01327 BOOL DragManagerOp::ProcessEvent(DragEventType Event)
01328 {
01329 BOOL BroadcastToAll = FALSE;
01330
01331 if (Event == DRAGEVENT_INITIALISE || Event == DRAGEVENT_DEINITIALISE)
01332 BroadcastToAll = TRUE;
01333
01334 if(CurrentManager == NULL || (DragEnded && Event != DRAGEVENT_DEINITIALISE))
01335 return FALSE;
01336
01337 LastEvent = Event;
01338
01339 DragTarget *Ptr = (DragTarget *) Targets.GetHead();
01340 DragTarget *Next;
01341
01342 OilCoord KernelMousePos(0,0);
01343 wxPoint WinoilMousePos(CurrentMousePos);
01344 CurrentDragTarget = NULL;
01345 BOOL OverTarget = FALSE;
01346
01347
01348
01349 while (Ptr != NULL)
01350 {
01351
01352 WinoilMousePos = CurrentMousePos;
01353
01354
01355 Next = (DragTarget *) Targets.GetNext(Ptr);
01356 BOOL GoAhead = TRUE;
01357
01358 if (Ptr->IsAKernelObject())
01359 {
01360 KernelMousePos = OilCoord(0,0);
01361
01362 DialogOp *pDialogOp;
01363 CGadgetID GadgetID;
01364 Ptr->GetTargetAreaInfo(&pDialogOp, &GadgetID);
01365
01366 if (pDialogOp != NULL)
01367 {
01368 wxWindow* TargetWindow = (wxWindow*)pDialogOp->WindowID;
01369
01370 if (GadgetID != 0)
01371 TargetWindow = TargetWindow->FindWindow((INT32)GadgetID);
01372
01373
01374
01375
01376
01377
01378 wxRect TargetRect = TargetWindow->GetRect();
01379
01380 if (TargetWindow->GetParent() && !TargetWindow->IsTopLevel())
01381 {
01382 TargetWindow->GetParent()->ClientToScreen(&TargetRect.x, &TargetRect.y);
01383
01384 }
01385
01386
01387
01388 if (BroadcastToAll || Ptr->WantsAllEvents() ||
01389 TargetRect.Inside(WinoilMousePos))
01390 {
01391
01392 wxWindow* WindowUnderPoint = wxChildWindowFromPoint(WinoilMousePos, false, -1);
01393 BOOL AreOverTargetWnd = (WindowUnderPoint == TargetWindow);
01394
01395 if (!AreOverTargetWnd)
01396 {
01397
01398
01399
01400
01401
01402 wxWindow* ChildWindowUnderPoint = ::wxChildWindowFromPoint(TargetWindow, WinoilMousePos, false, -1);
01403 AreOverTargetWnd = (ChildWindowUnderPoint != NULL &&
01404 ChildWindowUnderPoint == WindowUnderPoint);
01405 }
01406
01407 if (BroadcastToAll || Ptr->WantsAllEvents() || AreOverTargetWnd)
01408 {
01409 wxScreenDC dc;
01410 wxSize ppi = OSRenderRegion::GetFixedDCPPI(dc);
01411
01412 KernelMousePos.x = ((WinoilMousePos.x - TargetRect.GetLeft()) * 72000) / ppi.GetWidth();
01413
01414 KernelMousePos.y = ((TargetRect.GetBottom() - WinoilMousePos.y) * 72000) / ppi.GetHeight();
01415 }
01416 else
01417 GoAhead = FALSE;
01418 }
01419 else
01420 GoAhead = FALSE;
01421 }
01422
01423
01424
01425 if (GoAhead &&
01426 Ptr->ProcessEvent(Event, CurrentDragInfo, &KernelMousePos, CurrentKeypress))
01427 {
01428 CurrentDragTarget = Ptr;
01429 OverTarget = TRUE;
01430
01431 if (!BroadcastToAll)
01432 break;
01433 }
01434 }
01435 else
01436 {
01437 wxWindow* TargetWindow;
01438 wxRect TargetRect;
01439 Ptr->GetTargetAreaInfo(&TargetWindow, &TargetRect);
01440 #if FALSE
01441 if (TargetWindow)
01442 {
01443 TRACEUSER("Gerry", _T("OilTargetWindow = %s"), TargetWindow->GetClassInfo()->GetClassName());
01444 TRACEUSER("Gerry", _T("TargetRect = (%d, %d) [%d, %d]"), TargetRect.x, TargetRect.y, TargetRect.width, TargetRect.height);
01445 }
01446 else
01447 {
01448 TRACEUSER("Gerry", _T("OilTargetWindow = <NONE>"));
01449 }
01450 #endif
01451 wxPoint ClientPoint;
01452 ClientPoint.x = WinoilMousePos.x;
01453 ClientPoint.y = WinoilMousePos.y;
01454
01455 if (TargetWindow != NULL)
01456 {
01457
01458 ClientPoint = TargetWindow->ScreenToClient(ClientPoint);
01459
01460
01461 if (BroadcastToAll || Ptr->WantsAllEvents() ||
01462 TargetRect.Inside(ClientPoint))
01463 {
01464
01465
01466
01467
01468 wxWindow* WindowUnderPoint = ::wxChildWindowFromPoint(WinoilMousePos, false, -1);
01469
01470 if (WindowUnderPoint)
01471 {
01472
01473 }
01474
01475 BOOL AreOverTargetWnd = (WindowUnderPoint == TargetWindow);
01476
01477
01478 if (!AreOverTargetWnd)
01479 {
01480
01481
01482
01483
01484
01485 wxWindow* ChildWindowUnderPoint = ::wxChildWindowFromPoint(TargetWindow, WinoilMousePos, false, -1);
01486
01487 AreOverTargetWnd = (ChildWindowUnderPoint != NULL &&
01488 ChildWindowUnderPoint == WindowUnderPoint);
01489
01490
01491 }
01492
01493 if (!BroadcastToAll && !Ptr->WantsAllEvents() && !AreOverTargetWnd)
01494 {
01495 GoAhead = FALSE;
01496 }
01497 }
01498 else
01499 GoAhead = FALSE;
01500 }
01501
01502
01503
01504
01505 if (GoAhead)
01506 {
01507 wxPoint PointInWindow(ClientPoint);
01508
01509 if (Ptr->ProcessEvent(Event, CurrentDragInfo, &PointInWindow, CurrentKeypress))
01510 {
01511 CurrentDragTarget = Ptr;
01512 OverTarget = TRUE;
01513
01514 if (!BroadcastToAll)
01515 break;
01516 }
01517 }
01518 }
01519
01520 Ptr = Next;
01521 }
01522
01523 if (!DragPending && Event != DRAGEVENT_COMPLETED)
01524 {
01525 SetStatusLineText();
01526 SetCursor();
01527 }
01528
01529 return OverTarget;
01530 }
01531
01532
01533
01534
01535
01536
01537
01538
01539
01540
01541
01542
01543
01544
01545
01546
01547
01548
01549
01550
01551 BOOL DragManagerOp::OnIdleEvent(void)
01552 {
01553 LastMousePos = CurrentMousePos;
01554 CurrentMousePos = wxGetMousePosition();
01555
01556 if(DragEnded)
01557 return(FALSE);
01558
01559 BOOL JustStartedDrag = FALSE;
01560
01561
01562
01563 if (DragPending)
01564 {
01565
01566
01567 if (!DragStartTimer.Elapsed(DragDelay) &&
01568 StillClickRect.Inside(CurrentMousePos))
01569 {
01570
01571 return(FALSE);
01572 }
01573
01574 DragPending = FALSE;
01575 JustStartedDrag = TRUE;
01576
01577 TheCaptureHandler->SetUpSolidDrag(CurrentMousePos);
01578 }
01579
01580
01581 DragEventType Event = DRAGEVENT_MOUSEIDLE;
01582 if (LastMousePos == CurrentMousePos)
01583 {
01584 if (LastEvent == DRAGEVENT_MOUSESTOPPED || LastEvent == DRAGEVENT_MOUSEIDLE)
01585 {
01586
01587 Event = DRAGEVENT_MOUSEIDLE;
01588 }
01589 else
01590 {
01591
01592 Event = DRAGEVENT_MOUSESTOPPED;
01593 }
01594 }
01595 else
01596 {
01597
01598 Event = DRAGEVENT_MOUSEMOVED;
01599 }
01600
01601
01602
01603 BOOL ClaimTheIdle = (Event == DRAGEVENT_MOUSEMOVED);
01604
01605
01606
01607
01608
01609
01610 if (KeyPress::IsEscapePressed())
01611 {
01612 AbortDrag();
01613 return(FALSE);
01614 }
01615
01616
01617
01618 ProcessEvent(Event);
01619
01620 #if FALSE
01621
01622
01623
01624
01625
01626
01627
01628
01629
01630
01631
01632
01633
01634
01635
01636
01637
01638
01639
01640
01641 #endif
01642
01643 return(ClaimTheIdle);
01644
01645 }
01646
01647
01648
01649
01650
01651
01652
01653
01654
01655
01656
01657
01658
01659
01660
01661
01662
01663
01664
01665
01666
01667
01668
01669
01670
01671
01672
01673
01674
01675
01676 void DragManagerOp::RegisterTarget(DragTarget *NewTarget, BOOL HighPriority)
01677 {
01678 ERROR3IF(NewTarget == NULL,
01679 "DragManagerOp::RegisterTarget - NULL Target parameter is illegal");
01680
01681 if (HighPriority)
01682 Targets.AddHead(NewTarget);
01683 else
01684 Targets.AddTail(NewTarget);
01685 }
01686
01687
01688
01689
01690
01691
01692
01693
01694
01695
01696
01697
01698
01699
01700
01701
01702
01703
01704
01705
01706
01707
01708 void DragManagerOp::DeregisterTarget(DragTarget *OldTarget)
01709 {
01710 DragTarget *Ptr = (DragTarget *) Targets.GetHead();
01711 DragTarget *Next;
01712
01713 while (Ptr != NULL)
01714 {
01715 Next = (DragTarget *) Targets.GetNext(Ptr);
01716
01717 if (Ptr == OldTarget)
01718 {
01719 Targets.RemoveItem(Ptr);
01720 delete Ptr;
01721 }
01722
01723 Ptr = Next;
01724 }
01725 }
01726
01727
01728
01729
01730
01731
01732
01733
01734
01735
01736
01737
01738
01739
01740
01741
01742
01743
01744
01745
01746
01747 void DragManagerOp::CleanUpAfterDrag(void)
01748 {
01749 TRACEUSER("Gerry", _T("DragManagerOp::CleanUpAfterDrag"));
01750
01751 GetApplication()->RemoveIdleProcessor(IDLEPRIORITY_HIGH, this);
01752
01753 if (TheCaptureHandler != NULL)
01754 {
01755 TRACEUSER("Gerry", _T("Deleting TheCaptureHandler"));
01756
01757 delete TheCaptureHandler;
01758 TheCaptureHandler = NULL;
01759 }
01760
01761 if (CurrentDragInfo != NULL)
01762 {
01763 delete CurrentDragInfo;
01764 CurrentDragInfo = NULL;
01765 }
01766
01767 if (CurrentKeypress != NULL)
01768 {
01769 delete CurrentKeypress;
01770 CurrentKeypress = NULL;
01771 }
01772
01773
01774
01775 while (!Targets.IsEmpty())
01776 DeregisterTarget((DragTarget *) Targets.GetHead());
01777 }
01778
01779
01780
01781
01782
01783
01784
01785
01786
01787
01788
01789
01790
01791
01792 void DragManagerOp::SetCursor()
01793 {
01794 UINT32 CursorID;
01795
01796
01797 if(CurrentDragTarget== NULL)
01798 CursorID = CurrentDragInfo->GetCursorID();
01799 else
01800 CursorID = CurrentDragTarget->GetCursorID();
01801
01802
01803 if(CursorID == 0)
01804 return;
01805
01806 if(CurrentManager->CurrentID != CursorID)
01807 {
01808 if(CurrentManager->CurrentCursor)
01809 {
01810 delete CurrentManager->CurrentCursor;
01811 CurrentManager->CurrentCursor = NULL;
01812 }
01813 if(CurrentManager->CurrentCursor==NULL)
01814 {
01815 CurrentManager->CurrentCursor = new Cursor(CursorID);
01816 if (CurrentManager->CurrentCursor)
01817 CurrentManager->CurrentCursor->SetActive();
01818 }
01819
01820 CurrentManager->CurrentID = CursorID;
01821 }
01822 }
01823
01824
01825
01826
01827
01828
01829
01830
01831
01832
01833
01834
01835
01836 void DragManagerOp::SetStatusLineText()
01837 {
01838 String_256 StatusText;
01839 if(CurrentDragTarget==NULL)
01840 {
01841 if(CurrentDragInfo)
01842 if(CurrentDragInfo->GetStatusLineText(&StatusText))
01843 GetApplication()->UpdateStatusBarText(&StatusText,FALSE);
01844 }
01845 else
01846 {
01847 if(CurrentDragTarget->GetStatusLineText(&StatusText))
01848 GetApplication()->UpdateStatusBarText(&StatusText,FALSE);
01849 }
01850
01851
01852 }
01853
01854
01855
01856
01857
01858
01859
01860
01861
01862
01863
01864
01865
01866
01867
01868
01869
01870 BOOL DragManagerOp::GetStatusText(String_256 * StatusText)
01871 {
01872 ERROR2IF(StatusText==NULL,FALSE,"DragManagerOp::GetStatusLineText() - StatusText==NULL!");
01873
01874 String_256 Text;
01875 if(CurrentDragTarget)
01876 {
01877 if(CurrentDragInfo->GetStatusLineText(&Text))
01878 * StatusText = Text;
01879 else
01880 return FALSE;
01881 }
01882 else
01883 {
01884 if(CurrentDragTarget->GetStatusLineText(&Text))
01885 * StatusText = Text;
01886 else
01887 return FALSE;
01888 }
01889
01890 return TRUE;
01891
01892 }
01893
01894
01895
01896
01897
01898
01899
01900
01901
01902
01903
01904
01905
01906
01907
01908
01909
01910
01911
01912
01913
01914 void DragManagerOp::RedrawStarting()
01915 {
01916 if (RedrawInProgress)
01917 return;
01918
01919 RedrawInProgress = TRUE;
01920
01921 if (DragManagerOp::CurrentManager &&
01922 DragManagerOp::CurrentManager->CurrentDragInfo &&
01923 DragManagerOp::CurrentManager->CurrentDragInfo->DoesSolidDrag)
01924 {
01925 DragManagerOp::CurrentManager->TheCaptureHandler->CleanUpSolidDrag();
01926 }
01927 }
01928
01929
01930
01931
01932
01933
01934
01935
01936
01937
01938
01939
01940
01941
01942
01943
01944
01945
01946
01947
01948
01949
01950
01951
01952
01953
01954
01955
01956
01957
01958
01959
01960
01961 void DragManagerOp::RedrawStarting(CWindowID TheWindow, CGadgetID TheGadget, DocRect *TheArea)
01962 {
01963 if (RedrawInProgress)
01964 return;
01965
01966 if (DragManagerOp::CurrentManager &&
01967 DragManagerOp::CurrentManager->CurrentDragInfo &&
01968 DragManagerOp::CurrentManager->CurrentDragInfo->DoesSolidDrag)
01969 {
01970 wxWindow* pWindow = (wxWindow*)TheWindow;
01971 wxWindow* pGadget = pWindow->FindWindow((INT32)TheGadget);
01972 if (pGadget != NULL)
01973 {
01974 wxRect AreaClientRect;
01975 wxRect ClientRect;
01976 if (TheArea != NULL)
01977 {
01978 ReDrawInfoType DlgInfo;
01979 DialogManager::GetKernelRenderedGadgetInfo(TheWindow, TheGadget, &DlgInfo);
01980
01981 INT32 PixelSize = 72000 / DlgInfo.Dpi;
01982 AreaClientRect.x = TheArea->lo.x / PixelSize;
01983 AreaClientRect.y = TheArea->hi.x / PixelSize;
01984 AreaClientRect.width = TheArea->Width() / PixelSize;
01985 AreaClientRect.height = TheArea->Height() / PixelSize;
01986 }
01987 else
01988 AreaClientRect = pGadget->GetClientRect();
01989
01990 ClientRect = pGadget->GetClientRect();
01991
01992 wxRect ScreenRect(ClientRect);
01993
01994
01995 if (!ScreenRect.Intersect(AreaClientRect).IsEmpty())
01996 {
01997
01998
01999 pGadget->ClientToScreen(&ScreenRect.x, &ScreenRect.y);
02000
02001 RedrawInProgress = DragManagerOp::CurrentManager->TheCaptureHandler->
02002 CleanUpSolidDragInScreenArea(ScreenRect);
02003 }
02004 else
02005 RedrawInProgress = FALSE;
02006 }
02007 else
02008 {
02009
02010 DragManagerOp::CurrentManager->TheCaptureHandler->CleanUpSolidDrag();
02011 RedrawInProgress = TRUE;
02012 }
02013 }
02014 }
02015
02016
02017
02018
02019
02020
02021
02022
02023
02024
02025
02026
02027
02028 void DragManagerOp::RedrawFinished()
02029 {
02030 if (!RedrawInProgress)
02031 return;
02032
02033 RedrawInProgress = FALSE;
02034
02035 if (DragManagerOp::CurrentManager &&
02036 DragManagerOp::CurrentManager->CurrentDragInfo &&
02037 DragManagerOp::CurrentManager->CurrentDragInfo->DoesSolidDrag)
02038 {
02039 wxPoint LastMousePos = DragManagerOp::CurrentManager->GetDragMousePos();
02040 DragManagerOp::CurrentManager->TheCaptureHandler->SetUpSolidDrag(LastMousePos);
02041 }
02042 }