Gadgets > Rogue Wave Views Gadgets > View Frames > Creating a Desktop with View Frames
 
Creating a Desktop with View Frames
This section explains how to create a desktop containing view frames. It covers the following sections:
*Creating a Desktop
*Creating View Frames
Creating a Desktop
The first step consists of creating the desktop view and the desktop manager:
IlvView* desktopView = new IlvView(...);
IlvDesktopManager* desktop = new IlvDesktopManager(desktopView);
Note: The desktop view can be an instance of any subclass of IlvView.
You can retrieve the IlvDesktopManager instance that is linked to a view using the static method Get:
IlvDesktopManager* desktop = IlvDesktopManager:Get(view);
To know the desktop view associated with a desktop manager, use the method getView:
IlvView* view = desktop->getView();
Note that when the desktop view is deleted, the desktop manager is notified, but is not deleted.
Creating View Frames
Once the desktop manager is created, you can build the view frames as child windows of the desktop view:
IlvViewFrame* vframe = new IlvViewFrame(desktopView,
"Frame 0",
IlvRect(0, 0, 100, 100));
The new view frame is automatically managed by the instance of IlvDesktopManager that is linked to its parent view (that is, the desktop view). Note that if no desktop manager has been attached to the parent view of a view frame, a default desktop manager is created using the parent view of the view frame as desktop view. This default desktop manager is internally managed, so you will not have to delete it.
To know the desktop manager of a view frame, use:
IlvDesktopManager* desktop = vframe->getDesktopManager();
You can also retrieve the list of frames managed by a desktop manager using:
IlvUInt count;
IlvViewFrame* const* frames = desktop->getFrames(count);

Version 5.8
Copyright © 2014, Rogue Wave Software, Inc. All Rights Reserved.