#include <ilviews/base/view.h>
Public Member Functions | |
| IlvView * | getView () 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 |
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.
setShape(), IlvAbstractView::setShapeMask(). Constructor.
| addTitle | Specifies 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). |
|
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.
|
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.
| newRect | The new size of the view. |
Implemented in IlvView::RoundedCornerShape.
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.