# View Class Reference

Related Scripting Object: View

The View object represents an instance of a view in Softimage. More...

`#include <xsi_view.h>`

Inheritance diagram for View:

List of all members.

## Public Member Functions
| View ()
| ~View ()
| View (const CRef &in_ref)
| View (const View &in_obj)
bool | IsA (siClassID in_ClassID) const
siClassID | GetClassID () const
View & | operator= (const View &in_obj)
View & | operator= (const CRef &in_ref)
CRefArray | GetViews () const
siViewState | GetState () const
CStatus | PutState (siViewState in_lState)
bool | GetVisible () const
CStatus | PutVisible (bool in_bFlag)
bool | GetFloating () const
CValue | GetAttributeValue (const CString &in_strParamName) const
CStatus | PutAttributeValue (const CString &in_strParamName, const CValue &in_value)
CStatus | BeginEdit ()
CStatus | EndEdit ()
CStatus | Move (LONG in_x, LONG in_y)
CStatus | Resize (LONG in_w, LONG in_h)

## Detailed Description

The View object represents an instance of a view in Softimage.

Views are accessible from Layout::GetViews or View::GetViews if the view is a relational view. View objects are created with Layout::CreateView.

With view objects, you can:

- Change the view state such as closed and minimized state.
- Change the view position and size.
- Hide/unhide the view.
- Access to specific view attributes such as the Explorer scope and NetView URL.
- Edit view attributes in bulk mode to avoid the UI to flicker.
- Iterate over the sub views of a relational view.

Since:
  4.0

Example:
  This example restores and cascades all floating views except the script editor.

              Application app;

              // Creates some sample views
              Layout layout = app.GetDesktop().GetActiveLayout();

              View v;
              layout.CreateView( L"Explorer", L"My Explorer", v );
              layout.CreateView( L"Browser", L"My Browser", v );
              layout.CreateView( L"NetView", L"My NetView", v );

              // position for the first view to cascade
              LONG px = 50;
              LONG py = 20;

              // delta between each view
              LONG dx = 20;
              LONG dy = 20;

              CRefArray views = layout.GetViews();
              for ( LONG i=0; i<views.GetCount() ; i++)
              {
                  View vw = views[i];
                  if( vw.GetFloating() && vw.GetName() != L"script_editor" )
                  {
                      vw.Move( px, py );
                      px += dx;
                      py += dy;
                      vw.PutState( siNormal ); // put view at the top so far
                  }
              }

## Constructor & Destructor Documentation

View | ( |  | ) |

Default constructor.

~View | ( |  | ) |

Default destructor.

View | ( | const CRef & | in_ref | ) |

Constructor.

Parameters:

  | in_ref | constant reference object.

View | ( | const View & | in_obj | ) |

Copy constructor.

Parameters:

  | in_obj | constant class object.

## Member Function Documentation

bool IsA | ( | siClassID | in_ClassID | ) | const`[virtual]`

Returns true if a given class type is compatible with this API class.

Parameters:

  | in_ClassID | class type.

Returns:
  true if the class is compatible, false otherwise.

Reimplemented from UIPersistable.

siClassID GetClassID | ( |  | ) | const`[virtual]`

Returns the type of the API class.

Returns:
  The class type.

Reimplemented from UIPersistable.

View& operator= | ( | const View & | in_obj | ) |

Creates an object from another object. The newly created object is set to empty if the input object is not compatible.

Parameters:

  | in_obj | constant class object.

Returns:
  The new View object.

View& operator= | ( | const CRef & | in_ref | ) |

Creates an object from a reference object. The newly created object is set to empty if the input reference object is not compatible.

Parameters:

  | in_ref | constant class object.

Returns:
  The new View object.

Reimplemented from UIPersistable.

CRefArray GetViews | ( |  | ) | const

Returns an array of View objects defined for this View. A View can have sub views if it was defined as a relational view.

Returns:
  Array of View objects.

siViewState GetState | ( |  | ) | const

Returns the state of a view. View states are mutually exclusive.

Returns:
  The View state value.

CStatus PutState | ( | siViewState | in_lState | ) |

Sets the state of a view. View states are mutually exclusive.

Parameters:

  | in_lState | View state value.

Returns:
  CStatus::OK success

  CStatus::Fail failure

bool GetVisible | ( |  | ) | const

Returns true if the view is visible or false otherwise.

Returns:
  true if the view is visible; false otherwise.

CStatus PutVisible | ( | bool | in_bFlag | ) |

Make the view visible if the flag is true or hidden otherwise.

Parameters:

  | in_bFlag | Visible flag.

Returns:
  CStatus::OK success

  CStatus::Fail failure

bool GetFloating | ( |  | ) | const

Returns true if the view is floating or false if the view is embedded inside another one.

Returns:
  true if the view is floating; false if embedded inside another one.

CValue GetAttributeValue | ( | const CString & | in_strParamName | ) | const

Returns a view specific attribute value.

Parameters:

  | in_strParamName | Name of the attribute.

Returns:
  The Attribute value.

CStatus PutAttributeValue | ( | const CString & | in_strParamName,
|  | const CValue & | in_value |
| ) |  |  |

Sets a view specific attribute value.

Parameters:

  | in_strParamName | Name of the attribute.
  | in_value | The new attribute value.

Returns:
  CStatus::OK success

  CStatus::Fail failure

CStatus BeginEdit | ( |  | ) |

Puts the view in edit mode. The edit mode allows you to change several view attributes in bulk without affecting the current UI. Call the View::EndEdit method to quit the edit mode.

Returns:
  CStatus::OK success

  CStatus::Fail failure

CStatus EndEdit | ( |  | ) |

Requests an end to an edit operation on this View. This function updates the view with the attribute changes performed so far. This has no effect if the view is not in edit mode.

Returns:
  CStatus::OK success

  CStatus::Fail failure

CStatus Move | ( | LONG | in_x,
|  | LONG | in_y |
| ) |  |  |

Moves a view to the specified global screen coordinate.

Parameters:

  | in_x | Position in X.
  | in_y | Position in Y.

Returns:
  CStatus::OK success

  CStatus::Fail failure

CStatus Resize | ( | LONG | in_w,
|  | LONG | in_h |
| ) |  |  |

Changes the size of a view.

Parameters:

  | in_w | New width.
  | in_h | New height

Returns:
  CStatus::OK success

  CStatus::Fail failure

The documentation for this class was generated from the following file:

- xsi_view.h