#include <coldlog.h>
Inheritance diagram for ColEditorDragTarget:
Public Member Functions | |
ColEditorDragTarget (DialogOp *TheDialog, CGadgetID TheGadget=NULL) | |
Constructs and registers this drag target with the current drag manager. | |
virtual UINT32 | GetCursorID () |
Base Method to set cursor over this target. | |
virtual BOOL | GetStatusLineText (String_256 *TheText) |
provide status line text for this target | |
Protected Member Functions | |
virtual BOOL | ProcessEvent (DragEventType Event, DragInformation *pDragInfo, OilCoord *pMousePos, KeyPress *pKeyPress) |
Event Handler for dragging colours over the colour editor. | |
BOOL | CanDropHere (DragInformation *pDragInfo) |
To determine if we should accept the given drag on this target. | |
Friends | |
class | DragManagerOp |
To remove a drag target at any time, destruct it - it automatically deregisters and cleans up.
Definition at line 595 of file coldlog.h.
|
Constructs and registers this drag target with the current drag manager.
Definition at line 10823 of file coldlog.cpp. 10824 : KernelDragTarget(TheDialog, TheGadget) 10825 { 10826 10827 }
|
|
To determine if we should accept the given drag on this target.
Definition at line 10990 of file coldlog.cpp. 10991 { 10992 if (pDragInfo != NULL && pDragInfo->IsKindOf(CC_RUNTIME_CLASS(ColourDragInformation))) 10993 { 10994 ColourDragInformation *CDInfo = (ColourDragInformation *) pDragInfo; 10995 10996 // Library colours can always be edited, as they're copied into the document first 10997 if (CDInfo->IsLibraryColour()) 10998 return(TRUE); 10999 11000 // Get the dragged colour and the current colour list 11001 IndexedColour *Col = CDInfo->GetInitiallyDraggedColour(); 11002 11003 if (Col != NULL) // If it's not "no colour", see if we're happy to edit it 11004 { 11005 ColourList *ColList = NULL; 11006 if (CDInfo->GetParentDoc() != NULL) 11007 ColList = CDInfo->GetParentDoc()->GetIndexedColours(); 11008 11009 return(ColourEditDlg::CanYouEditThis(ColList, Col)); 11010 } 11011 } 11012 11013 return(FALSE); 11014 }
|
|
Base Method to set cursor over this target.
Reimplemented from DragTarget. Definition at line 10936 of file coldlog.cpp. 10937 { 10938 if (CanDropHere(DragManagerOp::GetCurrentDragInfo())) 10939 return _R(IDC_CANDROP_EDITBUTTON); 10940 10941 return 0; 10942 }
|
|
provide status line text for this target
Reimplemented from DragTarget. Definition at line 10959 of file coldlog.cpp. 10960 { 10961 ERROR2IF(TheText==NULL,FALSE,"NULL string in GetStatusLineText()"); 10962 10963 if (CanDropHere(DragManagerOp::GetCurrentDragInfo())) 10964 { 10965 String_256 DragString(_R(IDS_K_COLDLOG_DROPTOEDIT)); 10966 *TheText = DragString; 10967 return TRUE; 10968 } 10969 10970 return FALSE; 10971 }
|
|
Event Handler for dragging colours over the colour editor.
Reimplemented from KernelDragTarget. Definition at line 10850 of file coldlog.cpp. 10853 { 10854 // Not a colour drag? That is kindof unexpected, but lets exit before 10855 // we embarrass ourselves 10856 if (pDragInfo == NULL || !pDragInfo->IsKindOf(CC_RUNTIME_CLASS(ColourDragInformation))) 10857 return(FALSE); 10858 10859 ColourDragInformation *ColDragInfo = (ColourDragInformation *) pDragInfo; 10860 10861 BOOL IsLibColour = ColDragInfo->IsLibraryColour(); 10862 10863 IndexedColour *Col = ColDragInfo->GetInitiallyDraggedColour(); 10864 if (!IsLibColour && Col == NULL) // Don't allow dropping of "No colour" 10865 return(FALSE); 10866 10867 switch(Event) 10868 { 10869 case DRAGEVENT_COMPLETED: 10870 if (ColourEditDlg::TheEditor != NULL && CanDropHere(pDragInfo)) 10871 { 10872 Document *ParentDoc = NULL; 10873 if (!IsLibColour) 10874 ParentDoc = ColDragInfo->GetParentDoc(); 10875 10876 if (ParentDoc == NULL) 10877 ParentDoc = Document::GetSelected(); 10878 10879 if (ParentDoc != NULL) 10880 { 10881 ColourList *ColList = ParentDoc->GetIndexedColours(); 10882 10883 if (IsLibColour) 10884 { 10885 Col = NULL; // Just to be on the safe side 10886 10887 // We must copy the library colour into the document, but first check with 10888 // the user that this is what they intended. 10889 // WEBSTER - markn 30/1/97 10890 // Don't ask in webster, just copy it over 10891 #ifndef WEBSTER 10892 if (InformError(_R(IDE_CANTEDITLIBCOLOUR), _R(IDS_COPYLIBCOLOUR), _R(IDS_CANCEL)) == 1) 10893 Col = ColDragInfo->GetColourForDocument(ParentDoc); 10894 #else 10895 Col = ColDragInfo->GetColourForDocument(ParentDoc); 10896 #endif // WEBSTER 10897 } 10898 10899 if (Col != NULL && ColourEditDlg::CanYouEditThis(ColList, Col)) 10900 ColourEditDlg::InvokeDialog(ColList, Col); 10901 } 10902 10903 return(TRUE); 10904 } 10905 break; 10906 10907 10908 case DRAGEVENT_MOUSESTOPPED: 10909 case DRAGEVENT_MOUSEMOVED: 10910 case DRAGEVENT_MOUSEIDLE: 10911 // Return TRUE to claim the mouse while over our target area, so that 10912 // our cursor shape is used 10913 return(TRUE); 10914 10915 default: 10916 break; 10917 } 10918 10919 // Allow unknown/unwanted events to pass on to other targets 10920 return(FALSE); 10921 }
|
|
Reimplemented from KernelDragTarget. |