Class hierarchy Compound list Compound Members

# Component Class Reference

The base for all GUI components. More...

Inherited by BitmapComp and ColorPalette.

List of all members.

## Public Members

- Component (int ContainerOnly=0)
    Construct a component.

- virtual long add (World_Object* O)
    Add a component as a son.

- virtual Enumeration objects ()
    Return an enumeration of all this's immediate subcomponents.

- virtual Enumeration revObjects ()
    Return an enumeration of this's immmediate subcomponents in reverse order.

- virtual long clear ()
    Removes all subcomponents of this.

- virtual long setLayout (LayoutManager* P)
    Set the layout manager for the subcomponets of this.

- virtual long arrange ()
    Arrange the subcomponents using this's layout manager.

- virtual Component* getComponent (int x, int y)
    Returns a pointer to lowest level component (leaf) at the given coordinates (parent space).

- virtual long setMinimumSize (Vector2D& S)
    Set the minimum display size for this component.

- virtual Vector2D& getMinimumSize ()
    Get the minimum display size of this component.

- virtual long setPreferredSize (Vector2D& S)
    Set the preferred size of this component.

- virtual Vector2D& getPreferredSize ()
    Get the preferred size of this component.

- virtual long setDimension (Vector2D& D)
    Set the display size of this component.

- virtual long setDimension (int Width, int Height)
    Overloaded version of setDimension(Vector2D&).

- virtual Vector2D& getDimension ()
    Get the display size of this component.

- virtual Vector2D getSize ()
    Get the display size of this component.

- virtual int getWidth ()
    Get the display x-size of this component.

- virtual int getHeight ()
    Get the display y-size of this component.

- long pack ()
    Set this component's display size to its minimum.

- virtual void createInsets ()
    Called by getInsets() if no set of Insets has been created yet for this component.

- virtual Insets& getInsets ()
    Returns a reference to the Insets of this Component.

- virtual long setPosition (int x, int y)
    Set the position of this component in parent space.

- virtual long setPosition (Vector2D& P)
    Overloaded setPosition() for Vector2Ds.

- virtual int getX ()
    Return x-coordinate of this component position in parent space.

- virtual int getY ()
    Return y-coordinate of this component position in parent space.

- virtual long relocate (int dx, int dy)
    Move this component by a delta amount.

- virtual long relocate (Vector2D& d)
    Overloaded move for Vector2Ds.

- virtual int getRight ()
    Get rightmost coordinate of this component in parent space.

- virtual int getBottom ()
    Get bottommost coordinate of this component in parent space.

- virtual int isInside (int x, int y)
    Predicate that returns non-zero if the given coordinates (in parent space) are inside this component.

- virtual int isInside (Vector2D& P)
    Overloaded isInside() for Vector2Ds.

- virtual long render (View& view)
    Draws this component to the specified view.

- virtual long redraw ()
    Called by render() if this component has been invalidated.

- virtual long invalidate (int Recursive=0)
    This is called to "invalidate" this component.

- virtual long validate ()
    This is called by the default redraw() to reset this component's invalidation state.

- virtual long isValid ()
    This predicate returns non-zero if this component does not need to be redrawn.

- virtual long setVisible (int Visible)
    Set the visibility state for this component.

- virtual long isVisible ()
    This predicate returns the visibility state of this component.

- virtual void setBackColor (TColor Color, int Recursive=0)
    Set the background color of this component.

- virtual TColor getBackColor ()
    Returns the background color of this component.

- virtual void setFrontColor (TColor Color, int Recursive=0)
    Set the foreground color of this component.

- virtual TColor getFrontColor ()
    Returns the foreground color of this component.

- virtual long mouseDown (int x, int y, int Flags)
    Called when a "mouse down" event occurs within this component.

- virtual long mouseUp (int x, int y, int Flags)
    Called when a "mouse up" event occurs within this component.

- virtual long mouseMove (int x, int y, int Flags)
    Called when a "mouse move" event occurs within this component.

- virtual long mouseEnter (int x, int y, int Flags)
    Called when the mouse pointer is moved into this component.

- virtual long mouseExit (int x, int y, int Flags)
    Called when the mouse pointer is moved out of this component.

- virtual long mouseDrag (int x, int y, int Flags)
    Called when the mouse pointer is dragged (left button down during movement) within this component.

- virtual long keyDown (int Key, int Flags)
    Called when a "key down" event occurs while this component has the "focus".

- virtual long keyUp (int Key, int Flags)
    Called when a "key up" event occurs while this component has the "focus".

- virtual void enable ()
    Called to enable this component.

- virtual void disable ()
    Called to disable this component (prevents it from receiving input events.

- virtual long isEnabled ()
    This predicate returns non-zero if this component is "enabled".

- virtual long gotFocus ()
    Called to notify this component that it has received the input focus.

- virtual long lostFocus ()
    Notifies this component when it has lost the focus.

- virtual long hasFocus ()
    Predicate that will return non-zero if this component has the focus.

- virtual long requestFocus (Component* Son=NULL)
    This can be called by a component to request the focus (when Son == NULL).

- virtual void dump (ostream& os, int indent)
    Diagnostics utility.

## Detailed Description

The base for all GUI components.

Provides default behaviour.

## Member Function Documentation

### Component::Component(int ContainerOnly=0)

Construct a component.

If it is only a container, it will not have a look (bitmap).

### virtual long Component::add(World_Object* O)`[virtual]`

Add a component as a son.

### virtual Enumeration Component::objects()`[virtual]`

Return an enumeration of all this's immediate subcomponents.

### virtual Enumeration Component::revObjects()`[virtual]`

Return an enumeration of this's immmediate subcomponents in reverse order.

### virtual long Component::clear()`[virtual]`

Removes all subcomponents of this.

### virtual long Component::setLayout(LayoutManager* P)`[virtual]`

Set the layout manager for the subcomponets of this.

See GUI_Layout.h>

### virtual long Component::arrange()`[virtual]`

Arrange the subcomponents using this's layout manager.

### virtual Component* Component::getComponent(int x, int y)`[virtual]`

Returns a pointer to lowest level component (leaf) at the given coordinates (parent space).

### virtual long Component::setMinimumSize(Vector2D& S)`[virtual]`

Set the minimum display size for this component.

The layout manager of this's parent will not size this component below this limit.

### virtual Vector2D& Component::getMinimumSize()`[virtual]`

Get the minimum display size of this component.

### virtual long Component::setPreferredSize(Vector2D& S)`[virtual]`

Set the preferred size of this component.

The layout manager of this's parent will favor this size, but may shink this to fit within the parent.

### virtual Vector2D& Component::getPreferredSize()`[virtual]`

Get the preferred size of this component.

### virtual long Component::setDimension(Vector2D& D)`[virtual]`

Set the display size of this component.

Note that arrange() of the layout manager of this's parent may change this size according to the MinimumSize and PreferedSize constraints.

### virtual long Component::setDimension(int Width, int Height)`[virtual]`

Overloaded version of setDimension(Vector2D&).

### virtual Vector2D& Component::getDimension()`[virtual]`

Get the display size of this component.

### virtual Vector2D Component::getSize()`[virtual]`

Get the display size of this component.

Override for Object2D's method.

### virtual int Component::getWidth()`[virtual]`

Get the display x-size of this component.

### virtual int Component::getHeight()`[virtual]`

Get the display y-size of this component.

### long Component::pack()

Set this component's display size to its minimum.

### virtual void Component::createInsets()`[virtual]`

Called by getInsets() if no set of Insets has been created yet for this component.

See <GUI_Insets.h>

### virtual Insets& Component::getInsets()`[virtual]`

Returns a reference to the Insets of this Component.

### virtual long Component::setPosition(int x, int y)`[virtual]`

Set the position of this component in parent space.

### virtual long Component::setPosition(Vector2D& P)`[virtual]`

Overloaded setPosition() for Vector2Ds.

### virtual int Component::getX()`[virtual]`

Return x-coordinate of this component position in parent space.

### virtual int Component::getY()`[virtual]`

Return y-coordinate of this component position in parent space.

### virtual long Component::relocate(int dx, int dy)`[virtual]`

Move this component by a delta amount.

### virtual long Component::relocate(Vector2D& d)`[virtual]`

Overloaded move for Vector2Ds.

### virtual int Component::getRight()`[virtual]`

Get rightmost coordinate of this component in parent space.

### virtual int Component::getBottom()`[virtual]`

Get bottommost coordinate of this component in parent space.

### virtual int Component::isInside(int x, int y)`[virtual]`

Predicate that returns non-zero if the given coordinates (in parent space) are inside this component.

### virtual int Component::isInside(Vector2D& P)`[virtual]`

Overloaded isInside() for Vector2Ds.

### virtual long Component::render(View& view)`[virtual]`

Draws this component to the specified view.

### virtual long Component::redraw()`[virtual]`

Called by render() if this component has been invalidated.

Updates the bitmap (sprite) for this component.

Reimplemented in BitmapComp.

### virtual long Component::invalidate(int Recursive=0)`[virtual]`

This is called to "invalidate" this component.

It should be called if the compenent has changed its appearance and needs to be redrawn. If Recursive is non-zero, all subcomponents are invalidated also.

### virtual long Component::validate()`[virtual]`

This is called by the default redraw() to reset this component's invalidation state.

### virtual long Component::isValid()`[virtual]`

This predicate returns non-zero if this component does not need to be redrawn.

### virtual long Component::setVisible(int Visible)`[virtual]`

Set the visibility state for this component.

If Visible is zero, this component will not be drawn and will receive no input events.

### virtual long Component::isVisible()`[virtual]`

This predicate returns the visibility state of this component.

### virtual void Component::setBackColor(TColor Color, int Recursive=0)`[virtual]`

Set the background color of this component.

If Recursive is non-zero, the background color change is applied to all subcomponents also.

### virtual TColor Component::getBackColor()`[virtual]`

Returns the background color of this component.

### virtual void Component::setFrontColor(TColor Color, int Recursive=0)`[virtual]`

Set the foreground color of this component.

If Recursive is non-zero, the foreground color change is applied to all subcomponents also.

### virtual TColor Component::getFrontColor()`[virtual]`

Returns the foreground color of this component.

### virtual long Component::mouseDown(int x, int y, int Flags)`[virtual]`

Called when a "mouse down" event occurs within this component.

x & y specify the cotrrdinates of the event in parent space. See <GUI_Manager.h> for Flags.

### virtual long Component::mouseUp(int x, int y, int Flags)`[virtual]`

Called when a "mouse up" event occurs within this component.

### virtual long Component::mouseMove(int x, int y, int Flags)`[virtual]`

Called when a "mouse move" event occurs within this component.

### virtual long Component::mouseEnter(int x, int y, int Flags)`[virtual]`

Called when the mouse pointer is moved into this component.

### virtual long Component::mouseExit(int x, int y, int Flags)`[virtual]`

Called when the mouse pointer is moved out of this component.

### virtual long Component::mouseDrag(int x, int y, int Flags)`[virtual]`

Called when the mouse pointer is dragged (left button down during movement) within this component.

### virtual long Component::keyDown(int Key, int Flags)`[virtual]`

Called when a "key down" event occurs while this component has the "focus".

See <GUI_Manager.h> for Flags.

Reimplemented in BitmapComp.

### virtual long Component::keyUp(int Key, int Flags)`[virtual]`

Called when a "key up" event occurs while this component has the "focus".

See <GUI_Manager.h> for Flags.

### virtual void Component::enable()`[virtual]`

Called to enable this component.

A component must be enabled in order to receive input events.

### virtual void Component::disable()`[virtual]`

Called to disable this component (prevents it from receiving input events.

### virtual long Component::isEnabled()`[virtual]`

This predicate returns non-zero if this component is "enabled".

### virtual long Component::gotFocus()`[virtual]`

Called to notify this component that it has received the input focus.

### virtual long Component::lostFocus()`[virtual]`

Notifies this component when it has lost the focus.

### virtual long Component::hasFocus()`[virtual]`

Predicate that will return non-zero if this component has the focus.

### virtual long Component::requestFocus(Component* Son=NULL)`[virtual]`

This can be called by a component to request the focus (when Son == NULL).

If Son != NULL, focus is being requested by a descendant.

### virtual void Component::dump(ostream& os, int indent)`[virtual]`

Diagnostics utility.

Default writes to the given stream this component's typename and that of it's layout manager (if any) and then it is recursively invoked on its subcomponents with indent increased by 2.

The documentation for this class was generated from the following file:

- GUI_3D.h