Drag and drop of events and banners onto days, events and banners is available from and to CalendarSet areas.
When an item is clicked and dragged, the cursor will change. If the drop is allowed, the cursor will have a plus symbol attached to it when it hovers over the “drop” area:
If the drop is not allowed by the destination object, you’ll see a “no entry” sign instead:
You can allow events and banners to be dragged from a CalendarSet area and dropped to various destinations:
You can also allow dropping onto days, events and / or banners in a CalendarSet area from various sources:
You can control each CalendarSet area's draggability and droppability:
You must configure CalendarSet to allow dragging out of and into a CalendarSet area. Commands provide the control necessary to allow or disallow dragging within an area, between two or more areas or from non-plugin objects.
You can allow dropping onto days, events and/or banners. For drags that originate from other sources, the dropping onto days could be conceived as the creation of a new event. Dropping onto events or banners could be thought of as “linking” of some outside information to the event (such as linking a contact to an event).
To allow dragging out of CalendarSet, you must pass an “access code” for the area that is to be dragged from. You must specify at least one code to enable dragging, using CS_SetDrgSrc. Up to ten codes can be passed. Allowing many codes provides for more flexibility in enabling and disabling dragging between various areas. This will be explained in more depth below.
In order to allow dropping into CalendarSet, you must pass an “access code” for each type of item (days, events and / or banners) that can be the destination of a drop. You must specify at least one code to enable dropping, using CS_SetDrgDst. As with CS_SetDrgSrc, up to ten codes can be passed for flexibility reasons.
CalendarSet supports one source data type and three destination data types:
This DataType parameter is used in the commands CS_SetDrgSrc, CS_SetDrgDst, and CS_GetDrgDstTyp.
These are the possible values:
Source or destination | Value | Constant |
---|---|---|
Day (destination) | 1 | CS_DragDestination_Day |
Event (destination) | 2 | CS_DragDestination_Event |
Banner (destination) | 3 | CS_DragDestination_Banner |
Event or banner (source) | 2 | CS_DragSource_EventBanner |
Use CS_GetDrgSrcEvt to determine whether an event or banner was dragged, and which event or banner it was after a drop has completed
The access codes that are passed in CS_SetDrgSrc. and CS_SetDrgDst. are used to enable dragging between specific drag partners. These drag partners can be the same CalendarSet area, different CalendarSet areas, AreaList Pro plugin areas, text selections from 4D or other applications and external documents.
Note: for compatibility reasons the CalendarSet area is draggable and droppable even if it is not set as draggable or droppable in the 4D layout's object properties.
When dragging from and to CalendarSet or AreaList Pro areas (or within the same area) the source of the drag and the target of the drop are designated as drag and drop partners. You need to tell CalendarSet (and AreaList Pro if used) what these partnerships are, and to do this you create access codes.
An access code is simply a text code that you create. Let’s say you have a layout that contains two CalendarSet areas: Cal1 and Cal2, and you want to enable items to be dragged from Cal1 and dropped onto Cal2. You might decide on the access code “select”. To enable event and banner dragging you will need two lines of code:
CS_SetDrgSrc(Cal1;CS_DragSource_EventBanner;"select") CS_SetDrgDst(Cal2;CS_DragDestination_Day;"select")
You can list up to 10 access codes for each source (events and banners) and destination (days, events or banners). For example, suppose you have four CalendarSet areas on a form: AreaA, AreaB, AreaC and AreaD. You want to allow drag and drop from AreaA to AreaB or AreaC, and from AreaD to AreaC but not AreaB:
1. Create two access codes: “dropB” and “dropC”.
2. Set the access codes for the four areas as follows:
CS_SetDrgSrc(AreaA;CS_DragSource_EventBanner;"dropB";"dropC") // drag to B and C CS_SetDrgSrc(AreaD;CS_DragSource_EventBanner;dropC") // drag to C CS_SetDrgDst(AreaB;CS_DragDestination_Day;"dropB") // accept drop to days from A CS_SetDrgDst(AreaC;CS_DragDestination_Day;"dropC") // accept drop to days from A & D
Note: as opposed to AreaList Pro properties where all access codes are passed in the same string (list of codes separated by ‘|’), with CalendarSet each access code is a parameter by itself: “dropB”;“dropC”.
That’s all you need to do to enable basic drag and drop functionality between two areas with default settings.
When a drag and drop takes place, the drag sender’s plugin code communicates its access codes to the drop receiver’s plugin code. The drop receiver will compare the access codes of the sender to its own codes. If any of the codes match, the drop is allowed. This mechanism allows a number of combinations between several drag and drop partners.
Note: access codes are strictly compared, taking into account case and diacritics.
The following is an example of enabling the dragging and dropping of events within the same CalendarSet area by setting a unique identifier that only enables dragging within this area.
// enable drag events to days within this area vSelfStr:="CalendarSetArea"+String(eCal) // only allows dragging and dropping within this area CS_SetDrgSrc(eCal;CS_DragSource_EventBanner;vSelfStr) // event or banner data type for source CS_SetDrgDst(eCal;CS_DragDestination_Day;vSelfStr) // day data type for destination
External objects are defined in this context as non CalendarSet (or AreaList Pro) plugin areas:
Since external objects obviously don't support access codes they will be potential recipients of any drag from a draggable CalendarSet area, or source of any drop to a droppable CalendarSet area.
Any source access code will make a CalendarSet area draggable to external objects.
The “_external” special access code must be used as a destination access code in order to make a CalendarSet area droppable from external objects:
We can modify the example above to allow dragging from an external object to area B:
CS_SetDrgSrc(AreaA;CS_DragSource_EventBanner;"dropB";"dropC") // drag to B, C and external objects CS_SetDrgSrc(AreaD;CS_DragSource_EventBanner;dropC") // drag to C and external objects CS_SetDrgDst(AreaB;CS_DragDestination_Day;"dropB";"_external") // accept drop from A & external objects CS_SetDrgDst(AreaC;CS_DragDestination_Day;"dropC") // accept drop from A & D
You can fine-tune your control over the user's drag and drop from the callback method set by CS_SetCallback.
During a drag and drop, this method will be called under two circumstances:
Note: the callback method will not be called with CS_Action_DragOver when the source of the drag and drop is a plugin area, where access codes are used instead to specifically allow drag and drop between areas.
When the drop is completed, the form method/CalendarSet area object (or callback method if previously set by CS_SetCallback.) is executed. You can then determine what the last user action was using CS_GetAction (form / object method) or $2 (callback method).
The event 4 (drag) is not reported if the drag ended as drop into the same CalendarSet area.
The source area's last action is 4 (drag), the destination area's last action is CS_Action_Drop.
Action 4 (drag) should no longer be used anyway. Use the CS_Action_Drop callback action instead, or the form / object method On Drop event.
Note: the action reported by CS_GetAction will never be CS_Action_DragOver for an external object source, but the callback will receive this event in $2. See On drag over below
The callback method is called with the CS_Action_DragOver action when an external object is dragged over the area. It is used to allow or reject the drop.
Note: never display a window in the callback while processing this CS_Action_DragOver action, including TRACE or ALERT: 4D would freeze (ACI0087433).
This method (actually a function in this case) receives two parameters, and must return a result:
Note: if no callback is set the drop from an external object will always be accepted (provided that “_external” is set as a destination access code for the area). Therefore the callback is the only way to disallow a drop from an external object on a droppable area.
The pointer shape will depend upon this result:
Note: once an allowed destination has been rolled over, the cursor will stay as “+” even when you subsequently move to a place where the drop is not allowed: the drop will nevertheless be allowed and the On Drop form event will be triggered. This is due to a limitation of 4D, which does not call the plugin again to ask if the drop is allowed unless you leave the area and re-enter it again. In this case CS_GetDrgXXX will return zeros.
When an event or banner is dropped onto a CalendarSet area, the following information is available to you:
The processing of the drop event can either be handled in the callback with the CS_Action_Drop action or the form method / CalendarSet area object method with the On Drop event, which is always executed in the context of the destination area / process.The call sequence is:
1. Callback method with CS_Action_Drop in $2
2. Area object method with On Drop form event
3. Form method with On Drop form event
Note: when displaying CalendarSet in an external window there is no form / object method to execute, therefore the callback is the only way to control drag and drop in this context.
The callback method receives two parameters:
You can determine which event or banner was dropped using CS_GetDrgSrcEvt.
To determine which object was the source of the drag, call CS_GetDrgSrcArea. This command returns the area reference (a long integer) and the process ID of the source area, whether it is the same CalendarSet area or another CalendarSet area, or an AreaList Pro area (the area reference will be negative in this case).
See also Receiving a drop from a non-CalendarSet Object below.
When dragging to/from another area or a 4D object, that object can either reside in the same window or on another window, which may require use of 4D’s process communication commands to take action on the drop.
Note: when dragging and dropping to or from other objects, CalendarSet is only providing a user interface to the drag, and notifying you, the developer, that the drop has occurred. You are responsible for manipulating any arrays or other data structures.
You must call CS_GetDrgDstTyp to determine if the destination of the drop was either a day or event.
In the case when the sender and the receiver is the same CalendarSet area:
Note: keep in mind that CalendarSet will update the arrays and refresh the area if (and only if) the drag and drop is within the same area (events or banners to days). Also, dragging onto “out of range” days in the same area will only be allowed if the UnusedInfo parameter to CS_Options is set to CS_Unused_GrayedNumBan.
As well as dragging between two CalendarSet areas, you can also drag between non-CalendarSet objects and CalendarSet areas — for example, a row or cell selection from AreaList Pro, another 4D object, a text selection in any (drag and drop savvy) application window or a drop from an external document.
Receiving a drop from an AreaList Pro area is identified by CS_GetDrgSrcArea returning a negative value (opposite of the AreaList Pro area reference) in the SourceArea parameter and its process in SourceProcessID.
If the source of the drag is an external object, the callback (if set for the area) will be triggered twice:
In both cases (and in the 4D object / form method after the drop) the SourceArea from CS_GetDrgSrcArea will be zero and the SourceProcessID will be:
Also in both callback calls the content of the dragged and dropped object is a text included in the pasteboard.
Use GET PASTEBOARD DATA to analyze the dragged data and allow the drop (CS_Action_DragOver) or process it (CS_Action_Drop).
When dragging from non-plugin objects, you can use a callback method to “catch” the user action and allow it or not (callback methods are set with the CS_SetCallback command). If no callback is set, the drop will be allowed.
In order for external object drag and drop to be disallowed once an area has been made droppable with the “_external” destination access code, the callback method must be set and handle the CS_Action_DragOver case.
See the External documents example below.
The source AreaList Pro area is referenced as a negative value in the SourceArea parameter of CS_GetDrgSrcArea (opposite of the AreaList Pro area reference).
Plugin area references use sequential numbering: 1 can be AreaList Pro and CalendarSet area references at the same time, therefore AreaList Pro area #1 will be referenced from CalendarSet's point of view as -1, to differentiate from CalendarSet area #1.
C_LONGINT($srcALPArea) If (Form event=On Drop) // here we use the object method, no callback set CS_GetDrgSrcArea(eCal;$sourceArea;$sourceProcess) $srcALPArea:=-$sourceArea //AreaList Pro's area reference (note the minus sign) If ($srcALPArea=ALPappointments) // is this AreaList Pro area our appointment list? // Do something with the appointements End if End if
Refer to the AreaList Pro manual regarding accepting a drop in an AreaList Pro area.
You can use the following code in the On Drop event when accepting a drop from a 4D object:
DRAG AND DROP PROPERTIES($srcObject;$srcElement;$srcProcess)
Note: $srcObject is Nil if the source 4D object has Automatic Drag enabled.
$srcObject is also Nil if it comes from a different application (or 4D instance).
Then you can use the following code to check what has been dropped:
ARRAY TEXT($4Dsignatures;0) ARRAY TEXT($nativeTypes;0) ARRAY TEXT($formatNames;0) GET PASTEBOARD DATA TYPE($4Dsignatures;$nativeTypes;$formatNames)
Note: the On Drop event code will work correctly after the drop when used in an area’s object method but in an event callback the form event is zero and drag & drop properties from 4D will not function. However the pasteboard can still be analyzed in the callback with both actions CS_Action_DragOver and CS_Action_Drop.
After Allowing the drop from external objects in the callback, the CS_Action_Drop action or the On Drop event are used to open the document according to the pathname retrieved from the pasteboard, then process it.
In the following example (available in the CalendarSet demonstration database) we import events from a XML document. We set the callback and allow drop from external documents in the CalendarSet area object method:
Case of : (Form event=On Load) CS_SetDrgDst (xCalendar;CS_DragDestination_Day;"_external") // destination days, external only CS_SetCallback (xCalendar;"CSEventCallbackDD") // callback method End case
Then we allow the drop in the callback if the external source is a XML type document, and if such is the case we process it to create our events.
C_LONGINT($1;$2;$0;$i;$elements) // $0 for CS_Action_DragOver only C_DATE($date) C_TEXT($path;$ref;$xml_Tmp;$xml_Tmp2;$description;$participant;$hour) C_BLOB($data) Case of : ($2=CS_Action_DragOver) $0:=0 // disallow drop unless it is an external XML file GET PASTEBOARD DATA("com.4d.private.file.url";$data) // gets file pathname if external document If (OK=1) // something valid in the pasteboard $path:=Get file from pasteboard(1) // first file If ($path="@xml") // is it a XML document? $0:=1 //allowdrop End if End if : ($2=CS_Action_Drop) // was tested above so we know it is a valid XML document GET PASTEBOARD DATA ("com.4d.private.file.url";$data) //gets file path name again (could be a global) $path:=Get file from pasteboard(1) // first file $ref:=DOM Parse XML source($path;False) If (OK=1) CS_GetDrgDstDay ($1;$date) // day where dropped $elements:=DOM Count XML elements($ref;"event") For ($i;1;$elements) // get each item $xml_Tmp:=DOM Get XML element($ref;"event";$i;$data) $xml_Tmp2:=DOM Get XML element($xml_Tmp;"participant";1;$participant) $xml_Tmp2:=DOM Get XML element($xml_Tmp;"description";1;$description) $xml_Tmp2:=DOM Get XML element($xml_Tmp;"hour";1;$hour) APPEND TO ARRAY(vDDRecDates;$date) APPEND TO ARRAY(vDDRecDesc;$participant+" : "+$description) APPEND TO ARRAY(vDDRecTimes;Time($hour)) End for DOM CLOSE XML($ref) Area_Refresh ($1) // inform CalendarSet End if End case
(AreaRef; DestArea; DestProcessID)
Parameter | Type | Description |
---|---|---|
→ AreaRef | longint | area reference of CalendarSet object on form |
← DestArea | longint | ID of the area the item was dragged to |
← DestProcessID | longint | process ID of the DestArea |
This command is obsolete and should no longer be used. Use CS_GetDrgSrcAreaCS_GetDrgSrcArea in the destination area instead.
(AreaRef; DestDate)
Parameter | Type | Description |
---|---|---|
→ AreaRef | longint | area reference of CalendarSet object on form |
← DestDate | date | day which received the last drop |
If the destination of the last drop was a day (See CS_GetDrgDstTyp), use CS_GetDrgDstDay to determine the destination date. The AreaRef parameter must be the destination (receiver) area of a drop.
DestDate — Date. The day that received the last drop.
// eDestCal object method (On Drop event) C_LONGINT($sourceArea;$sourceProcess) C_INTEGER($actionCode;$type) C_DATE(vDate) CS_GetAction(eDestCal;$actionCode) // determine user action Case of :($actionCode=CS_Action_Drop) // user dropped an event or banner CS_GetDrgSrcArea(eDestCal;$sourceArea;$sourceProcess) If($sourceProcess=Current process) // was the drag from an area in this process? If ($sourceArea=eDestCal ) // if dragged within the same area CS_GetDrgDstTyp(eDestCal;$type) // get the type of data that was destination of the drag If($type=CS_DragDestination_Day) // if dragged onto a day CS_GetDrgDstDay(eDestCal;vDate) // get day’s date End if End if // $sourceProcess=Current process Else // dropped from a different process VARIABLE TO VARIABLE($sourceProcess;vDate;vDate) // send the date to the source process End if End case
(AreaRef; DestType; EventOrBannerIndex)
Parameter | Type | Description |
---|---|---|
→ AreaRef | longint | area reference of CalendarSet object on form |
→ DestType | integer | day, event or banner |
← EventOrBannerIndex | integer | index into corresponding array element |
If the destination of the last drop was an event or banner (see CS_GetDrgDstTyp), use this command to determine which event or banner was the destination. The AreaRef parameter is the destination (receiver) area of a drop.
DestType — Integer, 1 or 2. Values are shown below:
Type | Value | Constant |
---|---|---|
Event | 1 | CS_Type_Event |
Banner | 2 | CS_Type_Banner |
Note: the values above are different from the CS_SetDrgDst and CS_GetDrgDstTyp data types. The constants used are the same as in CS_GetEvtSelect and CS_SetEvtSelect
EventOrBannerIndex — Integer. Index within the array that was passed to CalendarSet via either CS_SetArray or CS_SetBanrArray.
In this example we use the callback method set for the area, to handle receiving a drop from the eSrcCal area in the same process (where banner arrays are prefixed by “src”).
We assume that our area has been set droppable to any data type, using CS_SetDrgDst.
If a banner is dragged from the source CalendarSet area and dropped on a banner in our area, we decided that it should be removed from the source area (for the example).
// eDestCal callback method C_LONGINT($1) // area reference. C_LONGINT($2) // action code C_LONGINT($sourceArea;$sourceProcess) // source area reference (where drag was initiated) ; its process C_INTEGER($type;$sourceIndex;$destIndex) // data type ; array index Case of : ($2=CS_Action_Drop) // drop received CS_GetDrgSrcArea($1;$sourceArea;$sourceProcess) If($sourceArea=eSrcCal) & ($sourceProcess=Currentprocess) // drag from eSrcCal in the same process CS_GetDrgSrcEvt($1;$type;$sourceIndex) // no need for date here, we can use only 3 parameters If($type=CS_Type_Banner) // a banner was dragged CS_GetDrgDstEvt($1;$type;$destIndex) // where was it dropped? If($type=CS_Type_Banner) // drop was on a banner DELETE FROM ARRAY(srcStartDateArray;$sourceIndex) // remove the banner from all arrays DELETE FROM ARRAY(srcEndDateArray;$sourceIndex) DELETE FROM ARRAY(srcTextArray;$sourceIndex) DELETE FROM ARRAY(srcFontArray;$sourceIndex) DELETE FROM ARRAY(srcSizeArray;$sourceIndex) DELETE FROM ARRAY(srcStyleArray;$sourceIndex) DELETE FROM ARRAY(srcForeColorArray;$sourceIndex) DELETE FROM ARRAY(srcBackColorArray;$sourceIndex) Area_Refresh ($sourceArea) // inform CalendarSet End if // drop was on a banner End if // a banner was dragged End if // drag from eSrcCal in the same process End case
(AreaRef;DestDataType)
Parameter | Type | Description |
---|---|---|
→ AreaRef | longint | area reference of the CalendarSet area |
← DestDataType | integer | day, event or banner |
CS_GetDrgDstTyp is used to determine the type of data that was the destination of the last drop. Specifically, the user may drag items to either a day, an event, or a banner. After the drop has completed, CS_GetDrgDstTyp indicates whether the destination of the drag was a day, event, or banner. The AreaRef parameter is the destination (receiver) area of a drop.
DestDataType — Integer, 0 to 3. Indicates what type of data was the destination of the last drop. Values are shown below:
Destination | Value | Constant |
---|---|---|
No destination | 0 | CS_DragDestination_None |
Day | 1 | CS_DragDestination_Day |
Event | 2 | CS_DragDestination_ Event |
Banner | 3 | CS_DragDestination_ Banner |
See the example to CS_GetDrgDstDay.
(AreaRef; SourceArea; SourceProcessID)
Parameter | Type | Description |
---|---|---|
→ AreaRef | longint | area reference of the CalendarSet area |
← SourceArea | longint | ID of the area the item was dragged from |
← SourceProcessID | longint | process ID of the SourceArea |
Use CS_GetDrgSrcArea to determine the source area of the last drop. The AreaRef parameter is the destination (receiver) area of a drop.
This command is called from the destination area’s object/form method (or callback method receiving a action code of CS_Action_Drop in $2).
SourceArea — Long integer. This parameter is the area reference of the area that is the source of the drag.
SourceProcessID — Long integer. This parameter contains the process ID in which the window and source area Reside.
Note: if the SourceProcessID is different from the current process, you will need to use 4D’s process communication commands to exchange values with the process that contains the source area.
See the example to CS_GetDrgDstDay and CS_GetDrgDstEvt.
(AreaRef; DataType; EventIndex; StartDate)
Parameter | Type | Description |
---|---|---|
→ AreaRef | longint | area reference of the CalendarSet area |
← DataType | integer | type of item dragged |
← EventIndex | integer | index into corresponding array element |
← StartDate | date | starting date of the drag |
Use CS_GetDrgSrcEvt to determine whether an event or banner was dragged and which event or banner it was.
The AreaRef parameter is the destination (receiver) area of a drop. This command is called from the destination area’s object / form method (or callback method receiving a action code of CS_Action_Drop in $2).
DataType — Integer, 1 or 2. Values are shown below:
Type | Value | Constant |
---|---|---|
Event | 1 | CS_Type_Event |
Banner | 2 | CS_Type_Banner |
EventOrBannerIndex — Integer. This parameter is an index within the array that was passed to CalendarSet via either CS_SetArray or CS_SetBanrArray.
StartDate — Date. For events, this date will the event’s date passed in CS_SetArray. For banners, this date will be the starting point of the drag, which will be a value between the banner’s start and end dates, inclusively.
See the example to CS_GetDrgDstEvt.
(AreaRef; DestDataType; DstCode1; DstCode2; … ; DstCode10)
Parameter | Type | Description |
---|---|---|
→ AreaRef | longint | area reference of the CalendarSet area |
→ DestDataType | integer | data type to be received |
→ DstCodeN | text | access code(s) to allow drop |
CS_SetDrgDst is used to enable dropping into a CalendarSet destination area, by setting the access codes for the destination of the drop. Please read the section What are access “codes”? for more information.
This command must be called before a drag is initiated (usually in the On load form event processing).
The AreaRef parameter is the destination (receiver) area of a drop.
DestDataType — Integer, 1 to 3. Indicates what type of data can be a destination of a drop:
Destination | Value | Constant |
---|---|---|
Day | 1 | CS_DragDestination_Day |
Event | 2 | CS_DragDestination_Event |
Banner | 3 | CS_DragDestination_Banner |
For the data type specified by DestDataType (either day, event or banner), you must specify at least one DstCode to enable receiving of that type.
DstCode — Text. The DstCode can be any value (other than an empty string), such as “MonthDrag”, “WeekDrag”, “ALPDrag”, etc.
The code should be the same as what is passed into a potential drag partner. The drag partner will be the source/ sender of the drag. The source area can be the same CalendarSet area, a different CalendarSet area, or an AreaList Pro area.
CalendarSet performs the following logic when the drag and drop takes place: the destination codes that were given in DstCode1, DstCode2, etc. are compared to the sender's source codes, previously set with CS_SetDrgSrc.
If any of the codes match, the drop is enabled. In addition, the “_external” special access code must be used as a destination access code in order to make a CalendarSet area droppable from external object. See Allowing the drop from external objects in the callback.
// enable dragging events to events within this area vSelfStr:="CalendarSetArea"+String(eCal) // only allows dragging and dropping within this area CS_SetDrgSrc(eCal;CS_DragSource_EventBanner;vSelfStr) // event data type for source CS_SetDrgDst(eCal;CS_DragDestination_Event;vSelfStr) // event data type for destination // enable dragging from another CalendarSet area (to days or events) or an external object (to days or banners) CS_SetDrgDst(eMonthCal;CS_DragDestination_Day;"WeekToMonth";"_external") // allow dragging into days CS_SetDrgDst(eMonthCal;CS_DragDestination_Event;"WeekToMonth") // allow dragging into events CS_SetDrgDst(eMonthCal;CS_DragDestination_Banner;"_external") // allow dragging into banners
(AreaRef; SourceDataType; SrcCode1; SrcCode2; … ; SrcCode10)
Parameter | Type | Description |
---|---|---|
→ AreaRef | longint | area reference of the CalendarSet area |
→ SourceDataType | integer | type of item dragged |
→ SrcCodeN | text | access code(s) to allow drag |
CS_SetDrgSrc is used to enable dragging out of a CalendarSet source area, by setting the access codes for the source of the drag. Please read the section What are access “codes”? for more information.
This command must be called before a drag is initiated (usually in the On load form event processing).
The AreaRef parameter is the source (sender) area of a drag. SourceDataType — Integer, 2. Currently, only events and banners can be dragged from CalendarSet:
Source | Value | Constant |
---|---|---|
Event or banner | 2 | CS_DragSource_EventBanner |
SrcCode — Text. The SrcCode can be any value (other than an empty string), such as “MonthDrag”, “WeekDrag”, “ALPDrag”, etc.
The code should be the same as what is passed into a potential drag partner. The drag partner will be the destination/receiver of the drag. That destination can be the same CalendarSet area, a different CalendarSet area, or an AreaList Pro area.
CalendarSet performs the following logic when the drag and drop takes place: the source codes that were given in SrcCode1, SrcCode2, etc. are compared to the receiver's destination codes, previously set with CS_SetDrgDst.
If any of the codes match, the drop is enabled. In addition, any source access code will make a CalendarSet area draggable to external object.
See the examples to CS_SetDrgDst.
Note: events and banners, though set by the same SourceDataType value, behave a bit differently. To be draggable, both events and banners must be selectable (and a source access code must be present), but the default values differ: