Quantcast
Channel: Adobe Community : Popular Discussions - After Effects SDK
Viewing all articles
Browse latest Browse all 73444

Drag and drop support in plugin

$
0
0

Hello,

 

I was going through Panelator sample plugin code and saw that they are creating dockable panel using OS Controls. I was just trying to check if i can add code for handling any drag and drop on that panel. So i modified the code in that like this..

 

PanelatorUI_Plat::PanelatorUI_Plat(SPBasicSuite* spbP, AEGP_PanelH panelH,
                            AEGP_PlatformViewRef platformWindowRef,
                            AEGP_PanelFunctions1* outFunctionTable) : PanelatorUI( spbP, panelH, platformWindowRef, outFunctionTable)
{

 

    WindowRef hostWindow;
   
    hostWindow = (WindowRef) HIViewGetWindow(platformWindowRef);
   
    Boolean t = true;
    OSStatus status = SetAutomaticControlDragTrackingEnabledForWindow(hostWindow, t);
    static const EventTypeSpec  kDrawEventSpec[] = {    { kEventClassControl,  kEventControlDraw },
                                                        { kEventClassControl, kEventControlDragEnter },
                                                        { kEventClassControl, kEventControlDragWithin },
                                                        { kEventClassControl, kEventControlDragLeave },
                                                        { kEventClassControl, kEventControlDragReceive }
                                                    };
       OSErr    err = InstallEventHandler (GetControlEventTarget ( i_refH), // 6
                                        NewEventHandlerUPP (S_EventHandler),
                                        5,
                                        kDrawEventSpec,
                                        (void *) this,
                                        NULL);

 

}

 

and in the EventHandler func i'm checking if the eventKind is kEventControlDragEnter. My problem is what ever component i drag on the panel, it is not sending kEventControlDragEnter event to EventHandler func. Can please anyone tell me why it control doesn't come to EventHandler func.


Viewing all articles
Browse latest Browse all 73444

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>