Class IMenuElement

3DS Max Plug-In SDK

Class IMenuElement

See Also: Class IMenuItem, Class IPoint2, Class Box2

class IMenuElement

Description:

This class is available in release 4.0 and later only.

This abstract class represents an interface for any menu element. Methods that are marked as internal should not be used.

Methods:

public:

Prototype:

virtual void SetOrigin(const IPoint2& origin, OriginLocation location) = 0;

Remarks:

This method is used internally.

This method allows you to set the element’s origin and origin location.

Parameters:

IPoint2& origin

The x, y coordinates of the origin.

OriginLocation location

The origin location, either one of; UPPER_LEFT, LOWER_LEFT, LOWER_RIGHT, or UPPER_RIGHT.

Prototype:

virtual const IPoint2& GetOrigin() const = 0;

Remarks:

This method is used internally.

This method returns the x, y coordinates of the element’s origin.

Prototype:

virtual void SetVisible(bool visible) = 0;

Remarks:

This method allows you to set the visibility of the element.

Parameters:

bool visible

TRUE for visible, FALSE for invisible.

Prototype:

virtual bool GetVisible() = 0;

Remarks:

This method returns the visibility of the element. TRUE if the element is visible, otherwise FALSE.

Prototype:

virtual void SetTitle(const TCHAR *customTitle) = 0;

Remarks:

This method allows you to set the item’s title.

Parameters:

TCHAR *customTitle

The title string.

Prototype:

virtual const TSTR& GetTitle() = 0;

Remarks:

This method returns the item’s title string.

Prototype:

virtual void SetEnabled(bool enabled) = 0;

Remarks:

This method allows you to enable and disable the element.

Parameters:

bool enabled

TRUE to enable, FALSE to disable.

Prototype:

virtual bool GetEnabled() = 0;

Remarks:

This method returns the state of the element. TRUE if it’s enabled, FALSE if it’s disabled.

Prototype:

virtual const IPoint2& GetSize() = 0;

Remarks:

This method is used internally.

This method returns the element’s size in the menu’s coordinate space.

Prototype:

virtual const Box2& GetRect() = 0;

Remarks:

This method is used internally.

This method returns the element’s rectangle size in the menu’s coordinate space.

Prototype:

virtual bool IsInRect(const IPoint2& point) = 0;

Remarks:

This method is used internally.

This method determines if a specific point is inside the element’s rectangle.

Parameters:

IPoint2& point

The point to test.

Return Value:

TRUE if the point is inside the rectangle, otherwise FALSE.