ICUIFrame Class Reference

ICUIFrame Class Referenceabstract

#include <custcont.h>

Class Description

See also
Class CUIFrameMgr, Class CUIFrameMsgHandler, Class ICustToolbar, Class ICustomControl.

Description:
This class provides access to an individual CUI Frame (the name given to the windows that contain toolbars, menus, the command panel, etc.)

To create a floating tool palette, for example, you create a CUIFrame, create a toolbar, and then attach the two (similar to creating a custom edit field, and custom spinner, then attaching the two). This is done using the method ICustToolbar::LinkToCUIFrame().

When a Toolbar is part of a CUI frame it's called a Tool Palette. Tool Palettes can either float or dock (whereas a Toolbar must be placed by the developer in a dialog using the resource editor).
+ Inheritance diagram for ICUIFrame:

Public Member Functions

virtual void SetPosType (DWORD t)=0
 
virtual DWORD GetPosType ()=0
 
virtual void SetPosRank (int rank, int subrank=0)=0
 
virtual int GetPosRank ()=0
 
virtual int GetPosSubrank ()=0
 
virtual BOOL IsFloating ()=0
 
virtual void Hide (BOOL b)=0
 
virtual BOOL IsHidden ()=0
 
virtual void SetCurPosition (DWORD pos)=0
 
virtual DWORD GetCurPosition ()=0
 
virtual void SetContentType (DWORD t)=0
 
virtual DWORD GetContentType ()=0
 
virtual void SetContentHandle (HWND hContent)=0
 
virtual HWND GetContentHandle ()=0
 
virtual void SetTabbedToolbar (BOOL b)=0
 
virtual BOOL GetTabbedToolbar ()=0
 
virtual void AddToolbarTab (HWND hTBar, CUIFrameMsgHandler *msgHandler, const MCHAR *name, int pos=-1)=0
 
virtual void DeleteToolbarTab (int pos)=0
 
virtual int GetToolbarCount ()=0
 
virtual HWND GetToolbarHWnd (int pos)=0
 
virtual const MCHARGetTabName (int pos)=0
 
virtual void SetCurrentTab (int pos)=0
 
virtual int GetCurrentTab ()=0
 
virtual int GetSize (int sizeType, int dir, int orient)=0
 
virtual BOOL InstallMsgHandler (CUIFrameMsgHandler *msgHandler)=0
 
virtual void SetName (const MCHAR *name)=0
 
virtual const MCHARGetName ()=0
 
virtual BOOL SetMenuDisplay (int md)=0
 
virtual int GetMenuDisplay ()=0
 
virtual void SetSystemWindow (BOOL b)=0
 
virtual BOOL GetSystemWindow ()=0
 
virtual BOOL ReadConfig (const MCHAR *cfg, int startup=FALSE)=0
 
virtual void WriteConfig (const MCHAR *cfg)=0
 
- Public Member Functions inherited from ICustomControl
virtual HWND GetHwnd ()=0
 
virtual void Enable (BOOL onOff=TRUE)=0
 
virtual void Disable ()=0
 
virtual BOOL IsEnabled ()=0
 
virtual void Enable2 (BOOL onOff=TRUE)=0
 
virtual INT_PTR Execute (int cmd, ULONG_PTR arg1=0, ULONG_PTR arg2=0, ULONG_PTR arg3=0)
 
virtual void SetTooltip (bool bEnable, const MCHAR *text)=0
 Sets a tooltip for the custom control. More...
 
CoreExport void UpdateEnableState (Animatable *anim, int subNum)
 Helper function to disable or enable this UI control based on whether the Animatable associated with it is keyframable or not (locked parameter or scripted parameters are not keyframable). More...
 
- Public Member Functions inherited from InterfaceServer
virtual UtilExport ~InterfaceServer ()
 Destructor. More...
 
virtual UtilExport BaseInterfaceGetInterface (Interface_ID id)
 

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

Member Function Documentation

virtual void SetPosType ( DWORD  t)
pure virtual
Remarks
Sets the position type. This determines the possible locations for the frame.
Parameters
tThe position to set. See CUI Frame Position Types.
virtual DWORD GetPosType ( )
pure virtual
Remarks
Returns a DWORD which describes the position options for this CUI Frame. See CUI Frame Position Types.
virtual void SetPosRank ( int  rank,
int  subrank = 0 
)
pure virtual
Remarks
This method is for internal use only. Developers must not assign the rank and subrank as these are computed internally. Developers should create their toolbars 'floating'. Then when a user docks the toolbar it will be docked automatically when 3ds Max starts up the next time.
virtual int GetPosRank ( )
pure virtual
Remarks
Returns the position rank. Consider three docked toolbars, one alone on the top line, and two side by side on the line below. The top toolbar would have a rank of 0 (and a subrank of 0). The toolbar on the left in the line below would have a rank of 1 and a subrank of 0. The toolbar beside it to the right would have a rank of 1 and a subrank of 1.
virtual int GetPosSubrank ( )
pure virtual
Remarks
Returns the position subrank. See GetPosRank() above.
virtual BOOL IsFloating ( )
pure virtual
Remarks
Returns TRUE if the frame is floating (not docked); otherwise FALSE.
virtual void Hide ( BOOL  b)
pure virtual
Remarks
Sets the frame to hidden or not. Note that if a developer is doing something like showing their toolbars at BeginEditParams() and hiding them at EndEditParms() then this method can be used. In such a case, if the toolbar is docked then RecalcLayout() needs to be called to update the layout. If the toolbars are floating then RecalcLayout() does not need to be called.
Parameters
bTRUE for hidden; FALSE for not hidden.
virtual BOOL IsHidden ( )
pure virtual
Remarks
Returns TRUE if the frame is hidden; FALSE if visible.
virtual void SetCurPosition ( DWORD  pos)
pure virtual
Remarks
This method is for internal use only.
virtual DWORD GetCurPosition ( )
pure virtual
Remarks
Returns the current position of the frame. One of the following values.

CUI_TOP_DOCK

Docked at the top.

CUI_BOTTOM_DOCK

Docked at the bottom.

CUI_LEFT_DOCK

Docked on the left.

CUI_RIGHT_DOCK

Docked on the right.

CUI_FLOATING

The frame is floating (not docked).
virtual void SetContentType ( DWORD  t)
pure virtual
Remarks
Sets the frame contents type. This specifies if this frame holds a toolbar, menu or a floating panel.
Parameters
tOne or more of the following flags:

CUI_TOOLBAR
Set if frame holds toolbars and / or tool palettes.

CUI_MENU
This is used internally to set if the frame holds a menu. Note: Developers should not create their own menus. 3ds Max assumes that only one menu exists.

CUI_HWND
Set if frame hold a generic window handle. The command panel (which can be floated) is an example of a generic window.
virtual DWORD GetContentType ( )
pure virtual
Remarks
Returns a value which indicates the frame contents type. One of the following flags:

CUI_TOOLBAR

Set if frame holds toolbars and / or tool palettes.

CUI_MENU

Set if the frame holds a menu.

CUI_HWND

Set if frame hold a generic window handle.
virtual void SetContentHandle ( HWND  hContent)
pure virtual
Remarks
Sets the content handle. This is the window handle for the toolbar, or menu handle for a menu. Developers typically create Tool Palettes by linking a toolbar to a CUIFrame using ICustToolbar::LinkToCUIFrame() and do not need to call this method as it's done automatically.
Parameters
hContentThe handle to set.
virtual HWND GetContentHandle ( )
pure virtual
Remarks
Returns the content handle.
virtual void SetTabbedToolbar ( BOOL  b)
pure virtual
Remarks
Sets if this frame represents a tabbed toolbar. A tabbed toolbar may have individual tabs added and deleted.
Parameters
bTRUE for tabbed; FALSE for not tabbed.
virtual BOOL GetTabbedToolbar ( )
pure virtual
Remarks
Returns TRUE if this frame is a tabbed toolbar; otherwise FALSE.
virtual void AddToolbarTab ( HWND  hTBar,
CUIFrameMsgHandler msgHandler,
const MCHAR name,
int  pos = -1 
)
pure virtual
Remarks
Adds the toolbar tab whose window handle is passed to the list of tabs maintained by this class.
Parameters
hTBarThe window handle of the toolbar tab to add.
msgHandlerThe message handler for the tab or NULL if not used.
nameThe name for the tab.
posThe position for the tab. This is the zero based index where 0 is at left edge of those in the frame and the max value is GetToolbarCount()-1. A value of -1 adds the tab to the end of the list of tabs. Also, for example, if you specify a value of 0 for an existing tabbed toolbar, the new tab is inserted at position 0 and the others are moved to the right.
virtual void DeleteToolbarTab ( int  pos)
pure virtual
Remarks
Deletes the specified toolbar tab.
Parameters
posSpecifies the position of the tab to delete. This is the zero based index where 0 is at left edge of those in the frame and the max value is GetToolbarCount()-1.
virtual int GetToolbarCount ( )
pure virtual
Remarks
Returns the number of toolbar tabs in this frame.
virtual HWND GetToolbarHWnd ( int  pos)
pure virtual
Remarks
Returns the window handle of the toolbar tab whose position is passed.
Parameters
posSpecifies the position of the tab. This is the zero based index where 0 is at left edge of those in the frame and the max value is GetToolbarCount()-1.
virtual const MCHAR* GetTabName ( int  pos)
pure virtual
Remarks
Returns the name of the specified toolbar tab.
Parameters
posSpecifies the position of the tab. This is the zero based index where 0 is at left edge of those in the frame and the max value is GetToolbarCount()-1.
virtual void SetCurrentTab ( int  pos)
pure virtual
Remarks
Sets the currently active tab.
Parameters
posSpecifies the position of the tab. This is the zero based index where 0 is at left edge of those in the frame and the max value is GetToolbarCount()-1.
virtual int GetCurrentTab ( )
pure virtual
Remarks
Returns the position of the currently active tab. This is the zero based index where 0 is at left edge of those in the frame and the max value is GetToolbarCount()-1.
virtual int GetSize ( int  sizeType,
int  dir,
int  orient 
)
pure virtual
Remarks
Returns the size of this frame for the specified size type, direction (width or height) and orientation.

Note: If this frame has a custom message handler (a CUIFrameMsgHandler object, it's ProcessMessage() method is called passing CUI_POSDATA_MSG which is used to determine the size.
Parameters
sizeTypeThe size type. See CUI Frame Size Types.
dirThe direction of the frame.

CUI_HORIZ: Width.

CUI_VERT: Height.
orientThe orientation. See CUI Frame Orientations.
virtual BOOL InstallMsgHandler ( CUIFrameMsgHandler msgHandler)
pure virtual
Remarks
Installs a custom message processing routine.
Parameters
msgHandlerPoints to the handler to install. See Class CUIFrameMsgHandler for details.
Returns
TRUE on success; otherwise FALSE.
virtual void SetName ( const MCHAR name)
pure virtual
Remarks
Sets the name for the frame. This name shows up as a tooltip and also on the window border if the frame is floated. Note that the name is also used to store position information in the CUI file. Therefore developers must use a name and not simply set it to NULL.
Parameters
nameThe name to set.
virtual const MCHAR* GetName ( )
pure virtual
Remarks
Returns the name of the frame.
virtual BOOL SetMenuDisplay ( int  md)
pure virtual
Remarks
Sets the menu display state.
Parameters
mdOne of the following values:

CUI_MENU_HIDE
CUI_MENU_SHOW_ENABLED
CUI_MENU_SHOW_DISABLED
virtual int GetMenuDisplay ( )
pure virtual
Remarks
Returns the state of the menu display. One of the following values:

CUI_MENU_HIDE
CUI_MENU_SHOW_ENABLED
CUI_MENU_SHOW_DISABLED
virtual void SetSystemWindow ( BOOL  b)
pure virtual
Remarks
System windows are those that come up automatically inside 3ds Max. So command panel, the main toolbar, the tab panel and the main menu are all system windows. It is not therefore appropriate for developers to declare themselves as system windows and this method should not be called passing TRUE.
Parameters
bTRUE to set as a system window; otherwise FALSE.
virtual BOOL GetSystemWindow ( )
pure virtual
Remarks
Returns TRUE if this CUIFrame is a system window; otherwise FALSE. See SetSystemWindow() above.
virtual BOOL ReadConfig ( const MCHAR cfg,
int  startup = FALSE 
)
pure virtual
Remarks
This method is for internal use only.
virtual void WriteConfig ( const MCHAR cfg)
pure virtual
Remarks
This method is for internal use only.