Rogue Wave Views 5.5.1 |
Rogue Wave Views |
Rogue Wave Views Documentation Home |
View class. More...
#include <ilviews/base/view.h>
Public Member Functions | |
IlvView (IlvDisplay *display, const char *name, const char *title, const IlvRect &size, IlUInt properties, IlBoolean visible=((IlBoolean) 1), IlvSystemView transientFor=0) | |
Constructor. | |
IlvView (IlvDisplay *display, const char *name, const char *title, const IlvRect &size, IlBoolean visible=((IlBoolean) 1)) | |
Constructor. | |
IlvView (IlvDisplay *display, IlvSystemView parent, const IlvRect &size, IlBoolean visible=((IlBoolean) 1)) | |
Constructor. | |
IlvView (IlvDisplay *display, IlvSystemView available) | |
Constructor. | |
IlvView (IlvAbstractView *parent, const IlvRect &size, IlBoolean visible=((IlBoolean) 1)) | |
Constructor. | |
void | addProperty (const IlSymbol *key, IlAny value) |
Adds a property to the view. | |
virtual IlBoolean | applyValue (const IlvValue &) |
Applies an accessor. | |
void | ensureInScreen (IlvPos xMargin=0, IlvPos yMargin=0) |
Ensures that the view remains visible. | |
const char * | getName () const |
Retrieves the name. | |
IlAny | getProperty (const IlSymbol *key) const |
Retrieves a property. | |
const char * | getTitle () const |
Retrieves the title of this view. | |
IlBoolean | hasProperty (const IlSymbol *key) const |
Checks the existence of a property. | |
virtual void | hide () |
Hides the view. | |
void | iconBitmap (IlvBitmap *image, IlvBitmap *mask=0) |
Sets the icon aspect. | |
void | iconify () |
Requests this window to iconify itself. | |
virtual IlBoolean | isIconified () const |
Retrieves the iconified state. | |
IlBoolean | isModal () const |
Queries the modality of this view. | |
IlBoolean | isVisible () const |
Retrieves the visibility. | |
virtual void | move (const IlvPoint &point) |
Moves the view. | |
virtual void | moveResize (const IlvRect &rect) |
Reshapes the view. | |
void | moveToMouse (IlvDirection justification=IlvCenter, IlvPos dx=0, IlvPos dy=0, IlBoolean ensureInScreen=((IlBoolean) 1)) |
Moves the view relative to the location of the mouse. | |
void | moveToScreen (IlvDirection justification=IlvCenter, IlvPos dx=0, IlvPos dy=0, IlBoolean ensureInScreen=((IlBoolean) 1)) |
Moves the view relative to the root window. | |
void | moveToView (const IlvView *view, IlvDirection justification=IlvCenter, IlvPos dx=0, IlvPos dy=0, IlBoolean ensureInScreen=((IlBoolean) 1)) |
Moves the view relative to another view. | |
virtual IlvValue & | queryValue (IlvValue &) const |
Retrieves the value of an accessor. | |
virtual void | removeDeleteCallback (IlvDestroyCallback del=0, IlAny userArg=0) |
Removes a Delete callback. | |
virtual void | removeDestroyCallback (IlvDestroyCallback destroy=0, IlAny userArg=0) |
Removes a Destroy callback. | |
virtual void | removeExposeCallback (IlvExposeCallback expose=0, IlAny userArg=0) |
Removes an Expose callback. | |
virtual void | removeInputCallback (IlvInputCallback input=0, IlAny userArg=0) |
Removes an Input callback. | |
IlBoolean | removeProperty (const IlSymbol *key) |
Removes a property. | |
virtual void | removeResizeCallback (IlvResizeCallback resize=0, IlAny userArg=0) |
Removes a Resize callback. | |
IlBoolean | replaceProperty (const IlSymbol *key, IlAny value) |
Replaces a property. | |
virtual void | resize (IlvDim w, IlvDim h) |
Resizes the view. | |
virtual void | setDeleteCallback (IlvDestroyCallback del, IlAny userArg=0) |
Sets a callback that watches for destruction. | |
virtual void | setDestroyCallback (IlvDestroyCallback destroy, IlAny userArg=0) |
Sets a callback for Destroy events. | |
virtual void | setExposeCallback (IlvExposeCallback expose, IlAny userArg=0) |
Sets a callback for Expose events. | |
void | setIconTitle (const char *title) |
Sets the iconified title of this view. | |
virtual void | setInputCallback (IlvInputCallback input, IlAny userArg=0) |
Sets a callback for Input events. | |
void | setMaximumSize (IlvDim w, IlvDim h) |
Sets the maximum size of this view. | |
void | setMinimumSize (IlvDim w, IlvDim h) |
Sets the minimum size of this view. | |
virtual void | setName (const char *name) |
Sets the name. | |
void | setProperty (const IlSymbol *key, IlAny value) |
Sets or removes a property. | |
virtual void | setResizeCallback (IlvResizeCallback resize, IlAny userArg=0) |
Sets a callback for Resize events. | |
void | setShapeMask (IlvBitmap *mask, IlBoolean useTitle=((IlBoolean) 0)) |
Sets a shape mask. | |
virtual void | setTitle (const char *title) |
Sets the title of the view. | |
virtual void | show () |
Shows the view. | |
virtual IlBoolean | showModal (IlBoolean doesGrab=((IlBoolean) 0), IlvCursor *cursor=0) |
Shows the window in a modal mode. |
View class.
Library: display
The IlvView
class is provided basically for drawing on the screen. It is designed to be used as the child of a previously created IlvAbstractView
class, or as a new top-level window.
IlvCursor
, IlvDisplay
, IlvDrawingView
, IlvElasticView
, IlvScrollView
. IlvView::IlvView | ( | IlvAbstractView * | parent, | |
const IlvRect & | size, | |||
IlBoolean | visible = ((IlBoolean) 1) | |||
) |
Constructor.
This constructor initializes a view object that is a child of the parent
view.
parent | The parent view. | |
size | The initial location and size of the view, in the coordinate system of parent. | |
visible | Can be set to IlFalse to initially hide the window. |
IlvView::IlvView | ( | IlvDisplay * | display, | |
IlvSystemView | available | |||
) |
Constructor.
This constructor creates a new view object by actually using the existing system view indicated by available.
display | The display instance. | |
available | The system view on which this IlvView is based. |
IlvView::IlvView | ( | IlvDisplay * | display, | |
IlvSystemView | parent, | |||
const IlvRect & | size, | |||
IlBoolean | visible = ((IlBoolean) 1) | |||
) |
Constructor.
This constructor creates a view that is a child of the existing system view indicated by parent
.
display | The display instance. | |
parent | The parent system view. | |
size | The initial location and size of the view, in the coordinate system of the existing system view. | |
visible | Can be set to IlFalse to initially hide the window. |
IlvView::IlvView | ( | IlvDisplay * | display, | |
const char * | name, | |||
const char * | title, | |||
const IlvRect & | size, | |||
IlBoolean | visible = ((IlBoolean) 1) | |||
) |
Constructor.
This constructor initializes a view object that is a new top window.
display | The display instance. | |
name | The name of this view (used by the resource association mechanism). | |
title | The title of this top window. | |
size | The initial location and size of the view, relative to the root window of display. | |
visible | Can be set to IlFalse to initially hide the window. |
IlvView::IlvView | ( | IlvDisplay * | display, | |
const char * | name, | |||
const char * | title, | |||
const IlvRect & | size, | |||
IlUInt | properties, | |||
IlBoolean | visible = ((IlBoolean) 1) , |
|||
IlvSystemView | transientFor = 0 | |||
) |
Constructor.
This constructor creates a top window, with an optional parameter properties that makes it possible to tune its aspect. This parameter is an OR
combination of these flags:
IlvStandardBorder
: the new top window has regular window borders, banner and resize handles. IlvNoBorder
: the new top window has no border. Note that on X Window, setting the property IlvNoBorder
is more than a decoration issue. The view creates an override-redirect window; thus, the window manager will ignore it. The application then acts as temporary window manager, which very few applications are prepared to do. The main purpose of IlvNoBorder
is to create pop-up windows, like menus. IlvNoResizeBorder
: the new top window has no resize handle; thus, the user cannot resize this window. The parameter transientFor specifies the system view for which the IlvView
is transient. It may be any top-level system view and not necessarily encapsulated by a IlvView
. Saying that a view v1 is transient for view v2 means that:
This notion is applicable to views built as top-level windows ("shells" in Motif). Note that on Windows platforms, if v1 is transient for v2, then the destruction of v2 will automatically destroy v1 as well. You may have to protect your application against this by setting a delete callback on v1 (see setDeleteCallback
).
display | The display instance. | |
name | The name of this view (used by the resource association mechanism). | |
title | The title of this top window. | |
size | The initial location and size of the view, relative to the root window of display. | |
properties | The properties of that view (see above). | |
visible | Can be set to IlFalse to initially hide the window. | |
transientFor | The possible system view for which this view is transient. If unspecified or set to 0 , this view will not be transient for any view. |
Adds a property to the view.
Adds the property key to the view, associated with the value value.
key | The property key. | |
value | The associated value. |
Applies an accessor.
This member function is called by the changeValue
function and must not be called directly.
Moreover, no drawing operations are carried out here (and should not be). If you add your own new IlvValue
, do not forget to override applyValue
as well as changeValue
and queryValue
, since applyValue
is called by changeValue
.
val | The new value of the accessor. |
IlTrue
if the accessor was applied, IlFalse
otherwise. Reimplemented from IlvAbstractView.
Reimplemented in IlvContainer.
Ensures that the view remains visible.
This function is meaningful only for top-window views.
It moves this view so that it remains visible on the screen. If the view is higher than the screen, it will not move in the y direction. If the view is wider than the screen, it will not move in the x direction. xMargin and yMargin define margin distances that the view location must respect, as if the screen were 2*
xMargin pixels less wide, and 2*
yMargin pixels less high.
If the view is already entirely visible on the screen with the margins respected, this function does nothing.
xMargin | The horizontal margin. | |
yMargin | The vertical margin. |
const char* IlvView::getName | ( | ) | const |
Retrieves the name.
Each view is provided a name at its creation.
Retrieves a property.
key | The property key. |
0
. const char* IlvView::getTitle | ( | ) | const |
Retrieves the title of this view.
This function is meaningful only for top-window views.
Checks the existence of a property.
key | The property key. |
IlTrue
if the property key exists for the view and IlFalse
otherwise. virtual void IlvView::hide | ( | ) | [virtual] |
Hides the view.
Removes the window from the visible windows on your screen.
Reimplemented from IlvAbstractView.
Reimplemented in IlvContainer.
Sets the icon aspect.
This function is meaningful only for top-window views.
It sets the new icon aspect when this window is to be iconified. The parameters image and mask are the same as for creating new cursors (see IlvCursor
).
image | The image that must be used. | |
mask | The image mask that must be used. |
void IlvView::iconify | ( | ) |
Requests this window to iconify itself.
This function is meaningful only for top-window views.
virtual IlBoolean IlvView::isIconified | ( | ) | const [virtual] |
Retrieves the iconified state.
This function is meaningful only for top-window views.
IlBoolean
value indicating whether this top window is iconified or not. IlBoolean IlvView::isModal | ( | ) | const |
Queries the modality of this view.
This function is meaningful only for top-window views.
IlTrue
if the view is in modal use, and IlFalse
if it is not. IlBoolean IlvView::isVisible | ( | ) | const |
Retrieves the visibility.
Reimplemented in IlvContainer.
virtual void IlvView::move | ( | const IlvPoint & | position | ) | [virtual] |
Moves the view.
Moves the upper left corner of the window to the indicated position in the parent window of this object, or the root window in the case of a top window.
position | The new position of the window. |
Reimplemented from IlvAbstractView.
virtual void IlvView::moveResize | ( | const IlvRect & | newSize | ) | [virtual] |
Reshapes the view.
Moves and changes the size of the window in the parent window.
newSize | The new position and dimensions of the window. |
Reimplemented from IlvAbstractView.
Reimplemented in IlvElasticView.
void IlvView::moveToMouse | ( | IlvDirection | justification = IlvCenter , |
|
IlvPos | dx = 0 , |
|||
IlvPos | dy = 0 , |
|||
IlBoolean | ensureInScreen = ((IlBoolean) 1) | |||
) |
Moves the view relative to the location of the mouse.
This function is meaningful only for top-window views.
It moves this view so that the point indicated by justification is moved to the pointing device, with an offset of dx and dy.
justification | Specifies how the new location of this view is computed:
| |
dx | The horizontal offset of that is applied. | |
dy | The vertical offset of that is applied. | |
ensureInScreen | If this Boolean value is unspecified or set to IlTrue , the window is ensured to entirely remain in the screen, by calling ensureInScreen . |
void IlvView::moveToScreen | ( | IlvDirection | justification = IlvCenter , |
|
IlvPos | dx = 0 , |
|||
IlvPos | dy = 0 , |
|||
IlBoolean | ensureInScreen = ((IlBoolean) 1) | |||
) |
Moves the view relative to the root window.
This function is meaningful only for top-window views.
Moves this view to the position indicated by justification, relative to the entire screen, with an offset of dx and dy.
justification | Specifies how the new location of the view is computed:
| |
dx | The horizontal offset of that is applied. | |
dy | The vertical offset of that is applied. | |
ensureInScreen | If this Boolean value is unspecified or set to IlTrue , the window is ensured to entirely remain in the screen, by calling ensureInScreen . |
void IlvView::moveToView | ( | const IlvView * | view, | |
IlvDirection | justification = IlvCenter , |
|||
IlvPos | dx = 0 , |
|||
IlvPos | dy = 0 , |
|||
IlBoolean | ensureInScreen = ((IlBoolean) 1) | |||
) |
Moves the view relative to another view.
This function is meaningful only for top-window views.
It moves this view to the position indicated by justification, relative to the position and size of view, which must be another top view, with an offset of dx and dy.
view | The reference view. | |
justification | Specifies how the new location of this view is computed. Valid values for this parameter are:
| |
dx | The horizontal offset of that is applied. | |
dy | The vertical offset of that is applied. | |
ensureInScreen | If this Boolean value is unspecified or set to IlTrue , the window is ensured to entirely remain in the screen, by calling ensureInScreen . |
Retrieves the value of an accessor.
Retrieves the value of the accessor val. The queryValue
method can be used in the following way:
See IlvValue
for more information.
Reimplemented from IlvAbstractView.
Reimplemented in IlvContainer.
virtual void IlvView::removeDeleteCallback | ( | IlvDestroyCallback | del = 0 , |
|
IlAny | userArg = 0 | |||
) | [virtual] |
Removes a Delete callback.
The 0
default value for the first parameter is a mistake of the API but is kept for compatibility reasons. If 0
is used, no callback is removed.
del | The callback that is removed. | |
userArg | The user argument that was provided when setDeleteCallback was called. |
virtual void IlvView::removeDestroyCallback | ( | IlvDestroyCallback | destroy = 0 , |
|
IlAny | userArg = 0 | |||
) | [virtual] |
Removes a Destroy callback.
The 0
default value for the first parameter is a mistake of the API but is kept for compatibility reasons. If 0
is used, no callback is removed. This function is meaningful only for top-window views.
destroy | The callback that is removed. | |
userArg | The user argument that was provided when setDestroyCallback was called. |
virtual void IlvView::removeExposeCallback | ( | IlvExposeCallback | expose = 0 , |
|
IlAny | userArg = 0 | |||
) | [virtual] |
Removes an Expose callback.
The 0
default value for the first parameter is a mistake of the API but is kept for compatibility reasons. If 0
is used, no callback is removed.
expose | The callback that is removed. | |
userArg | The user argument that was provided when setExposeCallback was called. |
virtual void IlvView::removeInputCallback | ( | IlvInputCallback | input = 0 , |
|
IlAny | userArg = 0 | |||
) | [virtual] |
Removes an Input callback.
The 0
default value for the first parameter is a mistake of the API but is kept for compatibility reasons. If 0
is used, no callback is removed.
input | The callback that is removed. | |
userArg | The user argument that was provided when setInputCallback was called. |
Removes a property.
Removes the property key.
key | The property key. |
IlFalse
if this property does not exist in this view. virtual void IlvView::removeResizeCallback | ( | IlvResizeCallback | resize = 0 , |
|
IlAny | userArg = 0 | |||
) | [virtual] |
Removes a Resize callback.
The 0
default value for the first parameter is a mistake of the API but is kept for compatibility reasons. If 0
is used, no callback is removed.
resize | The callback that is removed. | |
userArg | The user argument that was provided when setResizeCallback was called. |
Replaces a property.
Replaces the value of the property key with value.
key | The property key. | |
value | The associated value to used. |
IlFalse
if this property does not exist in this view. Resizes the view.
w | The new width of the view. | |
h | The new height of the view. |
Reimplemented from IlvAbstractView.
Reimplemented in IlvElasticView.
virtual void IlvView::setDeleteCallback | ( | IlvDestroyCallback | del, | |
IlAny | userArg = 0 | |||
) | [virtual] |
Sets a callback that watches for destruction.
Specifies an IlvDestroyCallback
function to be called when this view is deleted. You can set as many destroy callbacks as you need. The last callback you set is the last to be called.
del | The function that is called when the view is deleted. | |
userArg | The user parameter that is transmitted to delete when it is called. |
virtual void IlvView::setDestroyCallback | ( | IlvDestroyCallback | destroy, | |
IlAny | userArg = 0 | |||
) | [virtual] |
Sets a callback for Destroy events.
This function is meaningful only for top-window views.
Specifies a callback function to be called when the windowing system requests the destruction of the window. This is usually performed using a Close button that the window manager of your system has added to the window frame.
When an event of this kind occurs, the IlvView
object itself is not destroyed. You are expected to write the function in such a way that it takes into account the disappearance of the window if necessary.
You can set as many destroy callbacks as you need. The last callback set is the last to be called.
destroy | The function that is called when the view receives a request for destruction. | |
userArg | The user parameter that is transmitted to delete when it is called. |
virtual void IlvView::setExposeCallback | ( | IlvExposeCallback | expose, | |
IlAny | userArg = 0 | |||
) | [virtual] |
Sets a callback for Expose events.
Specifies an IlvExposeCallback
function to be called for each expose event that occurs in this view. These events occur when an invisible part of the view is shown to the user (repaint notifications). You can set as many expose callbacks as you need. The last callback you set is the last to be called.
expose | The function that is called when Expose events occur in this view. | |
userArg | The user parameter that is transmitted to expose when it is called. |
void IlvView::setIconTitle | ( | const char * | title | ) |
Sets the iconified title of this view.
This function is meaningful only for top-window views.
title | The new icon title of this view. The string is copied. |
virtual void IlvView::setInputCallback | ( | IlvInputCallback | input, | |
IlAny | userArg = 0 | |||
) | [virtual] |
Sets a callback for Input events.
Specifies an IlvInputCallback
function to be called for each user event that occurs in this view. These events are all events but the destruction, the resize request and the repaint notification. You can set as many input callbacks as you need. The last callback you set is the last to be called.
input | The function that is called when Input events occur in this view. | |
userArg | The user parameter that is transmitted to input when it is called. |
Sets the maximum size of this view.
This function is meaningful only for top-window views.
Sets the maximum width and height of the window to the values w and h.
w | The width dimension to set. | |
h | The height dimension to set. |
Sets the minimum size of this view.
This function is meaningful only for top-window views.
It sets the minimum width and height of the window to the values w and h.
w | The width dimension to set. | |
h | The height dimension to set. |
virtual void IlvView::setName | ( | const char * | name | ) | [virtual] |
Sets the name.
name | The new name of this view. The string is copied. |
Sets or removes a property.
Sets the property key of the view to the value value. If value is 0
, the property is removed.
key | The property key. | |
value | The associated value to be set. If it is 0 , the property is removed. |
virtual void IlvView::setResizeCallback | ( | IlvResizeCallback | resize, | |
IlAny | userArg = 0 | |||
) | [virtual] |
Sets a callback for Resize events.
Specifies an IlvResizeCallback
function to be called for each resize event that occurs in this view, just after it occurred. You can set as many resize callbacks as you need. The last callback you set is the last to be called.
resize | The function that is called when Resize events occur in this view. | |
userArg | The user parameter that is transmitted to resize when it is called. |
Sets a shape mask.
This function is meaningful only for top-window views.
The mask is a bitmap whose transparency defines whether corresponding pixels of the window are visible or not.
An additional flag can be used to specify if the shape mask includes the window title or not (this value is meaningful only on Windows. On X-Window the title area is not accessible to the client).
mask | The bitmap to use as a mask. | |
useTitle | A Boolean value specifying whether the mask includes the title area. |
virtual void IlvView::setTitle | ( | const char * | title | ) | [virtual] |
Sets the title of the view.
This function is meaningful only for top-window views.
Note that if the title string begins with the "<code>&</code>" character, then it is considered as a multilingual string and is translated depending on the current language.
title | The new title of this view. The string is copied. |
virtual void IlvView::show | ( | ) | [virtual] |
Shows the view.
Displays the window on the screen. A window can be created in such a way that you cannot see it upon creation, which allows you to draw on that window before it is displayed.
Reimplemented from IlvAbstractView.
Reimplemented in IlvContainer.
virtual IlBoolean IlvView::showModal | ( | IlBoolean | doesGrab = ((IlBoolean) 0) , |
|
IlvCursor * | cursor = 0 | |||
) | [virtual] |
Shows the window in a modal mode.
This function is meaningful only for top-window views.
doesGrab | Must be set to IlTrue to get system modal behavior. If this parameter is set to IlFalse , the view uses the application modal behavior. Under Windows, system modality is in contradiction with the concept of multitasking. As a consequence, this parameter must not be set to IlTrue under Windows, this usage is not supported. | |
cursor | The cursor that must be set on this view when it is shown (only applicable with systemModal set to IlTrue ). |
IlTrue
on success. It returns IlFalse
if an error occurred, that is, one of the following conditions is satisfied: © Copyright 2012, 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.