Class ICustStatusEdit

3DS Max Plug-In SDK

Class ICustStatusEdit

See Also: Class ICustomControl.

class ICustStatusEdit : public ICustomControl

Description:

This class is available in release 3.0 and later only.

This control mimics the edit control as well as a status control. It may be set to 'read-only' so the user can read but cannot edit the displayed string.

The value to use in the Class field of the Custom Control Properties dialog is: CustStatusEdit

Function:

ICustStatusEdit *GetICustStatusEdit(HWND hCtrl);

Remarks:

This global function is available in release 3.0 and later only.

Used to initalize and return a pointer to the control.

Parameters:

HWND hCtrl

The window handle of the control.

Function:

void ReleaseICustStatusEdit(ICustStatusEdit *ice);

Remarks:

This global function is available in release 3.0 and later only.

Used to release the control when finished.

Parameters:

ICustStatusEdit *ice

Points to the control to release.

Methods:

public:

Prototype:

virtual void GetText(TCHAR *text, int ct)=0;

Remarks:

Retrieves the text entered into the control.

Parameters:

TCHAR *text

Storage for the text to retrieve.

int ct

Specifies the maximum length of the string returned.

Prototype:

virtual void SetText(TCHAR *text)=0;

Remarks:

This method places the text into the control for editing.

Parameters:

TCHAR *text

The text to place in the control.

Prototype:

virtual void SetText(int i)=0;

Remarks:

This method allows you to pass in an integer value to the control. The integer is converted to a string and displayed in the control.

Parameters:

int i

This value is converted to a string and displayed in the control.

Prototype:

virtual void SetText(float f, int precision=3)=0;

Remarks:

This method allows you to pass in a floating point value to the control. The float is converted to a string and displayed in the control.

Parameters:

float f

This value is converted to a string and displayed in the control.

int precision=3

The precision argument is simply the number of decimal places that get represented in the string that appears in the edit field. So if the arguments were (1.0f/3.0f, 3) then the string "0.333" would appear in the edit field.

Prototype:

virtual int GetInt(BOOL *valid=NULL)=0;

Remarks:

This method parses and returns an integer value from the control.

Parameters:

BOOL *valid=NULL

This pointer, if passed, is set to TRUE if the input is 'valid'; otherwise FALSE. FALSE indicates that something caused the parsing of the input to terminate improperly. An example is a non-numeric character. So for example, if the user entered "123jkfksdf" into the field the valid pointer would be set to FALSE.

Prototype:

virtual float GetFloat(BOOL *valid=NULL)=0;

Remarks:

This method parses and returns a floating point value from the control.

Parameters:

BOOL *valid=NULL

This pointer, if passed, is set to TRUE if the input is 'valid'; otherwise FALSE. FALSE indicates that something caused the parsing of the input to terminate improperly. An example is a non-numeric character. So for example, if the user entered "123jkfksdf" into the field this pointer would be set to FALSE.

Prototype:

virtual void SetLeading(int lead)=0;

Remarks:

A developer doesn't normally need to call this method. This offsets the text vertically in the edit control.

Parameters:

int lead

This parameter specifies the number of pixels to offset.

Prototype:

virtual void WantReturn(BOOL yesNo)=0;

Remarks:

This method allows custom handling of the RETURN key. If you pass TRUE to this method an EN_CHANGE message will be sent to the control when the RETURN key is pressed. The EN_CHANGE message is sent when the user has taken any action that may have altered text in an edit control so developer need to also call GotReturn() (documented below) to see if it was indeed a RETURN keypress.

Parameters:

BOOL yesNo

If TRUE, then when the user presses the RETURN key in that control, the edit field will send an EN_CHANGE message to the owner, and calling GotReturn() will return TRUE.

Prototype:

virtual BOOL GotReturn()=0;

Remarks:

This method should be called on receipt of an EN_CHANGE message. It return TRUE if pressing the RETURN key generated the message; otherwise FALSE.

Prototype:

virtual void GiveFocus()=0;

Remarks:

Calling this method gives the control the focus to receive input.

Prototype:

virtual BOOL HasFocus()=0;

Remarks:

Returns TRUE if the control has the focus to receive input; otherwise FALSE.

Prototype:

virtual void WantDlgNextCtl(BOOL yesNo)=0;

Remarks:

Determines whether the TAB key may be used to jump to the next control in the tab sequence.

Parameters:

BOOL yesNo

TRUE to enable the TAB key to move to the next control; FALSE to disable the TAB key from moving the focus.

Prototype:

virtual void SetNotifyOnKillFocus(BOOL onOff)=0;

Remarks:

Normally when a user exits an edit filed the notification WM_CUSTEDIT_ENTER is sent. Many plug-ins key off this message to finalize the input of values. For instance, if the user is entering a value into an edit field and they hit the TAB key to leave the field the value should be entered. Normally this is the desired behavior. However, as a special case condition, if a developer does not want to update the value, this method may be called so the WM_CUSTEDIT_ENTER notification won't be sent when the edit control loses focus.

Parameters:

BOOL onOff

TRUE to turn on; FALSE to turn off.

Prototype:

virtual void SetBold(BOOL onOff)=0;

Remarks:

Sets the text font in the edit control to display in a bold format or normal.

Parameters:

BOOL onOff

TRUE to turn bolding on; FALSE to turn off.

Prototype:

virtual void SetReadOnly(BOOL onOff)=0;

Remarks:

Sets if the control is 'read-only'. That is, the string is displayed but cannot be edited.

Parameters:

BOOL onOff

TRUE for read-only; FALSE to allow editing.