Related Scripting Object: Layout
The Layout object represents an instance of a screen layout in XSI and gives access to the views attached to that layout. The layout is read-only and cannot be edited or created with the SDK. More...
#include <xsi_layout.h>
Inheritance diagram for Layout:

Public Member Functions |
|
| Layout () | |
| ~Layout () | |
| Layout (const CRef &in_ref) | |
| Layout (const Layout &in_obj) | |
| bool | IsA (siClassID in_ClassID) const |
| siClassID | GetClassID () const |
| Layout & | operator= (const Layout &in_obj) |
| Layout & | operator= (const CRef &in_ref) |
| CRefArray | GetViews () const |
| CStatus | CreateView (const CString &in_strTypeName, const CString &in_strViewName, CRef &out_newView) |
| CStatus | CreateViewFromDefinitionFile (const CString &in_strFilePath, const CString &in_strViewName, CRef &io_newView) |
You can access layouts via the Desktop: see Desktop::ActiveLayout and Desktop::Layouts.
using namespace XSI; Application app; Desktop theDesktop = app.GetDesktop(); app.LogMessage( L"List all loaded layouts" ); CRefArray layoutArray = theDesktop.GetLayouts(); for (LONG i=0; i<layoutArray.GetCount(); i++) { Layout layout = layoutArray[i]; app.LogMessage( L"Layout name: " + layout.GetName() ); }
Default destructor.
Constructor.
| in_ref | constant reference object. |
Copy constructor.
| in_obj | constant class object. |
| bool IsA | ( | siClassID | in_ClassID | ) | const [virtual] |
Returns true if a given class type is compatible with this API class.
| in_ClassID | class type. |
Reimplemented from UIPersistable.
Returns the type of the API class.
Reimplemented from UIPersistable.
Creates an object from another object. The newly created object is set to empty if the input object is not compatible.
| in_obj | constant class object. |
Creates an object from a reference object. The newly created object is set to empty if the input reference object is not compatible.
| in_ref | constant class object. |
Reimplemented from UIPersistable.
Returns an array of View objects currently attached to this layout.
| CStatus CreateView | ( | const CString & | in_strTypeName, | |
| const CString & | in_strViewName, | |||
| CRef & | out_newView | |||
| ) |
Creates a new View object. The new view is a temporary view and not attached to this layout, therefore saving the layout does not make the new view part of the layout either.
| in_strTypeName | The type of view to create. Available types can be found in the .xsivw and .xsitb files under the Application\Views and Application\Toolbars folders located in the standard factory, user and workgroup locations. |
|
| in_strViewName | The name of the view to create. |
| out_newView | The newly created view object. |
CStatus::Fail failure
| CStatus CreateViewFromDefinitionFile | ( | const CString & | in_strFilePath, | |
| const CString & | in_strViewName, | |||
| CRef & | io_newView | |||
| ) |
Creates a new View object given the path to its definition on disk. This function is a low-level approach to dealing with Views, in most cases Layout::CreateView is the most convenient way to create floating views.
This function will load any valid view file, even if the file is outside of the normal search locations inside the user, factory and workgroups directories. It will fail if there is an XML syntax error or other problem with the content of the view definition.
| in_strFilePath | Complete path to a .xsitb or .xsivw file on disk. |
|
| in_strViewName | The name of the view to create. |
| io_newView | Returns the new view. |
CStatus::Fail failure