CUIFrameMsgHandler Class Reference

CUIFrameMsgHandler Class Reference

#include <custcont.h>

Class Description

See also
Class ICUIFrame, Class CUIFrameMgr, Class CUIPosData, Class ICustomControl.

Description:
This class provides a way for messages received by a CUIFrame to be processed in a context-specific fashion.

Since the CUI Frame is just a window, it needs a window proc. There is one built into the CUI system, but it may need additional information that is specific to how the frame is being used. For example, in 3ds Max the command panel can't be resized horizontally and the default window proc can't manage this.

For such situations, the application must install a CUIFrameMsgHandler object. You establish that this is the handler for the frame using the method ICUIFrame::InstallMsgHandler(CUIFrameMsgHandler *msgHandler).

These message handlers have one significant class method: ProcessMessage(). If ProcessMessage() returns TRUE, then the CUI system assumes that the message is completely handled. If it returns FALSE, then the standard CUI processing takes place. (Note that the message handler may still return FALSE, even if it does some processing...).

There is a special message (CUI_POSDATA_MSG) that is sent by the CUI system to the message handler to get information on window size constraints, etc. An example of processing this message is shown below. In this case editPosData is a static instance of CUIPosData. That object has GetWidth() and GetHeight() methods which return the proper width and height size for various orientations. See Class CUIPosData for details.

CUIPosData **cpd = (CUIPosData **)lParam;
cpd[0] = &editPosData;
}
return TRUE;
+ Inheritance diagram for CUIFrameMsgHandler:

Public Member Functions

virtual ~CUIFrameMsgHandler ()
 
virtual int ProcessMessage (UINT message, WPARAM wParam, LPARAM lParam)
 

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...
 

Constructor & Destructor Documentation

virtual ~CUIFrameMsgHandler ( )
inlinevirtual
Remarks
Destructor.
770 {;}

Member Function Documentation

virtual int ProcessMessage ( UINT  message,
WPARAM  wParam,
LPARAM  lParam 
)
inlinevirtual
Remarks
This method is called to handle any processing not done by the default CUI window proc.

This method should return TRUE if the message is handled and FALSE if not. If FALSE is returned (or no handler is defined), then the CUIFrame simply passes WM_COMMAND messages on to its parent. Window position messages are passed from the CUIFrame to the HWND of the 'content' (either a toolbar or menu). Other messages are passed on to the default window proc.

Note: Developers should not return TRUE for the entire ProcessMessage routine, since if this is done, the right-click menu functionality will not work (e.g. docking, floating, move-to-shelf, customize, etc.).

Also Note: Developers should not use IDs that may conflict with the ones used by the default processing provide by 3ds Max. The IDs which should be avoided are in the 40000, 47000, and 61000 range. For instance the following IDs are all invalid since they are in those ranges: 40005, 47900,
  1. The reason this is a problem is that if you return FALSE after processing a particular ID, then 3ds Max will go ahead and process that ID also. And if the ID matches one already in 3ds Max, an unintended function may get called.
Parameters
messageSpecifies the message.
wParamSpecifies additional message information. The contents of this parameter depend on the value of the message parameter.
lParamSpecifies additional message information. The contents of this parameter depend on the value of the message parameter.
Default Implementation:
{ return FALSE; }
797 { return FALSE; }