Rogue Wave Views Gadgets > Panes > Creating Panes
 
Creating Panes
A pane is an instance of the IlvPane class. Since this class is abstract, you must subclass it or use one of its predefined subclasses:
*IlvViewPane, which encapsulates any IlvView object.
*IlvGraphicPane, which encapsulates any IlvGraphic object.
Most of the time, you do not have to subclass the IlvPane class as its predefined subclasses are appropriate for nearly all application needs.
This section discusses the following:
*Creating a Graphic Pane
*Creating a View Pane
*Showing or Hiding a Pane
Creating a Graphic Pane
The following example demonstrates how to create a graphic pane (IlvGraphicPane).
First we create the IlvGraphic object we want to add to the graphic pane. Here, we encapsulate an IlvTreeGadget object.
IlvDisplay* display = ...
IlvTreeGadget* tree = new IlvTreeGadget(display, IlvRect(0, 0, 100, 100));
Then we create a graphic pane:
IlvGraphicPane* graphicPane = new IlvGraphicPane("Tree",tree);
The first argument provided to the constructor is a string representing the name of the pane.
Creating a View Pane
The following example shows how to create a view pane (IlvViewPane).
First we create the IlvView object we want to add to the view pane:
IlvView* view = new IlvView(parent, IlvRect(0, 0, 100, 100));
Then we create the view pane:
IlvViewPane* viewPane = new IlvViewPane("View", view);
The first argument provided to the constructor is a string representing the name of the pane.
Note: The view used in the view pane must be a subview. That is why the encapsulated view was created with the IlvView constructor that takes a parent view as its first argument.
Showing or Hiding a Pane
You can show or hide a pane using the IlvPane::show and IlvPane::hide member functions. A hidden pane does not appear in its paned container.
Note: If you modify the layout of a paned container by adding or removing panes or by showing or hiding panes, you must call the IlvPanedContainer::updatePanes member function for your changes to become effective.

Version 5.7
Copyright © 2013, Rogue Wave Software, Inc. All Rights Reserved.