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
A component that displays a single line of read-only text.
This is an abstract class and cannot be directly instantiated.
#include <toolkit/label.h>
public: | ||
// FlexLabel members | ||
enum | FlexLabelAlignment; | |
FlexLabel(); | ||
Result | AddTitleListener(TitleListenerInterface& listener); | |
FlexLabelAlignment | GetAlignment(void) const; | |
Dimension | GetPreferredSize(void) ; | // pure virtual |
const TCHAR * | GetText(void); | |
void | RemoveTitleListener(TitleListenerInterface& listener); | |
void | SetAlignment(const FlexLabelAlignment alignment); | |
void | SetText(const TCHAR *text); | |
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)); |
The FlexLabelAlignment enum is used to set and get the default alignment of the label text.
Declared as:
enum FlexLabelAlignment { FLA_LEFT, FLA_CENTER, FLA_RIGHT };
Class constructor.
Prototype:
FlexLabel();
Result AddTitleListener(TitleListenerInterface& listener);
Adds a TitleListener to receive draw events on the label. A TitleEvent is sent when the label needs to be drawn.
Parameters:
See also: RemoveTitleListener()
Prototype:
Result AddTitleListener(TitleListenerInterface& listener);
FlexLabelAlignment GetAlignment(void) const;
Returns the alignment of the label.
Return value: The alignment of the label.
See also: SetAlignment()
Prototype:
FlexLabelAlignment GetAlignment(void) const;
Dimension GetPreferredSize(void) ;
The GetPreferredSize method returns the preferred size of this component. The preferred size changes depending on the label text.
Return value: The preferred size of the label.
Prototype:
virtual Dimension GetPreferredSize(void) = 0;
The GetText method retrieves the label text.
Parameters:
Return value: A pointer to the label's text.
See also: SetText()
Prototype:
const TCHAR *GetText(void);
void RemoveTitleListener(TitleListenerInterface& listener);
Removes a TitleListener from this label component.
Parameters:
Prototype:
void RemoveTitleListener(TitleListenerInterface& listener);
void SetAlignment(const FlexLabelAlignment alignment);
Sets the alignment for this label to the specified alignment. Setting the alignment does not force a redraw of the component.
The default value is FLA_LEFT.
Parameters:
Prototype:
void SetAlignment(const FlexLabelAlignment alignment);
void SetText(const TCHAR *text);
The SetText method sets the label text. The user is responsible for maintaining the memory for the text. There is no maximum length for the new label text. Setting the text will cause the FlexLabel to repaint. NULL is a legal parameter and causes a repaint of the FlexLabel with no text.
Parameters:
Prototype:
void SetText(const TCHAR *text);