Index: A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z
FlexContainer is the base class for all Toolkit objects that can have children.
#include <toolkit/containr.h>
public: | |
// FlexContainer members | |
FlexContainer(Boolean isVisible ); | |
~FlexContainer(void); | |
Result | Add(FlexComponent *child); |
Result | Add(FlexComponent *child, uint32 position); |
Result | Add(LayoutTagType tag, FlexComponent *child); |
Result | AddContainerListener(ContainerListenerInterface& listener); |
void | DoLayout(void); |
uint32 | FindFlexComponent(FlexComponent *child); |
FlexComponent * | GetFlexComponent(uint32 position); |
FlexComponent * | GetFlexComponent(uint32 position, LayoutTagType& tag); |
uint32 | GetFlexComponentCount(void); |
FlexComponent** | GetFlexComponents(void); |
FocusManagerInterface * | GetFocusManager(void); |
LayoutManagerInterface * | GetLayout(void); |
LayoutTagType | GetLayoutTag(uint32 position); |
Insets | GetInsets(void); |
Result | GetRelativeBounds(FlexComponent *descendant, WinRectangle &bounds); |
Result | GetRelativeLocation(FlexComponent *descendant, WinXYPoint point, WinXYPoint &location); |
Boolean | IsAncestorOf(FlexComponent *child); |
FlexComponent * | Remove(FlexComponent *child); |
FlexComponent * | Remove(uint32 position); |
void | RemoveAll(void); |
void | RemoveContainerListener(ContainerListenerInterface& listener); |
FocusManagerInterface * | RemoveFocusManager(void); |
LayoutManagerInterface * | RemoveLayout(void); |
void | SetFocusManager(FocusManagerInterface *focusManager); |
void | SetLayout(LayoutManagerInterface *layoutManager); |
void | SetLayoutTag(LayoutTagType tag, uint32 position); |
void | Validate(void); |
// Event processing methods | |
void | ProcessContainerEvent(ContainerEvent& containerEvent); |
protected: |
public: | ||
---|---|---|
// FlexComponent members | ||
enum | HorizontalSizePreference; | |
enum | VerticalSizePreference; | |
Result | AddComponentListener(ComponentListenerInterface& listener); | |
Result | AddFocusListener(FocusListenerInterface& listener); | |
Result | AddKeyListener(KeyListenerInterface& listener); | |
Result | AddMouseListener(MouseListenerInterface& listener); | |
Result | AddMouseMotionListener(MouseMotionListenerInterface& listener); | |
void | AddNotify(void); | |
Boolean | Contains(WinCoord x, WinCoord y); | |
Boolean | Contains(WinXYPoint& point); | |
void | DelayedDelete(void); | |
void | DoLayout(void); | |
Colorant | GetBackground(void); | |
WinRectangle | GetBounds(void) const; | |
FlexComponent * | GetComponentAt(WinCoord x, WinCoord y, Boolean visibleOnly ); | |
FlexComponent * | GetComponentAt(WinXYPoint& point, Boolean visibleOnly ); | |
Colorant | GetForeground(void); | |
FlexComponentID | GetID(void); | |
WinXYPoint | GetLocation(void); | |
Dimension | GetMinimumSize(void); | |
FlexContainer * | GetParent(void) const; | |
FlexWindow * | GetFlexWindowAncestor(void); | |
Dimension | GetPreferredSize(void); | |
Dimension | GetSize(void) const; | |
void | GetSizePreference(HorizontalSizePreference &horizontalSizePref, VerticalSizePreference &verticalSizePref); | |
void | Invalidate(void); | |
Boolean | IsEnabled(void) const; | |
Boolean | IsFocusTraversable(void); | |
Boolean | IsShowing(void) const; | |
Boolean | IsGeometryValid(void) const; | |
Boolean | IsVisible(void) const; | |
void | Paint(void); | |
void | RemoveComponentListener(ComponentListenerInterface& listener); | |
void | RemoveFocusListener(FocusListenerInterface& listener); | |
void | RemoveKeyListener(KeyListenerInterface& listener); | |
void | RemoveMouseListener(MouseListenerInterface& listener); | |
void | RemoveMouseMotionListener(MouseMotionListenerInterface& listener); | |
void | RemoveNotify(void); | |
void | Repaint(void); | |
void | Repaint(WinCoord x, WinCoord y, uint16 width, uint16 height); | |
void | RequestFocus(void); | |
Result | SetBackground(Colorant color); | |
void | SetBounds(WinCoord x, WinCoord y, uint16 width, uint16 height); | |
void | SetBounds(WinRectangle& rect); | |
void | SetEnabled(Boolean enable); | |
Result | SetForeground(Colorant color); | |
void | SetID(FlexComponentID id); | |
void | SetLocation(WinCoord x, WinCoord y); | |
void | SetLocation(const WinXYPoint& point); | |
void | SetSize(const Dimension& dimension); | |
void | SetSize(uint16 width, uint16 height); | |
void | SetSizePreference(HorizontalSizePreference horizontalSizePref, VerticalSizePreference verticalSizePref); | |
Result | SetVisible(Boolean visible); | |
void | TransferFocus(void); | |
void | Update(WinCoord x, WinCoord y, uint16 width, uint16 height); | |
void | Validate(void); | |
// Event processing methods | ||
void | ProcessActionEvent(ActionEvent& actionEvent); | |
void | ProcessComponentEvent(ComponentEvent& componentEvent); | |
void | ProcessFocusEvent(FocusEvent& focusEvent); | |
void | ProcessKeyEvent(KeyEvent& keyEvent); | |
void | ProcessMouseEvent(MouseEvent& mouseEvent); | |
void | ProcessMouseMotionEvent(MouseEvent& mouseEvent); | |
// Graphical rendering methods | ||
void * | CopyArea(const WinRectangle *bounds) const; | |
WinCoord | FontMetric( FontMetricInfo info, const TextState& textState ) const; | |
void | BrushLine( WinXYPoint p1, WinXYPoint p2, Colorant lineCOlor, WinCoord penWidth ); | |
void | DrawLine( WinXYPoint p1, WinXYPoint p2, Colorant lineColor ); | |
void | DrawHLine( WinCoord xStart, WinCoord xEnd, WinCoord yCoord, Colorant lineColor ); | |
void | DrawVLine( WinCoord xCoord, WinCoord yStart, WinCoord yEnd, Colorant lineColor); | |
void | DrawBitmap(const Bitmap& bitmap, WinXYPoint destUpLeft, Colorant color); | |
void | DrawBitmap(const Bitmap& bitmap, WinXYPoint destUpLeft); | |
void | DrawPoint( WinCoord xPos, WinCoord yPos, Colorant dotColor ); | |
void | DrawPoint( WinXYPoint point, Colorant dotColor ); | |
void | DrawString( const TCHAR string[], TextState& textState ); | |
void | DrawString( const TCHAR string[], int32 numChars, TextState& textState ); | |
void | DrawUIShape( const UIShape srcUIShape, const WinXYPoint& basePoint, Colorant fgColor, int16 parm0 , int16 parm1 , int16 parm2 , int16 parm3 ); | |
void | InvertUIShape( const UIShape srcUIShape, const WinXYPoint& basePoint, int16 parm0 , int16 parm1 , int16 parm2 , int16 parm3 ); | |
void | FillRect( WinCoord leftCorner, WinCoord topCorner, WinCoord rightCorner, WinCoord bottomCorner, Colorant fillColor ); | |
void | InvertRect( WinCoord leftCorner, WinCoord topCorner, WinCoord rightCorner, WinCoord bottomCorner ); | |
void | InvertLine( WinXYPoint p1, WinXYPoint p2 ); | |
void | InvertLine( WinCoord x1, WinCoord y1, WinCoord x2, WinCoord y2 ); | |
void | SetClipRect( const WinXYPoint& clipUpLeft, const WinXYPoint& clipLowRight ); | |
void | ClearClipRect(void); | |
void | Render(Renderer& renderer); | |
WinCoord | StringWidth( const TCHAR string[], const TextState& textState ) const; | |
WinCoord | StringWidth( const TCHAR string[], int32 numChars, const TextState& textState ) const; | |
protected: | ||
EC (static void EnsureInAppThread(void)); |
Back to the top of FlexContainer
Back to the top of FlexContainer
Back to the top of FlexContainer
USAGE
The FlexContainer destructor invokes SetVisible(FALSE) on each child and
removes it from the linkage, then invokes "delete" on each child. This
implies that if you have statically defined Flex objects under a
FlexContainer, you should manually remove them before the parent
FlexContainer is deleted, as otherwise the FlexContainer will try to
invoke "delete" on the statically defined object, yielding a run-time
error, a memory corruption, or some other undesirable result.
Back to the top of FlexContainer
Class constructor.
Parameters:
Prototype:
FlexContainer(Boolean isVisible = TRUE);
Back to the top of FlexContainer
Class destructor. This calls RemoveLayout() to unlink the layout manager if any (without deleting it). It also removes AND deletes all of the external children (children added via the public API).
If a subclass supports internal children, the destructor for the subclass should take care of removing and deleting them.
Prototype:
virtual ~FlexContainer(void);
Back to the top of FlexContainer
Result Add(FlexComponent *child);
Appends a child object to this container.
A child object can be added until the system runs out of memory or the maximun number of children (2^32-1) is reached.
This will invalidate the geometry of the container.
Parameters:
See also: Remove(), RemoveAll()
Prototype:
virtual Result Add(FlexComponent *child);
Back to the top of FlexContainer
Result Add(FlexComponent *child, uint32 position);
Adds a child object to this container at the specified position. If the position is larger than the number of components in the container, the new child is appended.
A child object can be added until the system runs out of memory or the maximun number of children (2^32-1) is reached.
This will invalidate the geometry of the container.
Parameters:
See also: Remove(), RemoveAll()
Prototype:
virtual Result Add(FlexComponent *child, uint32 position);
Back to the top of FlexContainer
Result Add(LayoutTagType tag, FlexComponent *child);
Adds a child object to this container using the specified layout tag.
Parameters:
See also: Remove(), RemoveAll()
Prototype:
virtual Result Add(LayoutTagType tag, FlexComponent *child);
Back to the top of FlexContainer
Result AddContainerListener(ContainerListenerInterface& listener);
Add a container listener to the FlexContainer object. The listener must be derived from ContainerListenerInterface in some form.
Parameters:
See also: RemoveContainerListener()
Prototype:
Result AddContainerListener(ContainerListenerInterface& listener);
Back to the top of FlexContainer
Lays out the container using the associated layout manager. This method has no effect if the container does not have a layout manager.
Application writers should avoid calling this method because it can interfere with the correct operation of the Geometry Management System.
This method is called when the container is validated as part of the Geometry Management Mechanism (an automated mechanism for keeping the UI properly laid out).
Specific UI writers may call this if a layout must be forced in order to solve some visual nuance problem.
See also: SetLayout(), GetLayout(), Validate()
Prototype:
virtual void DoLayout(void);
Back to the top of FlexContainer
uint32 FindFlexComponent(FlexComponent *child);
Finds the index of the specified child.
Parameters:
Prototype:
uint32 FindFlexComponent(FlexComponent *child);
Back to the top of FlexContainer
FlexComponent *GetFlexComponent(uint32 position);
Returns the component at the specified position.
Parameters:
See also: GetFlexComponents()
Prototype:
virtual FlexComponent *GetFlexComponent(uint32 position);
Back to the top of FlexContainer
FlexComponent *GetFlexComponent(uint32 position, LayoutTagType& tag);
Returns the component at the specified position.
The tag output parameter will contain the layout tag associated with the returned child. If there is no child at the specified position, the tag parameter will be NT_NULL (which is not to be interpreted as an error value).
Parameters:
See also: GetFlexComponents()
Prototype:
virtual FlexComponent *GetFlexComponent(uint32 position, LayoutTagType& tag);
Back to the top of FlexContainer
uint32 GetFlexComponentCount(void);
Gets the number of children in this container.
Return value: The number of children.
Prototype:
virtual uint32 GetFlexComponentCount(void);
Back to the top of FlexContainer
FlexComponent** GetFlexComponents(void);
Gets a list of all children in the container. This list is in the form of an array of FlexComponent pointers. The caller must free the array.
Return value: The array of FlexComponent pointers, or NULL if the container has no children.
See also: GetFlexComponent()
Prototype:
virtual FlexComponent** GetFlexComponents(void);
Back to the top of FlexContainer
FocusManagerInterface *GetFocusManager(void);
Gets the focus manager used by this container.
Return value: A pointer to the focus manager, or NULL if no focus manager is in use by the container.
Prototype:
FocusManagerInterface *GetFocusManager(void);
Back to the top of FlexContainer
LayoutManagerInterface *GetLayout(void);
Gets the layout manager used by this container.
Return value: A pointer to the layout manager, or NULL if no layout manager is in use.
See also: SetLayout(), DoLayout()
Prototype:
LayoutManagerInterface *GetLayout(void);
Back to the top of FlexContainer
LayoutTagType GetLayoutTag(uint32 position);
Returns the layout tag for the component at the specified position.
Parameters:
See also: SetLayoutTag(), Add()
Prototype:
LayoutTagType GetLayoutTag(uint32 position);
Back to the top of FlexContainer
Gets the Insets used by this container. Insets are the border spaces at the top, left, right, and bottom edges of a container. These spaces are usually reserved for the FlexUI to draw the container`s title bar, menu bar, and visible borders.
Note: The insets value is set by the specific user interface and cannot be changed by the application writer.
Return value: Insets object.
Prototype:
virtual Insets GetInsets(void);
Back to the top of FlexContainer
Result GetRelativeBounds(FlexComponent *descendant, WinRectangle &bounds);
Converts the bounds of a descendant into bounds relative to this container. A descendant is a component that is our child or a descendant of a child.
Parameters:
Prototype:
Result GetRelativeBounds(FlexComponent *descendant, WinRectangle &bounds);
Back to the top of FlexContainer
Result GetRelativeLocation(FlexComponent *descendant, WinXYPoint point, WinXYPoint &location);
Converts a location relative to a descendant into a location relative to this container. A descendant is a component that is our child or a descendant of a child.
Parameters:
Prototype:
Result GetRelativeLocation(FlexComponent *descendant, WinXYPoint point, WinXYPoint &location);
Back to the top of FlexContainer
Boolean IsAncestorOf(FlexComponent *child);
Finds out if the specified component lies somewhere within this container`s child hierarchy (not necessarily as a direct child).
Parameters:
Prototype:
virtual Boolean IsAncestorOf(FlexComponent *child);
Back to the top of FlexContainer
FlexComponent *Remove(FlexComponent *child);
Removes a child from this container. This will invalidate the geometry of the container and the removed child.
Parameters:
Prototype:
virtual FlexComponent *Remove(FlexComponent *child);
Back to the top of FlexContainer
FlexComponent *Remove(uint32 position);
Removes the child at the specified position from this container. This will invalidate the geometry of the container and the removed child.
Parameters:
Prototype:
virtual FlexComponent *Remove(uint32 position);
Back to the top of FlexContainer
Removes all children from this container. This will invalidate the geometry of the container and the removed children.
Prototype:
virtual void RemoveAll(void);
Back to the top of FlexContainer
void RemoveContainerListener(ContainerListenerInterface& listener);
Remove a container listener that has been added to this FlexContainer.
Parameters:
See also: AddContainerListener()
Prototype:
void RemoveContainerListener(ContainerListenerInterface& listener);
Back to the top of FlexContainer
FocusManagerInterface *RemoveFocusManager(void);
If this container has a focus manager, this method removes it and returns a pointer to it. This method does not delete the focus manager. It is the responsibility of the client using a container to free any focus managers allocated by that client.
Containers created through the UI factory might have a default focus manager. A client can remove this focus manager and replace it without having to delete the default focus manager. The UI factory will track and delete any focus managers that are provided by default.
Return value: A pointer to the focus manager that was removed, or NULL if the container does not have one.
Prototype:
FocusManagerInterface *RemoveFocusManager(void);
Back to the top of FlexContainer
LayoutManagerInterface *RemoveLayout(void);
If this container has a layout manager, this method removes it and returns a pointer to it. This method does not delete the layout manager. It is the responsibility of the client using a container to free any layout managers allocated by that client.
Containers created through the UI factory might have a default layout manager. A client can remove this layout manager and replace it without having to delete the default layout manager. The UI factory will track and delete any layout managers that are provided by default.
Return value: A pointer to the layout manager that was removed, or NULL if the container does not have one.
See also: SetLayout(), GetLayout(), DoLayout()
Prototype:
LayoutManagerInterface *RemoveLayout(void);
Back to the top of FlexContainer
void SetFocusManager(FocusManagerInterface *focusManager);
Sets the focus manager used by this container. This has no effect if the container already has a focus manager. You must remove an existing focus manager before setting a new one.
Parameters:
Prototype:
void SetFocusManager(FocusManagerInterface *focusManager);
Back to the top of FlexContainer
void SetLayout(LayoutManagerInterface *layoutManager);
Sets the layout manager used by this container. This has no effect if the container already has a layout manager. You must remove an existing layout manager before setting a new one.
Parameters:
Prototype:
void SetLayout(LayoutManagerInterface *layoutManager);
Back to the top of FlexContainer
void SetLayoutTag(LayoutTagType tag, uint32 position);
Sets the layout tag for the component at the specified position.
Parameters:
Prototype:
void SetLayoutTag(LayoutTagType tag, uint32 position);
Back to the top of FlexContainer
Validates this FlexContainer and all of its children. When a container is validated, its DoLayout() method is called.
Application writers should avoid calling this method because it can interfere with the correct operation of the Geometry Management System.
This method is called by the Geometry Management Mechanism (an automated mechanism for keeping the UI laid out properly).
See also: FlexComponent::Invalidate(), DoLayout()
Prototype:
virtual void Validate(void);
Back to the top of FlexContainer
void ProcessContainerEvent(ContainerEvent& containerEvent);
Process the container event for this container, passing the events to any registered ContainerEvent listeners.
Parameters:
Prototype:
virtual void ProcessContainerEvent(ContainerEvent& containerEvent);
Back to the top of FlexContainer