Rogue Wave Views
Foundation Package API Reference Guide
Product Documentation:

Rogue Wave Views
Documentation Home
List of all members | Public Member Functions | Protected Member Functions | Friends
IlvView::Shape Class Referenceabstract

#include <ilviews/base/view.h>

Inheritance diagram for IlvView::Shape:
IlvView::RoundedCornerShape

Public Member Functions

IlvViewgetView () const
 Returns the view associated with the shape.
 
virtual void resize (const IlvRect &newRect)=0
 Called as a resize callback of the view. More...
 

Protected Member Functions

 Shape (IlBoolean addTitle=IlFalse)
 Constructor. More...
 
virtual ~Shape ()
 Destructor.
 
virtual IlBoolean apply ()=0
 Calls the primitive setting the shape on the view. More...
 
virtual IlBoolean setView (IlvView *view)
 Sets the view on which the shape applies. More...
 

Friends

class IlvView
 

Detailed Description

Library: xviews or winviews or mviews (mutually exclusive)

This abstract class provides a mechanism to adapt the shape of a view when the view is resized.

Setting a Shape on a view installs a resize callback that will call the virtual method resize() when the geometry of the view changes.

Subclasses must define the virtual methods resize() and apply().

A Shape cannot be set on multiple views; the destructor of IlvView will delete the shape.

See also
setShape(), IlvAbstractView::setShapeMask().

Constructor & Destructor Documentation

§ Shape()

IlvView::Shape::Shape ( IlBoolean  addTitle = IlFalse)
protected

Constructor.

Parameters
addTitleSpecifies whether to add window title area to the shape. This is only meaningful top-level windows (sub-views do not have a title area) and only on Windows platforms (the title area is not accessible on X Window).

Member Function Documentation

§ apply()

virtual IlBoolean IlvView::Shape::apply ( )
protectedpure virtual

Calls the primitive setting the shape on the view.

This method is called by setView() and should also be called by resize(). Its job is to set the shape of the view by calling IlvAbstracView::setShapeMask(). The definition of the mask depends on the specification of the subclass.

Implemented in IlvView::RoundedCornerShape.

§ resize()

virtual void IlvView::Shape::resize ( const IlvRect newRect)
pure virtual

Called as a resize callback of the view.

The method should recompute a shape, if necessary. If the shape must be changed, the method should call apply() to replace the previous shape that was fit for the previous size.

Parameters
newRectThe new size of the view.

Implemented in IlvView::RoundedCornerShape.

§ setView()

virtual IlBoolean IlvView::Shape::setView ( IlvView view)
protectedvirtual

Sets the view on which the shape applies.

This method is called by IlvView::setShape(). It initializes internal fields and calls apply() so that the shape is actually set on the window.

setView() should not be called by applications except when defining a subclass.

Subclasses may override this method if they want additional setup when the shape is set on a view. In this case, the overriding method should also call setView() of the parent class to ensure proper initialization.

Reimplemented in IlvView::RoundedCornerShape.


© Copyright 2018, Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave is a registered trademark of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.