Views
Gadgets Package API Reference Guide
Product Documentation:
Views Documentation Home
List of all members | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions
IlvViewFrame Class Reference

Container class. More...

#include <ilviews/gadgets/vframe.h>

Inheritance diagram for IlvViewFrame:
IlvGadgetContainer IlvContainer IlvDrawingView IlvView IlvAbstractView IlvSystemPort IlvStylist IlvStylable IlvPort IlvValueInterface

Public Types

enum  {
  UnknownArea, TitleArea, NorthArea, NorthEastArea,
  EastArea, SouthEastArea, SouthArea, SouthWestArea,
  WestArea, NorthWestArea
}
 Location identifiers within an IlvViewFrame. More...
 
enum  IlvFrameState { IlvFrameNormalState, IlvFrameMinimizedState, IlvFrameMaximizedState }
 This enumeration defines the various states that IlvViewFrame objects can take. More...
 

Public Member Functions

 IlvViewFrame (IlvView *parent, const char *title, const IlvRect &size, IlBoolean visible=IlTrue, const char *cssElementName="IlvViewFrame")
 Initializes a new IlvViewFrame instance. More...
 
 IlvViewFrame (IlvView *parent, const char *title, const IlvRect &size, IlUInt properties, IlBoolean visible=IlTrue, const char *cssElementName="IlvViewFrame")
 Initializes a new IlvViewFrame instance with specific top-view properties. More...
 
virtual void closeFrame ()
 Is called when the user closes this view frame. More...
 
IlvViewgetClient () const
 Returns the client view managed by this view frame. More...
 
virtual void getClientBBox (IlvRect &bbox) const
 Returns the bounding box of the client view managed by this view frame. More...
 
int getCurrentState () const
 The current frame state. More...
 
IlvDesktopManagergetDesktopManager () const
 Returns the desktop manager that handles this frame. More...
 
IlvBitmapgetIcon () const
 Returns the bitmap associated with this view frame. More...
 
IlvPopupMenugetMenu () const
 Returns the IlvPopupMenu object attached to the frame. More...
 
IlvDim getMinHeight () const
 Returns the minimum height of this view frame. More...
 
IlvDim getMinWidth () const
 Returns the minimum width of this view frame. More...
 
const char * getTitle () const
 Returns the title of this view frame. More...
 
IlvMessageLabelgetTitleBar () const
 Returns the title bar of this view frame. More...
 
void getTitleBarBBox (IlvRect &bbox) const
 Returns the bounding box of the title bar of this view frame. More...
 
virtual void maximizeFrame ()
 Is called to maximize this frame to make it fit this view of the desktop manager. More...
 
virtual void minimizeFrame ()
 Is called to minimize this frame so that only its title bar is visible. More...
 
void registerClientView (IlvView *view) const
 Registers the specified view as a client view of this view frame. More...
 
virtual void restoreFrame ()
 Is called to restore this frame to its normal size. More...
 
void setIcon (IlvBitmap *bitmap)
 Sets the bitmap associated with this view frame. More...
 
void setMinHeight (IlvDim size)
 Sets the minimum height of this view frame. More...
 
void setMinWidth (IlvDim size)
 Sets the minimum width of this view frame. More...
 
virtual void setTitle (const char *title)
 Sets the title of this view frame. More...
 
void showMenu (const IlvPoint &point)
 Displays the IlvPopupMenu object attached to this frame at the specified location. More...
 
void unRegisterClientView (IlvView *view) const
 Unregisters the specified client view of this view frame. More...
 
- Public Member Functions inherited from IlvGadgetContainer
 IlvGadgetContainer (IlvAbstractView *parent, const IlvRect &rect, IlBoolean useacc=IlFalse, IlBoolean visible=IlTrue, const char *cssElementName="IlvGadgetContainer")
 Initializes a new instance of the IlvGadgetContainer class as a child view of another view. More...
 
 IlvGadgetContainer (IlvDisplay *display, const char *name, const char *title, const IlvRect &rect, IlBoolean useacc=IlFalse, IlBoolean visible=IlTrue, const char *cssElementName="IlvGadgetContainer")
 Initializes a new instance of the IlvGadgetContainer class as a top view. More...
 
 IlvGadgetContainer (IlvDisplay *display, const char *name, const char *title, const IlvRect &rect, IlUInt properties, IlBoolean useacc=IlFalse, IlBoolean visible=IlTrue, IlvSystemView transientFor=0, const char *cssElementName="IlvGadgetContainer")
 Initializes a new instance of the IlvGadgetContainer class as a top view. More...
 
 IlvGadgetContainer (IlvDisplay *display, IlvSystemView parent, const IlvRect &rect, IlBoolean useacc=IlFalse, IlBoolean visible=IlTrue, const char *cssElementName="IlvGadgetContainer")
 Initializes a new instance of the IlvGadgetContainer class as a child view of a system view. More...
 
 IlvGadgetContainer (IlvDisplay *display, IlvSystemView window, IlBoolean useacc=IlFalse, const char *cssElementName="IlvGadgetContainer")
 Initializes a new instance of the IlvGadgetContainer class using an existing system view. More...
 
virtual IlBoolean allowFocus (IlBoolean value)
 Specifies whether the container manages the focus. More...
 
virtual void applyResize (IlFloat sx, IlFloat sy, IlBoolean redraw=IlTrue)
 Is called to carry out the resize events applying to the gadget container. More...
 
IlBoolean autoResize (IlBoolean a)
 Sets the auto resize mode of the gadget container. More...
 
IlvButtongetDefaultButton () const
 Returns the default button of the gadget container. More...
 
virtual IlvGraphicgetFirstFocusGraphic () const
 Returns the first object that receives the focus in this container. More...
 
virtual IlvGraphicgetFocus () const
 Returns the object that has the keyboard focus in the gadget container. More...
 
virtual IlvGraphicgetGrab () const
 Returns the object that is currently grabbing events in the container. More...
 
virtual IlvGraphicgetLastFocusGraphic () const
 Returns the last object that receives the focus in this container. More...
 
virtual IlvLookFeelHandlergetLookFeelHandler () const
 Returns the look and feel handler associated with this container. More...
 
virtual IlvGraphicgetNextFocusGraphic (IlvGraphic *object) const
 Returns the next object that will receive the focus after the specified object. More...
 
IlvGraphicgetOverriddenFocus () const
 Returns the object that will receive the focus after calling setFocus(). More...
 
virtual IlvGraphicgetPreviousFocusGraphic (IlvGraphic *object) const
 Returns the previous object that received the focus before the specified object. More...
 
IlBoolean isAutoResizing () const
 Indicates whether the gadget container gets resized when loading a file. More...
 
virtual IlBoolean isFocusAllowed () const
 Indicates whether the focus is allowed in the container. More...
 
virtual void moveFocusAfter (IlBoolean redraw=IlTrue)
 Is called to find the next focusable object. More...
 
virtual void moveFocusBefore (IlBoolean redraw=IlTrue)
 Is called to find the previous focusable object. More...
 
void overrideFocus (IlvGraphic *obj)
 Sets the object that will receive the focus after calling setFocus(). More...
 
virtual void removeGrab ()
 Cancels the grabbing settings defined with setGrab(). More...
 
void setDefaultButton (IlvButton *button, IlBoolean redraw=IlTrue)
 Sets the default button of the gadget container. More...
 
virtual void setFocus (IlvGraphic *graphic=0, IlBoolean redraw=IlTrue)
 Sets the focus to the specified object of the gadget container. More...
 
virtual void setGrab (IlvGraphic *object)
 Sets the specified object as the grabbing object. More...
 
virtual void setLookFeelHandler (IlvLookFeelHandler *lfh)
 Sets the look and feel handler of this container. More...
 

Static Public Member Functions

static IlBoolean IsShowingContentsWhileDragging ()
 Indicates whether the entire contents of a view frame is drawn when this view frame is moved or resized. More...
 
static void SetDefaultTitleBarHeight (IlUShort height)
 Sets the default height of view frame title bar. More...
 
static void ShowContentsWhileDragging (IlBoolean value)
 Specifies whether the entire contents of a view frame is drawn when this view frame is moved or resized. More...
 

Protected Member Functions

virtual IlvCursorgetCursor (int area)
 Returns a cursor depending on the indicated area. More...
 

Detailed Description

Container class.

Library: ilvadvgdt

The IlvViewFrame class defines a special container that encapsulates a client view.

It adds a title bar composed of an icon, a label, and several buttons to the client view. The client view is added to the view frame by creating it as a child view of the view frame.

A frame can be in one of the three following states: normal, maximized, or minimized.

Example of an Application Using IlvViewFrame Objects

See also
IlvDesktopManager.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum

Location identifiers within an IlvViewFrame.

See also
getCursor(int).
Enumerator
UnknownArea 

An undefined or invalid location.

TitleArea 

The area where the title is displayed.

NorthArea 

The border area at the top.

NorthEastArea 

The border area at the top-right corner.

EastArea 

The border area on the right side.

SouthEastArea 

The border area at the bottom-right corner.

SouthArea 

The border area at the bottom.

SouthWestArea 

The border area at the bottom-left corner.

WestArea 

The border area on the left side.

NorthWestArea 

The border area at the top-left corner.

◆ IlvFrameState

This enumeration defines the various states that IlvViewFrame objects can take.

See also
IlvViewFrame::getCurrentState().
Enumerator
IlvFrameNormalState 

The default state for a view frame. The client view is visible, and can be resized by dragging the view frame border.

See also
restoreFrame().
IlvFrameMinimizedState 

In this state, only the title bar of the view frame is visible

See also
minimizeFrame().
IlvFrameMaximizedState 

In this state, the view frame occupies the entire desktop view and hides any other view frame.

See also
maximizeFrame().

Constructor & Destructor Documentation

◆ IlvViewFrame() [1/2]

IlvViewFrame::IlvViewFrame ( IlvView parent,
const char *  title,
const IlvRect size,
IlBoolean  visible = IlTrue,
const char *  cssElementName = "IlvViewFrame" 
)

Initializes a new IlvViewFrame instance.

Initializes a new instance of the class IlvViewFrame as a child view of parent.

Parameters
parentThe parent view of this new view frame.
titleThe view frame title. This title is displayed in the title bar of the new view frame.
sizeThe size and position of this new view frame.
visibleSpecifies whether this new view frame should be visible.
cssElementNamedefines the name of the stylable in the CSS DOM. The default implementation of getCssElementName() returns this parameter.
Note
The parent view of an IlvViewFrame must be linked to an IlvDesktopManager object. If this is not the case, a desktop manager is automatically created by this constructor.

◆ IlvViewFrame() [2/2]

IlvViewFrame::IlvViewFrame ( IlvView parent,
const char *  title,
const IlvRect size,
IlUInt  properties,
IlBoolean  visible = IlTrue,
const char *  cssElementName = "IlvViewFrame" 
)

Initializes a new IlvViewFrame instance with specific top-view properties.

Initializes a new instance of the class IlvViewFrame as a child view of parent.

In a manner similar to the IlvView constructor that lets you create a new top window, you can control how the borders of the new IlvViewFrame are displayed by setting properties to a value that can be an OR combination of:

  • IlvNoBorder: the new frame has no borders.
    In this case, the frame does not show any border around itself, and no title bar. The user can not interactively resize the frame anymore.
  • IlvNoResizeBorder: The user can not interactively resize the frame anymore. The Minimize and Maximize features are however still available (unless IlvNoMinBox or IlvNoMaxBox is also used).
  • IlvNoTitleBar: The title bar is removed.
    When minimized, the view frame will show as a thin frame. You need to provide a way to restore the view frame, since controls to do this interactively will not show anymore.
  • IlvNoCloseBox: The Close feature is disabled.
  • IlvNoMinBox: The Minimize feature is disabled.
  • IlvNoMaxBox: The Maximize feature is disabled.
Parameters
parentThe parent view of this new view frame.
titleThe view frame title. This title is displayed in the title bar of this view frame.
sizeThe size and position of this view frame.
propertiesThe top-window like properties for this new view frame.
visibleSpecifies whether this new view frame should be visible.
cssElementNamedefines the name of the stylable in the CSS DOM. The default implementation of getCssElementName() returns this parameter.
Note
The parent view of an IlvViewFrame must be linked to an IlvDesktopManager object. If this is not the case, a desktop manager is automatically created by this constructor.

Member Function Documentation

◆ closeFrame()

virtual void IlvViewFrame::closeFrame ( )
virtual

Is called when the user closes this view frame.

The default implementation calls the destroy callbacks associated with the frame and its client view. To handle the destruction of a view frame you can either override this method in your own subclass of IlvViewFrame, or use a destroy callback.

See also
IlvView::setDestroyCallback().

◆ getClient()

IlvView* IlvViewFrame::getClient ( ) const

Returns the client view managed by this view frame.

Returns
The client view managed by the view frame, or 0 if there is none.

◆ getClientBBox()

virtual void IlvViewFrame::getClientBBox ( IlvRect bbox) const
virtual

Returns the bounding box of the client view managed by this view frame.

Parameters
bboxThe returned bounding box of the client view.

◆ getCurrentState()

int IlvViewFrame::getCurrentState ( ) const

The current frame state.

Returns
The current frame state. The valid returned values are defined by the IlvFrameState enumeration.
See also
IlvFrameState, maximizeFrame(), minimizeFrame(), restoreFrame().

◆ getCursor()

virtual IlvCursor* IlvViewFrame::getCursor ( int  area)
protectedvirtual

Returns a cursor depending on the indicated area.

This method returns a cursor with a shape reflecting the value of area (the values may be TitleArea, NorthArea, NorthEastArea, EastArea, SouthEastArea, SouthArea, SouthWestArea,WestArea or NorthWestArea.

This is typically used in the interactions with the application user where a relevant cursor can indicate what area of the frame the mouse is located over.

An application can overload this method to provide its own mechanism to create an application-specific cursor.

Parameters
areaThe area of the frame that a cursor is requested for.
Returns
The cursor that the application can use to give a hint to the user of the provided area.

◆ getDesktopManager()

IlvDesktopManager* IlvViewFrame::getDesktopManager ( ) const

Returns the desktop manager that handles this frame.

Returns
The desktop manager that handles this frame.
See also
IlvDesktopManager.

◆ getIcon()

IlvBitmap* IlvViewFrame::getIcon ( ) const

Returns the bitmap associated with this view frame.

The bitmap is displayed in the title bar of the view frame.

Returns
The bitmap of this frame.
See also
setIcon(), IlvBitmap.

◆ getMenu()

IlvPopupMenu* IlvViewFrame::getMenu ( ) const

Returns the IlvPopupMenu object attached to the frame.

The pop-up menu is displayed when the user clicks the icon of the title bar. This menu contains predefined items for changing the frame state. You can modify this menu by adding or removing items.

Returns
The IlvPopupMenu object used by the frame.
See also
showMenu().

◆ getMinHeight()

IlvDim IlvViewFrame::getMinHeight ( ) const

Returns the minimum height of this view frame.

A view frame cannot be resized to a size smaller than its minimum dimensions.

Returns
The minimum height of this view frame.
See also
setMinHeight(), getMinWidth().

◆ getMinWidth()

IlvDim IlvViewFrame::getMinWidth ( ) const

Returns the minimum width of this view frame.

A view frame cannot be resized to a size smaller than its minimum dimensions.

Returns
The minimum width of this view frame.
See also
setMinWidth(), getMinHeight().

◆ getTitle()

const char* IlvViewFrame::getTitle ( ) const

Returns the title of this view frame.

The title is displayed in the title bar of the view frame.

Returns
The title of this frame.
See also
setTitle().

◆ getTitleBar()

IlvMessageLabel* IlvViewFrame::getTitleBar ( ) const

Returns the title bar of this view frame.

Returns
The title bar of this frame.
See also
getTitle().

◆ getTitleBarBBox()

void IlvViewFrame::getTitleBarBBox ( IlvRect bbox) const

Returns the bounding box of the title bar of this view frame.

Parameters
bboxThe returned bounding box of the title bar.

◆ IsShowingContentsWhileDragging()

static IlBoolean IlvViewFrame::IsShowingContentsWhileDragging ( )
static

Indicates whether the entire contents of a view frame is drawn when this view frame is moved or resized.

If this method returns IlFalse, only the ghost image of the view frame is drawn when the view frame is moved or resized.

Returns
IlTrue if the entire contents of a view frame is drawn when the view frame is moved or resized and IlFalse otherwise.

◆ maximizeFrame()

virtual void IlvViewFrame::maximizeFrame ( )
virtual

Is called to maximize this frame to make it fit this view of the desktop manager.

See also
IlvFrameState, restoreFrame(), minimizeFrame(), IlvDesktopManager::isMaximizing().

◆ minimizeFrame()

virtual void IlvViewFrame::minimizeFrame ( )
virtual

Is called to minimize this frame so that only its title bar is visible.

See also
IlvFrameState, restoreFrame(), maximizeFrame().

◆ registerClientView()

void IlvViewFrame::registerClientView ( IlvView view) const

Registers the specified view as a client view of this view frame.

A client view will forward some events to its view frame. This method is automatically called on the main client view of the view frame. You need to call this method if your main client view contains subviews. In this case, call this method giving each subview as parameter.

Parameters
viewThe view to be registered as a client view.
See also
unRegisterClientView().

◆ restoreFrame()

virtual void IlvViewFrame::restoreFrame ( )
virtual

Is called to restore this frame to its normal size.

See also
IlvFrameState, minimizeFrame(), maximizeFrame().

◆ SetDefaultTitleBarHeight()

static void IlvViewFrame::SetDefaultTitleBarHeight ( IlUShort  height)
static

Sets the default height of view frame title bar.

The default title bar height should be set before the IlvViewFrame is created.

Parameters
heightdefault height of view frame title bar.

◆ setIcon()

void IlvViewFrame::setIcon ( IlvBitmap bitmap)

Sets the bitmap associated with this view frame.

The bitmap is displayed in the title bar of the view frame.

Parameters
bitmapThe new bitmap. The old bitmap, if any, is unlocked, and the new one is locked. 0 is not a valid value. You must provide a valid pointer to an IlvBitmap object.
See also
getIcon(), IlvBitmap.

◆ setMinHeight()

void IlvViewFrame::setMinHeight ( IlvDim  size)

Sets the minimum height of this view frame.

A view frame cannot be resized to a size smaller than its minimum dimensions.

Parameters
sizeThe minimum height of this view frame.
See also
getMinHeight(), setMinWidth().

◆ setMinWidth()

void IlvViewFrame::setMinWidth ( IlvDim  size)

Sets the minimum width of this view frame.

A view frame cannot be resized to a size smaller than its minimum dimensions.

Parameters
sizeThe minimum width of this view frame.
See also
getMinWidth(), setMinHeight().

◆ setTitle()

virtual void IlvViewFrame::setTitle ( const char *  title)
virtual

Sets the title of this view frame.

The title is displayed in the title bar of the view frame.

Parameters
titleThe new title for this frame. The old title is deleted.
See also
getTitle().

Reimplemented from IlvView.

◆ ShowContentsWhileDragging()

static void IlvViewFrame::ShowContentsWhileDragging ( IlBoolean  value)
static

Specifies whether the entire contents of a view frame is drawn when this view frame is moved or resized.

Parameters
valueSpecifies whether the entire contents of a view frame contents should be drawn when the view frame is moved or resized.
See also
IsShowingContentsWhileDragging.

◆ showMenu()

void IlvViewFrame::showMenu ( const IlvPoint point)

Displays the IlvPopupMenu object attached to this frame at the specified location.

Parameters
pointThe location where the pop-up menu is displayed.
See also
getMenu().

◆ unRegisterClientView()

void IlvViewFrame::unRegisterClientView ( IlvView view) const

Unregisters the specified client view of this view frame.

Parameters
viewThe view to be unregistered.
See also
registerClientView().