Related Scripting Object: Desktop
The Desktop provides the services for creating and accessing UI objects in XSI. More...
#include <xsi_desktop.h>
Inheritance diagram for Desktop:

Public Member Functions |
|
| Desktop () | |
| ~Desktop () | |
| Desktop (const CRef &in_ref) | |
| Desktop (const Desktop &in_obj) | |
| bool | IsA (siClassID in_ClassID) const |
| siClassID | GetClassID () const |
| Desktop & | operator= (const Desktop &in_obj) |
| Desktop & | operator= (const CRef &in_ref) |
| Layout | GetActiveLayout () const |
| CStatus | PutActiveLayout (const Layout &in_layout) |
| CRefArray | GetLayouts () const |
| void | RedrawUI () |
| void | SuspendWin32ControlsHook () |
| void | RestoreWin32ControlsHook () |
| void * | GetApplicationWindowHandle () |
using namespace XSI; Application app; Desktop theDesktop = app.GetDesktop(); app.LogMessage( L"Desktop name: " + theDesktop.GetName() ); Layout activeLayout = theDesktop.GetActiveLayout(); app.LogMessage( L"Active layout name: " + activeLayout.GetName() ); app.LogMessage( L"Listing 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 SIObject.
Returns the type of the API class.
Reimplemented from SIObject.
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 SIObject.
Returns the current active Layout object.
Sets the Layout object as active.
| in_layout | The new active layout object |
CStatus::Fail failure
Returns an array of Layout objects currently loaded in XSI.
Redraws the user interface. It does this by pausing the execution of the plug-in until all pending window messages have been processed. See also the Refresh and SceneRefresh commands.
Disables the Win32 hook used by XSI on Windows controls.
On Windows, this Win32 hook can interfere with the appearance and behavior of controls in the custom display host and other custom user interfaces. The hook does not interfere with property pages and views.
Disable the hook just before you create a custom UI. After you finish creating the custom UI, call Desktop::RestoreWin32ControlsHook to restore the hook.
You do not need to disable the hook for property pages and views, or on Linux.
Do not disable the controls hook at any other time.
void ShowFontDlg() { Application app ; LOGFONT lf; CHOOSEFONT cf ; DWORD rgbCurrent = 0 ; ZeroMemory(&cf, sizeof(cf)); cf.lStructSize = sizeof (cf); // Use the XSI main window so that the Font // dialog is properly parented cf.hwndOwner = (HWND)app.GetDesktop().GetApplicationWindowHandle(); cf.lpLogFont = &lf; cf.rgbColors = rgbCurrent; cf.Flags = CF_SCREENFONTS | CF_EFFECTS; // Disable the Win32 hook so the // Font dialog is displayed properly app.GetDesktop().SuspendWin32ControlsHook() ; ::ChooseFont(&cf) ; // This function is part of the Win32 API app.GetDesktop().RestoreWin32ControlsHook() ; }
Restores the Win32 controls hook disabled by a previous call to Desktop::SuspendWin32ControlsHook.
Returns the platform-specific top XSI window handle. On Windows, you must cast the return value to an HWND. On Linux, you get an X window.