Rogue Wave Views Foundation Package API Reference Guide |
Rogue Wave Views Documentation Home |
#include <ilviews/base/view.h>
Public Member Functions | |
RoundedCornerShape (IlvDim hRadius, IlvDim vRadius, IlBoolean addTitle=IlFalse) | |
Constructor. More... | |
virtual | ~RoundedCornerShape () |
Destructor. | |
void | getRadiuses (IlvDim &hRadius, IlvDim &vRadius) const |
Returns the radiuses of rounded corners. More... | |
IlBoolean | setRadiuses (IlvDim hRadius, IlvDim vRadius) |
Sets the radiuses of rounded corners. More... | |
Public Member Functions inherited from IlvView::Shape | |
IlvView * | getView () const |
Returns the view associated with the shape. | |
Protected Member Functions | |
virtual IlBoolean | apply () |
Calls the primitive setting the shape on the view. More... | |
virtual void | resize (const IlvRect &newRect) |
Called as a resize callback of the view. More... | |
virtual IlBoolean | setView (IlvView *view) |
Sets the view on which the shape applies. More... | |
Protected Member Functions inherited from IlvView::Shape | |
Shape (IlBoolean addTitle=IlFalse) | |
Constructor. More... | |
virtual | ~Shape () |
Destructor. | |
Library: xviews or winviews or mviews (mutually exclusive)
This class implements a view shape defined as a rectangle with rounded corners. The rectangle has the width and height of the view. The corners are quarters of an ellipse defined by an horizontal and a vertical radius.
The rounded corners are the ones of the inner view area, not including window decorations and title bar.
When the view dimensions change, the method resize()
recomputes the shape area an apply it to the window. The rounded corners keep the same size except when the view is too small to contain them; in this case, the class uses a radius value small enough to fit in the new size.
IlvView::RoundedCornerShape::RoundedCornerShape | ( | IlvDim | hRadius, |
IlvDim | vRadius, | ||
IlBoolean | addTitle = IlFalse |
||
) |
Constructor.
If addTitle is set to IlTrue
, a rectangular area defined by the window title bar is added to the shape. This is only valid for top-level views on Windows platforms.
hRadius | The horizontal radius of the rounded corners. |
vRadius | The vertical radius of the rounded corners. |
addTitle | Specifies whether to add the window title area to the shape. |
|
protectedvirtual |
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.
Implements IlvView::Shape.
Returns the radiuses of rounded corners.
hRadius | The returned value of the horizontal radius. |
vRadius | The returned value of the vertical radius. |
|
protectedvirtual |
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.
newRect | The new size of the view. |
Implements IlvView::Shape.
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 from IlvView::Shape.
© 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.