3ds Max C++ API Reference
TexDADMgr Class Reference

#include <TexDADMgr.h>

+ Inheritance diagram for TexDADMgr:

Public Member Functions

 TexDADMgr (ParamDlg *d=NULL)
 
void Init (ParamDlg *d)
 
SClass_ID GetDragType (HWND hwnd, POINT p)
 
CoreExport BOOL OkToDrop (ReferenceTarget *dropThis, HWND hfrom, HWND hto, POINT p, SClass_ID type, BOOL isNew)
 
int SlotOwner ()
 
CoreExport ReferenceTargetGetInstance (HWND hwnd, POINT p, SClass_ID type)
 
CoreExport void Drop (ReferenceTarget *dropThis, HWND hwnd, POINT p, SClass_ID type, DADMgr *srcMgr=NULL, BOOL bSrcClone=FALSE)
 
CoreExport BOOL LetMeHandleLocalDAD ()
 
CoreExport void LocalDragAndDrop (HWND h1, HWND h2, POINT p1, POINT p2)
 
BOOL AutoTooltip ()
 
- Public Member Functions inherited from DADMgr
virtual BOOL IsNew (HWND hwnd, POINT p, SClass_ID type)
 
virtual HCURSOR DropCursor (ReferenceTarget *dropThis, HWND hfrom, HWND hto, POINT p, SClass_ID type, BOOL isNew=FALSE)
 
virtual ReferenceTargetGetDestinationInstance (HWND hwnd, POINT p, SClass_ID type)
 
virtual void SameWinDragAndDrop (HWND h1, POINT p1, POINT p2)
 
virtual BOOL CopyOnly (HWND hwnd, POINT p, SClass_ID type)
 
virtual BOOL AlwaysSendButtonMsgsOnDrop ()
 
virtual INT_PTR Execute (int cmd, ULONG_PTR arg1=0, ULONG_PTR arg2=0, ULONG_PTR arg3=0)
 
virtual BOOL OkToDropInstance (ReferenceTarget *dropThis, HWND hfrom, HWND hto, POINT p, SClass_ID type)
 
- Public Member Functions inherited from InterfaceServer
virtual UtilExport ~InterfaceServer ()
 Destructor. More...
 
virtual UtilExport BaseInterfaceGetInterface (Interface_ID id)
 
template<class InterfaceType >
InterfaceType * GetTypedInterface ()
 

Additional Inherited Members

- Static Public Member Functions inherited from MaxHeapOperators
static UtilExport voidoperator new (size_t size)
 Standard new operator used to allocate objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e)
 Standard new operator used to allocate objects if there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new (size_t size, const char *filename, int line)
 New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate objects that takes the type of memory, filename and line number where the new was called If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e, const char *filename, int line)
 New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new (size_t size, unsigned long flags)
 New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e, unsigned long flags)
 New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size, const char *filename, int line)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate arrays of objects. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e, const char *filename, int line)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size, unsigned long flags)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e, unsigned long flags)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport void operator delete (void *ptr)
 Standard delete operator used to deallocate an object If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e)
 Standard delete operator used to deallocate an object If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete (void *ptr, const char *filename, int line)
 Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, int block_type, const char *filename, int line)
 Delete operator used to deallocate an object that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e, const char *filename, int line)
 Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete (void *ptr, unsigned long flags)
 Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e, unsigned long flags)
 Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr)
 Standard delete operator used to deallocate an array of objects If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e)
 Standard delete operator used to deallocate an array of objects If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, int block_type, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr, unsigned long flags)
 Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e, unsigned long flags)
 Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, void *placement_ptr)
 Placement new operator. More...
 
static UtilExport void operator delete (void *ptr, void *placement_ptr)
 Placement delete operator. More...
 
static UtilExport voidaligned_malloc (size_t size, size_t alignment)
 Allocates memory on a specified alignment boundary. More...
 
static UtilExport voidaligned_realloc (void *ptr, size_t size, size_t alignment)
 Reallocates memory on a specified alignment boundary. More...
 
static UtilExport void aligned_free (void *ptr)
 Frees a block of memory that was allocated with aligned_malloc/aligned_realloc. More...
 

Detailed Description

See also
Class DADMgr, Class ParamDlg.

Description:
Use this class to provide drag and drop functionality for materials sub-Texmaps. It provides implementations of the methods of DADMgr. If this class is used the ParamDlg method FindSubTexFromHWND() must be implemented.

Constructor & Destructor Documentation

◆ TexDADMgr()

TexDADMgr ( ParamDlg d = NULL)
inline
32 { dlg = d;}

Member Function Documentation

◆ Init()

void Init ( ParamDlg d)
inline
33 { dlg = d; }

◆ GetDragType()

SClass_ID GetDragType ( HWND  hwnd,
POINT  p 
)
inlinevirtual
Remarks
This method is called on the item that supports drag and drop to see what (if anything) can be dragged from the point p. This method returns a super class id to indicate the type of item that can be dragged away. If it does not support anything being dragged from the specified point a SClass_ID of 0 should be returned.
Parameters:
HWND hwnd

The source window handle

POINT p

The screen point (relative to the window upper left as 0,0).

Implements DADMgr.

35 { return TEXMAP_CLASS_ID; }
#define TEXMAP_CLASS_ID
Texture maps super-class ID.
Definition: plugapi.h:420

◆ OkToDrop()

CoreExport BOOL OkToDrop ( ReferenceTarget dropThis,
HWND  hfrom,
HWND  hto,
POINT  p,
SClass_ID  type,
BOOL  isNew 
)
virtual
Remarks
This method is called on potential dropee to see if can accept the specified type at the specified point.
Parameters:
ReferenceTarget *dropThis

A pointer to the item to check.

HWND hfrom

The window handle of the source.

HWND hto

The window handle of the destination.

POINT p

The point to check.

SClass_ID type

The super class ID of dropThis.

BOOL isNew = FALSE

TRUE if the item is a new instance; otherwise FALSE.
Returns
TRUE if the specified item can be dropped; otherwise FALSE.

Implements DADMgr.

◆ SlotOwner()

int SlotOwner ( )
inlinevirtual
Remarks
Returns a predefined value to indicate the source of the drag.
Returns
One of the following values:

OWNER_MEDIT_SAMPLE

From a materials editor sample slot.

OWNER_NODE

From a node in the scene.

OWNER_MTL_TEX

From a button in a material or texture.

OWNER_SCENE

From a button in a light, modifier, atmospheric effect, etc.

OWNER_BROWSE_NEW

From the browser in the new category.

OWNER_BROWSE_LIB

From the browser in the library category.

OWNER_BROWSE_MEDIT

From the browser in the materials editor category.

OWNER_BROWSE_SCENE

From the browser in the scene category. OWNER_MATERIAL_EXPLORER

From the material explorer.
Default Implementation:
{ return OWNER_MTL_TEX; }

Reimplemented from DADMgr.

38 { return OWNER_MTL_TEX; }
#define OWNER_MTL_TEX
Definition: custcont.h:59

◆ GetInstance()

CoreExport ReferenceTarget* GetInstance ( HWND  hwnd,
POINT  p,
SClass_ID  type 
)
virtual
Remarks
Return a pointer to the drag source.
Parameters:
HWND hwnd

The source window where the mouse down occurred.

POINT p

The point to drag from (position within hwnd).

SClass_ID type

The super class ID of the item to create.

Implements DADMgr.

◆ Drop()

CoreExport void Drop ( ReferenceTarget dropThis,
HWND  hwnd,
POINT  p,
SClass_ID  type,
DADMgr srcMgr = NULL,
BOOL  bSrcClone = FALSE 
)
virtual
Remarks
This is the method called to actually process the drop operation. This routine is called on the target with the pointer returned by the source's GetInstance(), or possibly a clone of it as the dropThis.
Parameters:
ReferenceTarget *dropThis

A pointer to the item to drop.

HWND hwnd

The destination window handle (where the mouse was released).

POINT p

The destination point (within hwnd).

SClass_ID type

The type of object being dropped – the super class ID of dropThis.

DADMgr* srcMgr

The source DADMgr pointer. NULL by default.

BOOL bSrcClone

TRUE if the dropThis is a clone of the drag source object, FALSE otherwise. FALSE by default

Implements DADMgr.

◆ LetMeHandleLocalDAD()

CoreExport BOOL LetMeHandleLocalDAD ( )
virtual
Remarks
This lets the manager know whether to call LocalDragAndDrop() if the same DADMgr is handling both the source and target windows, or just ignore this condition. Return TRUE if LocalDragAndDrop() should be called; otherwise FALSE.
Default Implementation:
{ return 0; }

Reimplemented from DADMgr.

◆ LocalDragAndDrop()

CoreExport void LocalDragAndDrop ( HWND  h1,
HWND  h2,
POINT  p1,
POINT  p2 
)
virtual
Remarks
This is called if the same DADMgr is handling both the source and target windows, if LetMeHandleLocalDAD() returned TRUE.
Parameters:
HWND h1

The window handle.

HWND h2

The window handle.

POINT p1

The drag source point.

POINT p2

The drop destination point.
Default Implementation:
{}

Reimplemented from DADMgr.

◆ AutoTooltip()

BOOL AutoTooltip ( )
inlinevirtual
Remarks
If this method returns TRUE, then Custom Buttons that use this DAD Manager will automatically support a tooltip that matches the button text. Note that this method will only show a tooltip when the button text is too long and thus exceeds the button size.
Default Implementation:
{ return FALSE; }

Reimplemented from DADMgr.

43 { return TRUE; }