NXWidgets  1.19
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
NXWidgets::CGlyphButton Class Reference

#include <cglyphbutton.hxx>

Inheritance diagram for NXWidgets::CGlyphButton:
Inheritance graph

Public Member Functions

 CGlyphButton (CWidgetControl *pWidgetControl, nxgl_coord_t x, nxgl_coord_t y, nxgl_coord_t width, nxgl_coord_t height, nxgl_coord_t bitmapX, nxgl_coord_t bitmapY, FAR const struct SBitmap *normalGlyph, FAR const struct SBitmap *clickedGlyph, CWidgetStyle *style=(CWidgetStyle *) NULL)
 
virtual ~CGlyphButton (void)
 
virtual void getPreferredDimensions (CRect &rect) const
 
- Public Member Functions inherited from NXWidgets::CNxWidget
 CNxWidget (CWidgetControl *pWidgetControl, nxgl_coord_t x, nxgl_coord_t y, nxgl_coord_t width, nxgl_coord_t height, uint32_t flags, FAR const CWidgetStyle *style=(FAR const CWidgetStyle *) NULL)
 
virtual ~CNxWidget (void)
 
nxgl_coord_t getX (void) const
 
nxgl_coord_t getY (void) const
 
nxgl_coord_t getRelativeX (void) const
 
nxgl_coord_t getRelativeY (void) const
 
bool hasFocus (void) const
 
bool isDeleted (void) const
 
bool isDrawingEnabled (void) const
 
bool isHidden (void) const
 
bool isEnabled (void) const
 
bool isPermeable (void) const
 
bool isDoubleClickable (void) const
 
bool isBorderless (void) const
 
bool isClicked (void) const
 
bool isBeingDragged (void) const
 
nxgl_coord_t getWidth (void) const
 
nxgl_coord_t getHeight (void) const
 
void getSize (struct nxgl_size_s &size) const
 
void getPos (struct nxgl_point_s &pos) const
 
CRect getBoundingBox (void)
 
void getBorderSize (WidgetBorderSize &borderSize)
 
CNxWidgetgetParent (void) const
 
CNxWidgetgetFocusedWidget (void)
 
void getClientRect (CRect &rect) const
 
void getRect (CRect &rect) const
 
CNxFontgetFont (void) const
 
nxgl_mxpixel_t getBackgroundColor (void) const
 
nxgl_mxpixel_t getSelectedBackgroundColor (void) const
 
nxgl_mxpixel_t getShineEdgeColor (void) const
 
nxgl_mxpixel_t getShadowEdgeColor (void) const
 
nxgl_mxpixel_t getHighlightColor (void) const
 
nxgl_mxpixel_t getDisabledTextColor (void) const
 
nxgl_mxpixel_t getEnabledTextColor (void) const
 
nxgl_mxpixel_t getSelectedTextColor (void) const
 
const CWidgetStylegetWidgetStyle () const
 
void setBorderless (bool isBorderless)
 
void setDraggable (bool isDraggable)
 
void setPermeable (bool permeable)
 
void setDoubleClickable (bool doubleClickable)
 
void addWidgetEventHandler (CWidgetEventHandler *eventHandler)
 
void removeWidgetEventHandler (CWidgetEventHandler *eventHandler)
 
int nWidgetEventHandlers (void) const
 
void setRaisesEvents (bool raises)
 
bool raisesEvents (void) const
 
void disableDrawing (void)
 
void enableDrawing (void)
 
void setBackgroundColor (nxgl_mxpixel_t color)
 
void setSelectedBackgroundColor (nxgl_mxpixel_t color)
 
void setShineEdgeColor (nxgl_mxpixel_t color)
 
void setShadowEdgeColor (nxgl_mxpixel_t color)
 
void setHighlightColor (nxgl_mxpixel_t color)
 
void setDisabledTextColor (nxgl_mxpixel_t color)
 
void setEnabledTextColor (nxgl_mxpixel_t color)
 
void setSelectedTextColor (nxgl_mxpixel_t color)
 
virtual void setFont (CNxFont *font)
 
void redraw (void)
 
bool enable (void)
 
bool disable (void)
 
void close (void)
 
bool show (void)
 
bool hide (void)
 
virtual bool click (nxgl_coord_t x, nxgl_coord_t y)
 
virtual bool isDoubleClick (nxgl_coord_t x, nxgl_coord_t y)
 
bool doubleClick (nxgl_coord_t x, nxgl_coord_t y)
 
bool release (nxgl_coord_t x, nxgl_coord_t y)
 
bool drag (nxgl_coord_t x, nxgl_coord_t y, nxgl_coord_t vX, nxgl_coord_t vY)
 
bool keyPress (nxwidget_char_t key)
 
bool cursorControl (ECursorControl control)
 
bool focus (void)
 
bool blur (void)
 
bool moveTo (nxgl_coord_t x, nxgl_coord_t y)
 
bool resize (nxgl_coord_t width, nxgl_coord_t height)
 
bool changeDimensions (nxgl_coord_t x, nxgl_coord_t y, nxgl_coord_t width, nxgl_coord_t height)
 
void moveChildToDeleteQueue (CNxWidget *widget)
 
void setFocusedWidget (CNxWidget *widget)
 
virtual bool checkCollision (nxgl_coord_t x, nxgl_coord_t y) const
 
virtual bool checkCollision (nxgl_coord_t x, nxgl_coord_t y, nxgl_coord_t width, nxgl_coord_t height) const
 
bool checkCollision (CNxWidget *widget) const
 
void addWidget (CNxWidget *widget)
 
void insertWidget (CNxWidget *widget)
 
void setParent (CNxWidget *parent)
 
void destroy (void)
 
bool remove (void)
 
bool removeChild (CNxWidget *widget)
 
const CNxWidgetgetChild (int index) const
 
int getChildCount (void) const
 
void setBorderSize (const WidgetBorderSize &borderSize)
 

Protected Member Functions

virtual void drawContents (CGraphicsPort *port)
 
virtual void drawBorder (CGraphicsPort *port)
 
virtual void drawOutline (CGraphicsPort *port)
 
virtual void onClick (nxgl_coord_t x, nxgl_coord_t y)
 
virtual void onPreRelease (nxgl_coord_t x, nxgl_coord_t y)
 
virtual void onRelease (nxgl_coord_t x, nxgl_coord_t y)
 
virtual void onReleaseOutside (nxgl_coord_t x, nxgl_coord_t y)
 
 CGlyphButton (const CGlyphButton &button)
 
- Protected Member Functions inherited from NXWidgets::CNxWidget
void useWidgetStyle (const CWidgetStyle *style)
 
void drawChildren (void)
 
void closeChild (CNxWidget *widget)
 
void startDragging (nxgl_coord_t x, nxgl_coord_t y)
 
void stopDragging (nxgl_coord_t x, nxgl_coord_t y)
 
 CNxWidget (const CNxWidget &widget)
 
virtual void onDoubleClick (nxgl_coord_t x, nxgl_coord_t y)
 
virtual void onDrag (nxgl_coord_t x, nxgl_coord_t y, nxgl_coord_t vX, nxgl_coord_t vY)
 
virtual void onDragStart (void)
 
virtual void onDragStop (void)
 
virtual void onFocus (void)
 
virtual void onBlur (void)
 
virtual void onEnable (void)
 
virtual void onDisable (void)
 
virtual void onResize (nxgl_coord_t width, nxgl_coord_t height)
 

Protected Attributes

FAR const struct SBitmapm_bitmapNormal
 
FAR const struct SBitmapm_bitmapClicked
 
nxgl_coord_t m_bitmapX
 
nxgl_coord_t m_bitmapY
 
- Protected Attributes inherited from NXWidgets::CNxWidget
CWidgetControlm_widgetControl
 
CRect m_rect
 
nxgl_coord_t m_grabPointX
 
nxgl_coord_t m_grabPointY
 
nxgl_coord_t m_newX
 
nxgl_coord_t m_newY
 
CWidgetStyle m_style
 
Flags m_flags
 
CWidgetEventHandlerListm_widgetEventHandlers
 
struct timespec m_lastClickTime
 
nxgl_coord_t m_lastClickX
 
nxgl_coord_t m_lastClickY
 
int m_doubleClickBounds
 
CNxWidgetm_parent
 
CNxWidgetm_focusedChild
 
TNxArray< CNxWidget * > m_children
 
WidgetBorderSize m_borderSize
 

Additional Inherited Members

- Public Types inherited from NXWidgets::CNxWidget
enum  WidgetFlagType {
  WIDGET_BORDERLESS = 0x0001, WIDGET_DRAGGABLE = 0x0002, WIDGET_PERMEABLE = 0x0004, WIDGET_DOUBLE_CLICKABLE = 0x0008,
  WIDGET_NO_RAISE_EVENTS = 0x0010
}
 

Detailed Description

Class representing a button that will display a glyph. Class representing a clickable button that contains a bitmap image instead of text. Displays two bitmaps, one when the button is clicked, and one when it isn't. The bitmaps should be the same size.

Definition at line 113 of file cglyphbutton.hxx.

Constructor & Destructor Documentation

◆ CGlyphButton() [1/2]

NXWidgets::CGlyphButton::CGlyphButton ( const CGlyphButton button)
inlineprotected

Copy constructor is protected to prevent usage.

Definition at line 189 of file cglyphbutton.hxx.

◆ CGlyphButton() [2/2]

CGlyphButton::CGlyphButton ( CWidgetControl pWidgetControl,
nxgl_coord_t  x,
nxgl_coord_t  y,
nxgl_coord_t  width,
nxgl_coord_t  height,
nxgl_coord_t  bitmapX,
nxgl_coord_t  bitmapY,
FAR const struct SBitmap normalGlyph,
FAR const struct SBitmap clickedGlyph,
CWidgetStyle style = (CWidgetStyle *)NULL 
)

Constructor.

Parameters
pWidgetControlThe widget control for the display.
xThe x coordinate of the button.
yThe y coordinate of the button.
widthThe width of the button.
heightThe height of the button.
normalGlyphGlyph to display when unclicked.
clickedGlyphGlyph to display when clicked.
bitmapXThe x coordinate at which the bitmaps will be drawn.
bitmapYThe y coordinate at which the bitmaps will be drawn.
styleThe style that the button should use. If this is not specified, the button will use the values stored in the global g_defaultWidgetStyle object. The button will copy the properties of the style into its own internal style object.

Definition at line 116 of file cglyphbutton.cxx.

◆ ~CGlyphButton()

virtual NXWidgets::CGlyphButton::~CGlyphButton ( void  )
inlinevirtual

Destructor.

Definition at line 223 of file cglyphbutton.hxx.

Member Function Documentation

◆ drawBorder()

void CGlyphButton::drawBorder ( CGraphicsPort port)
protectedvirtual

Draw the area of this widget that falls within the clipping region. Called by the redraw() function to draw all visible regions.

Parameters
portThe CGraphicsPort to draw to.
See also
redraw()

Reimplemented from NXWidgets::CNxWidget.

Definition at line 217 of file cglyphbutton.cxx.

◆ drawContents()

void CGlyphButton::drawContents ( CGraphicsPort port)
protectedvirtual

Draw the area of this widget that falls within the clipping region. Called by the redraw() function to draw all visible regions.

Parameters
portThe CGraphicsPort to draw to.
See also
redraw()

Reimplemented from NXWidgets::CNxWidget.

Definition at line 173 of file cglyphbutton.cxx.

◆ drawOutline()

void CGlyphButton::drawOutline ( CGraphicsPort port)
protectedvirtual
Parameters
portGraphics port to draw to.

Draws the outline of the button.

Parameters
portGraphics port to draw to.

Definition at line 230 of file cglyphbutton.cxx.

◆ getPreferredDimensions()

void CGlyphButton::getPreferredDimensions ( CRect rect) const
virtual

Insert the dimensions that this widget wants to have into the rect passed in as a parameter. All coordinates are relative to the widget's parent.

Parameters
rectReference to a rect to populate with data.

Reimplemented from NXWidgets::CNxWidget.

Definition at line 148 of file cglyphbutton.cxx.

◆ onClick()

void CGlyphButton::onClick ( nxgl_coord_t  x,
nxgl_coord_t  y 
)
protectedvirtual

Redraws the button.

Parameters
xThe x coordinate of the click.
yThe y coordinate of the click.

Reimplemented from NXWidgets::CNxWidget.

Definition at line 269 of file cglyphbutton.cxx.

◆ onPreRelease()

void CGlyphButton::onPreRelease ( nxgl_coord_t  x,
nxgl_coord_t  y 
)
protectedvirtual

Raises an action event.

Parameters
xThe x coordinate of the mouse.
yThe y coordinate of the mouse.

Reimplemented from NXWidgets::CNxWidget.

Definition at line 281 of file cglyphbutton.cxx.

◆ onRelease()

void CGlyphButton::onRelease ( nxgl_coord_t  x,
nxgl_coord_t  y 
)
protectedvirtual

Raises a release event and redraws the button.

Parameters
xThe x coordinate of the mouse.
yThe y coordinate of the mouse.

Reimplemented from NXWidgets::CNxWidget.

Definition at line 293 of file cglyphbutton.cxx.

◆ onReleaseOutside()

void CGlyphButton::onReleaseOutside ( nxgl_coord_t  x,
nxgl_coord_t  y 
)
protectedvirtual

Redraws the button.

Parameters
xThe x coordinate of the mouse.
yThe y coordinate of the mouse.

Reimplemented from NXWidgets::CNxWidget.

Definition at line 306 of file cglyphbutton.cxx.

Member Data Documentation

◆ m_bitmapClicked

FAR const struct SBitmap* NXWidgets::CGlyphButton::m_bitmapClicked
protected

Bitmap when button is clicked

Definition at line 118 of file cglyphbutton.hxx.

◆ m_bitmapNormal

FAR const struct SBitmap* NXWidgets::CGlyphButton::m_bitmapNormal
protected

Bitmap when button is not clicked

Definition at line 117 of file cglyphbutton.hxx.

◆ m_bitmapX

nxgl_coord_t NXWidgets::CGlyphButton::m_bitmapX
protected

X coordinate of the bitmaps

Definition at line 119 of file cglyphbutton.hxx.

◆ m_bitmapY

nxgl_coord_t NXWidgets::CGlyphButton::m_bitmapY
protected

Y coordinate of the bitmaps

Definition at line 120 of file cglyphbutton.hxx.


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