Public Member Functions | Public Attributes

MSAutoMParamDlg Class Reference

Search for all occurrences

#include <mxsPlugin.h>

Inheritance diagram for MSAutoMParamDlg:
Inheritance graph
[legend]

List of all members.

Public Member Functions

  MSAutoMParamDlg (HWND hMedit, IMtlParams *i, ReferenceTarget *mtl, MSPlugin *plugin, Rollout *ro)
  ~MSAutoMParamDlg ()
Class_ID  ClassID ()
ReferenceTarget GetThing ()
void  SetThing (ReferenceTarget *m)
void  DeleteThis ()
void  SetTime (TimeValue t)
void  ReloadDialog ()
void  ActivateDlg (BOOL onOff)
int  FindSubTexFromHWND (HWND hw)
int  FindSubMtlFromHWND (HWND hw)
void  InvalidateUI ()
void  MtlChanged ()
int  NumDlgs ()
void  AddDlg (ParamDlg *dlg)
ParamDlg GetDlg (int i)
void  SetDlg (int i, ParamDlg *dlg)
void  DeleteDlg (ParamDlg *dlg)
IParamMap2 GetMap ()

Public Attributes

Tab< ParamDlg * >  secondaryDlgs
ParamDlg delegateDlg
MSPlugin plugin
Rollout *  ro
ReferenceTarget mtl
IMtlParams ip
TexDADMgr  texDadMgr
MtlDADMgr  mtlDadMgr
HWND  hwmedit

Constructor & Destructor Documentation

MSAutoMParamDlg ( HWND  hMedit,
IMtlParams i,
ReferenceTarget mtl,
MSPlugin plugin,
Rollout *  ro 
)

Member Function Documentation

Class_ID ClassID ( ) [inline, virtual]
Remarks:
Returns the unique Class_ID of the plug-in this dialog manages. See Class Class_ID.

Implements ParamDlg.

{ return mtl->ClassID(); }
ReferenceTarget* GetThing ( ) [inline, virtual]
Remarks:
This method returns the current material or texture being edited.

Implements ParamDlg.

{ return mtl; }
void SetThing ( ReferenceTarget m ) [virtual]
Remarks:
This sets the current material or texture being edited to the material or texture passed.
Parameters:
ReferenceTarget *m

The material or texture to set as current.

Implements ParamDlg.

void DeleteThis ( ) [virtual]
Remarks:
This method is called by the system to delete an instance of this class. A developer must use the same memory manager to delete the item as they did to allocate it (in MtlBase::CreateParamDlg()). For example if a developer used the new operator to allocate the memory, this method would be implemented as { delete this; }

Implements ParamDlg.

void SetTime ( TimeValue  t ) [virtual]
Remarks:
This method is called when the current time has changed. This gives the developer an opportunity to update any user interface data that may need adjusting due to the change in time.
Parameters:
TimeValue t

The new current time.

Implements ParamDlg.

void ReloadDialog ( ) [virtual]
Remarks:
This method should stuff values into all the parameter dialog's controls, edit fields etc. In fact this method is now only called after doing a "Reset". It is also useful inside the material/map when a NotifyRefChanged() is processed it may need to be called.

Implements ParamDlg.

void ActivateDlg ( BOOL  onOff ) [virtual]
Remarks:
This method is called when the dialog box becomes active or inactive. Currently this is used when working with color swatch custom controls. Color swatches need to know when the dialog box becomes active or inactive because they change their method of drawing themselves. When the dialog is active, color swatches are drawn in pure color (this requires a color register in the palette). When the dialog becomes inactive the color swatches are drawn using dithered painting. This is needed because there are only 8 available color registers.

A method of the color swatch control is called to indicate if it is in an active or inactive dialog. See the sample code below. Also see Class IColorSwatch.
Parameters:
BOOL onOff

TRUE if the dialog is active; otherwise FALSE.
Sample Code:
            void NoiseDlg::ActivateDlg(BOOL onOff)
            {
                for (int i=0; i<NCOLS; i++)
                    cs[i]->Activate(onOff);
            }

Implements ParamDlg.

int FindSubTexFromHWND ( HWND  hwnd ) [virtual]
Remarks:
This method needs to be implemented if the plug-in texmap is using a TexDADMgr. It should return the index of the sub-texmap corresponding to the window whose handle is passed. If the handle is not valid return -1.
Parameters:
HWND hwnd

The window handle to check.
Default Implementation:
{ return -1;}
Sample Code:
            int CellTexParamDlg::FindSubTexFromHWND(HWND hw)
            {
                if (hw==GetDlgItem(pmap->GetHWnd(),IDC_CELLTEX_CELLCOLOR_MAP))
                    return 0;
                if (hw==GetDlgItem(pmap->GetHWnd(),IDC_CELLTEX_DIVCOL1_MAP))
                    return 1;
                if (hw==GetDlgItem(pmap->GetHWnd(),IDC_CELLTEX_DIVCOL2_MAP))
                    return 2;
                return -1;
            }

Reimplemented from ParamDlg.

int FindSubMtlFromHWND ( HWND  hwnd ) [virtual]
Remarks:
This method needs to be implemented if the plug-in material is using a MtlDADMgr. It should return the index of the sub-map corresponding to the window whose handle is passed. If the handle is not valid return -1.
Parameters:
HWND hwnd

The window handle to check.
Default Implementation:
{ return -1;}

Reimplemented from ParamDlg.

void InvalidateUI ( ) [inline, virtual]
Remarks:
This method causes the user interface controls to be re-drawn.

Implements IAutoMParamDlg.

{ ReloadDialog(); }
void MtlChanged ( ) [inline, virtual]
Remarks:
This method may be called to causes the viewports to be redrawn. It should be called when any parameter that affects the look of the material in the viewport has been altered. If the material is not on a visible node in a shaded view, nothing will happen. This method should not be called as a spinner is being dragged, but only upon release of the mouse button.

Implements IAutoMParamDlg.

{ ip->MtlChanged(); }
int NumDlgs ( ) [inline, virtual]
Remarks:
Returns the number of secondary dialogs.

Implements IAutoMParamDlg.

{ return secondaryDlgs.Count(); }
void AddDlg ( ParamDlg dlg ) [virtual]
Remarks:
Adds the specified dialog as another secondary dialog.
Parameters:
ParamDlg* dlg

Points to the parameter dialog to add.

Implements IAutoMParamDlg.

ParamDlg* GetDlg ( int  i ) [virtual]
Remarks:
Returns a pointer to the 'i-th' secondary dialog.
Parameters:
int i

The zero based index of the dialog to return.

Implements IAutoMParamDlg.

void SetDlg ( int  i,
ParamDlg dlg 
) [virtual]
Remarks:
Sets the 'i-th' dialog to the one passed.
Parameters:
int i

The zero based index of the dialog to set.

ParamDlg* dlg

Points to the parameter dialog to set.

Implements IAutoMParamDlg.

void DeleteDlg ( ParamDlg dlg ) [virtual]
Remarks:
This method is used for deleting secondary dialogs from a master IAutoMParamDlg. Use this along with AddDlg() if you are dynamically changing the set of rollups for the plugin, so that the P_AUTO_UI system can correctly manage all current secondary rollups.
Parameters:
ParamDlg* dlg

Points to the ParamDlg to delete.

Implements IAutoMParamDlg.

IParamMap2* GetMap ( ) [inline, virtual]
Remarks:
Returns a pointer to the parameter map2 of this primary (master) dialog.

Implements IAutoMParamDlg.

{ return NULL; }

Member Data Documentation

Rollout* ro
HWND hwmedit

MSAutoMParamDlg MSAutoMParamDlg MSAutoMParamDlg MSAutoMParamDlg MSAutoMParamDlg MSAutoMParamDlg MSAutoMParamDlg MSAutoMParamDlg MSAutoMParamDlg MSAutoMParamDlg
MSAutoMParamDlg MSAutoMParamDlg MSAutoMParamDlg MSAutoMParamDlg MSAutoMParamDlg MSAutoMParamDlg MSAutoMParamDlg MSAutoMParamDlg MSAutoMParamDlg MSAutoMParamDlg