NXWidgets: NXWidgets::CNxToolbar Class Reference

NXWidgets 1.19

Public Member Functions | Private Attributes | List of all members
NXWidgets::CNxToolbar Class Reference

`#include <cnxtoolbar.hxx>`

Inheritance diagram for NXWidgets::CNxToolbar:

## Public Member Functions
| CNxToolbar (CNxTkWindow *pNxTkWindow, NXTKWINDOW hNxTkWindow, CWidgetControl *pWidgetControl, nxgl_coord_t height)
| ~CNxToolbar (void)
bool | open (void)
CWidgetControl * | getWidgetControl (void) const
bool | requestPosition (void)
bool | getPosition (FAR struct nxgl_point_s *pPos)
bool | getSize (FAR struct nxgl_size_s *pSize)
bool | setPosition (FAR const struct nxgl_point_s *pPos)
bool | setSize (FAR const struct nxgl_size_s *pSize)
bool | raise (void)
bool | lower (void)
void | redirectNxTerm (NXTERM handle)
bool | setPixel (FAR const struct nxgl_point_s *pPos, nxgl_mxpixel_t color)
bool | fill (FAR const struct nxgl_rect_s *pRect, nxgl_mxpixel_t color)
void | getRectangle (FAR const struct nxgl_rect_s *rect, struct SBitmap *dest)
bool | fillTrapezoid (FAR const struct nxgl_rect_s *pClip, FAR const struct nxgl_trapezoid_s *pTrap, nxgl_mxpixel_t color)
bool | drawLine (FAR struct nxgl_vector_s *vector, nxgl_coord_t width, nxgl_mxpixel_t color, enum ELineCaps caps)
bool | drawFilledCircle (struct nxgl_point_s *center, nxgl_coord_t radius, nxgl_mxpixel_t color)
bool | move (FAR const struct nxgl_rect_s *pRect, FAR const struct nxgl_point_s *pOffset)
bool | bitmap (FAR const struct nxgl_rect_s *pDest, FAR const void *pSrc, FAR const struct nxgl_point_s *pOrigin, unsigned int stride)
Public Member Functions inherited from NXWidgets::INxWindow
virtual | ~INxWindow (void)

## Private Attributes
CNxTkWindow * | m_nxTkWindow
NXTKWINDOW | m_hNxTkWindow
CWidgetControl * | m_widgetControl
nxgl_coord_t | m_height

## Additional Inherited Members
Public Types inherited from NXWidgets::INxWindow
enum | ELineCaps { LINECAP_NONE = NX_LINECAP_NONE, LINECAP_PT1 = NX_LINECAP_PT1, LINECAP_PT2 = NX_LINECAP_PT2, LINECAP_BOTH = NX_LINECAP_BOTH }
Protected Types inherited from NXWidgets::INxWindow
enum | ELineCaps { LINECAP_NONE = NX_LINECAP_NONE, LINECAP_PT1 = NX_LINECAP_PT1, LINECAP_PT2 = NX_LINECAP_PT2, LINECAP_BOTH = NX_LINECAP_BOTH }
Protected Member Functions inherited from NXWidgets::CCallback
| CCallback (CWidgetControl *widgetControl)
| ~CCallback (void)
FAR struct nx_callback_s * | getCallbackVTable (void)
void | setNxTerm (NXTERM handle)
Protected Member Functions inherited from NXWidgets::INxWindow
virtual | ~INxWindow (void)

## Detailed Description

This class defines operations on a the toolbar in a framed NX window. There are three instances that represent an NX window from the perspective of NXWidgets.

- There is one widget control instance per NX window,
- One CCallback instance per window,
- One window instance.

There a various kinds of of window instances, but each inherits (1) CCallback and dispatches the Windows callbacks and (2) INxWindow that describes the common window behavior.

Definition at line 85 of file cnxtoolbar.hxx.

## Constructor & Destructor Documentation

## ◆ CNxToolbar()

CNxToolbar::CNxToolbar | ( | CNxTkWindow * | pNxTkWindow,
|  | NXTKWINDOW | hNxTkWindow,
|  | CWidgetControl * | pWidgetControl,
|  | nxgl_coord_t | height
| ) |  |

Constructor. Creates an uninitialized instance of the CNxToolbar object. The open() method must be called to initialize the instance.

Parameters

  pNxTkWindow | Parent framed window instance
  hNxTkWindow | Parent framed window NX handler
  widgetControl | Controlling widget for this toolbar.
  height | The height of the toolbar.

Constructor.

Parameters

  pNxTkWindow | Parent framed window instance
  hNxTkWindow | Parent framed window NX handler
  widgetControl | Controlling widget for this toolbar.
  height | The height of the toolbar.

Definition at line 68 of file cnxtoolbar.cxx.

## ◆ ~CNxToolbar()

CNxToolbar::~CNxToolbar | ( | void |  | ) |

Destructor.

Definition at line 88 of file cnxtoolbar.cxx.

## Member Function Documentation

## ◆ bitmap()

bool CNxToolbar::bitmap | ( | FAR const struct nxgl_rect_s * | pDest,
|  | FAR const void * | pSrc,
|  | FAR const struct nxgl_point_s * | pOrigin,
|  | unsigned int | stride
| ) |  |
| virtual

Copy a rectangular region of a larger image into the rectangle in the specified toolbar.

Parameters

  pDest | Describes the rectangular on the display that will receive the bitmap.
  pSrc | The start of the source image.
  pOrigin | the pOrigin of the upper, left-most corner of the full bitmap. Both pDest and pOrigin are in toolbar coordinates, however, pOrigin may lie outside of the display.
  stride | The width of the full source image in bytes.

Returns
  True on success; false on failure.

Copy a rectangular region of a larger image into the rectangle in the specified toolbar. The source image is treated as an opaque image.

Parameters

  pDest | Describes the rectangular on the display that will receive the bitmap.
  pSrc | The start of the source image.
  pOrigin | the pOrigin of the upper, left-most corner of the full bitmap. Both pDest and pOrigin are in toolbar coordinates, however, pOrigin may lie outside of the display.
  stride | The width of the full source image in bytes.

Returns
  True on success; false on failure.

Implements NXWidgets::INxWindow.

Definition at line 377 of file cnxtoolbar.cxx.

## ◆ drawFilledCircle()

bool CNxToolbar::drawFilledCircle | ( | struct nxgl_point_s * | center,
|  | nxgl_coord_t | radius,
|  | nxgl_mxpixel_t | color
| ) |  |
| virtual

Draw a filled circle at the specified position, size, and color.

Parameters

  center | The window-relative coordinates of the circle center.
  radius | The radius of the rectangle in pixels.
  color | The color of the rectangle.

Implements NXWidgets::INxWindow.

Definition at line 339 of file cnxtoolbar.cxx.

## ◆ drawLine()

bool CNxToolbar::drawLine | ( | FAR struct nxgl_vector_s * | vector,
|  | nxgl_coord_t | width,
|  | nxgl_mxpixel_t | color,
|  | enum ELineCaps | caps
| ) |  |
| virtual

Fill the specified line in the toolbar with the specified color.

Parameters

  vector | - Describes the line to be drawn
  width | - The width of the line
  color | - The color to use to fill the line
  caps | - Draw a circular cap on the ends of the line to suppor better line joins

Returns
  True on success; false on failure.

Fill the specified line in the toolbar with the specified color.

Parameters

  vector | - Describes the line to be drawn
  width | - The width of the line
  color | - The color to use to fill the line
  caps | - Draw a circular cap on the ends of the line to support better line joins

Returns
  True on success; false on failure.

Implements NXWidgets::INxWindow.

Definition at line 322 of file cnxtoolbar.cxx.

## ◆ fill()

bool CNxToolbar::fill | ( | FAR const struct nxgl_rect_s * | pRect,
|  | nxgl_mxpixel_t | color
| ) |  |
| virtual

Fill the specified rectangle in the toolbar with the specified color.

Parameters

  pRect | The location to be filled.
  color | The color to use in the fill.

Returns
  True on success; false on failure.

Implements NXWidgets::INxWindow.

Definition at line 264 of file cnxtoolbar.cxx.

## ◆ fillTrapezoid()

bool CNxToolbar::fillTrapezoid | ( | FAR const struct nxgl_rect_s * | pClip,
|  | FAR const struct nxgl_trapezoid_s * | pTrap,
|  | nxgl_mxpixel_t | color
| ) |  |
| virtual

Fill the specified trapezoidal region in the toolbar with the specified color.

Parameters

  pClip | Clipping rectangle relative to toolbar (may be null).
  pTrap | The trapezoidal region to be filled.
  color | The color to use in the fill.

Returns
  True on success; false on failure.

Implements NXWidgets::INxWindow.

Definition at line 301 of file cnxtoolbar.cxx.

## ◆ getPosition()

bool CNxToolbar::getPosition | ( | FAR struct nxgl_point_s * | pPos | ) |
| virtual

Get the position of the toolbar (as reported by the NX callback).

Returns
  The position.

Get the position of the toolbar in the physical display coordinates (as reported by the NX callback).

Returns
  The position.

Implements NXWidgets::INxWindow.

Definition at line 164 of file cnxtoolbar.cxx.

## ◆ getRectangle()

void CNxToolbar::getRectangle | ( | FAR const struct nxgl_rect_s * | rect,
|  | struct SBitmap * | dest
| ) |  |
| virtual

Get the raw contents of graphic memory within a rectangular region. NOTE: Since raw graphic memory is returned, the returned memory content may be the memory of windows above this one and may not necessarily belong to this window unless you assure that this is the top window.

Parameters

  rect | The location to be copied
  dest | - The describes the destination bitmap to receive the graphics data.

Implements NXWidgets::INxWindow.

Definition at line 283 of file cnxtoolbar.cxx.

## ◆ getSize()

bool CNxToolbar::getSize | ( | FAR struct nxgl_size_s * | pSize | ) |
| virtual

Get the size of the toolbar (as reported by the NX callback).

Returns
  The size.

Implements NXWidgets::INxWindow.

Definition at line 175 of file cnxtoolbar.cxx.

## ◆ getWidgetControl()

CWidgetControl * CNxToolbar::getWidgetControl | ( | void |  | ) | const
| virtual

Each implementation of INxWindow must provide a method to recover the contained CWidgetControl instance.

Returns
  The contained CWidgetControl instance

Implements NXWidgets::INxWindow.

Definition at line 133 of file cnxtoolbar.cxx.

## ◆ lower()

bool CNxToolbar::lower | ( | void |  | ) |
| virtual

Lower the toolbar to the bottom of the display. The toolbar is a component of the containing, parent, framed window. It cannot be lowered separately.

Returns
  Always returns false.

Lower the toolbar to the bottom of the display. The toolbar is a component of the containing, parent, framed window. It cannot be raised separately.

Returns
  Always returns false.

Implements NXWidgets::INxWindow.

Definition at line 228 of file cnxtoolbar.cxx.

## ◆ move()

bool CNxToolbar::move | ( | FAR const struct nxgl_rect_s * | pRect,
|  | FAR const struct nxgl_point_s * | pOffset
| ) |  |
| virtual

Move a rectangular region within the toolbar.

Parameters

  pRect | Describes the rectangular region to move.
  pOffset | The offset to move the region.

Returns
  True on success; false on failure.

Implements NXWidgets::INxWindow.

Definition at line 354 of file cnxtoolbar.cxx.

## ◆ open()

bool CNxToolbar::open | ( | void |  | ) |
| virtual

Creates a new toolbar. Toolbar creation is separate from object instantiation so that failures can be reported.

Returns
  True if the toolbar was successfully created.

Implements NXWidgets::INxWindow.

Definition at line 113 of file cnxtoolbar.cxx.

## ◆ raise()

bool CNxToolbar::raise | ( | void |  | ) |
| virtual

Bring the toolbar to the top of the display. The toolbar is a component of the containing, parent, framed window. It cannot be raised separately.

Returns
  Always returns false.

Implements NXWidgets::INxWindow.

Definition at line 215 of file cnxtoolbar.cxx.

## ◆ redirectNxTerm()

void NXWidgets::CNxToolbar::redirectNxTerm | ( | NXTERM | handle | ) |
| inlinevirtual

Each window implementation also inherits from CCallback. CCallback, by default, forwards NX keyboard input to the various widgets residing in the window. But NxTerm is a different usage model; In this case, keyboard input needs to be directed to the NxTerm character driver. This method can be used to enable (or disable) redirection of NX keyboard input from the window widgets to the NxTerm

Parameters

  handle. | The NXTERM handle. If non-NULL, NX keyboard input will be directed to the NxTerm driver using this handle; If NULL (the default), NX keyboard input will be directed to the widgets within the window.

Implements NXWidgets::INxWindow.

Definition at line 214 of file cnxtoolbar.hxx.

## ◆ requestPosition()

bool CNxToolbar::requestPosition | ( | void |  | ) |
| virtual

Request the position and size information of the toolbar. The values will be returned asynchronously through the client callback method. The GetPosition() method may than be called to obtain the positional data as provided by the callback.

Returns
  True on success, false on any failure.

Implements NXWidgets::INxWindow.

Definition at line 147 of file cnxtoolbar.cxx.

## ◆ setPixel()

bool CNxToolbar::setPixel | ( | FAR const struct nxgl_point_s * | pPos,
|  | nxgl_mxpixel_t | color
| ) |  |
| virtual

Set an individual pixel in the toolbar with the specified color.

Parameters

  pPos | The location of the pixel to be filled.
  color | The color to use in the fill.

Returns
  True on success; false on failure.

Implements NXWidgets::INxWindow.

Definition at line 242 of file cnxtoolbar.cxx.

## ◆ setPosition()

bool CNxToolbar::setPosition | ( | FAR const struct nxgl_point_s * | pPos | ) |
| virtual

Set the position and size of the toolbar. The position of the toolbar is fixed at the top of the parent framed window.

Parameters

  pPos | The new position of the toolbar.

Returns
  Always returns false.

Implements NXWidgets::INxWindow.

Definition at line 188 of file cnxtoolbar.cxx.

## ◆ setSize()

bool CNxToolbar::setSize | ( | FAR const struct nxgl_size_s * | pSize | ) |
| virtual

Set the position and size of the toolbar. The position of the toolbar is fixed at the top of the parent framed window.

Parameters

  pPos | The new position of the toolbar.

Returns
  Always returns false.

Set the size of the selected toolbar. The only variable dimension is the height of the toolbar, but that cannot be changed once it is created.

Parameters

  pSize | The new size of the toolbar.

Returns
  Always returns false.

Implements NXWidgets::INxWindow.

Definition at line 202 of file cnxtoolbar.cxx.

## Member Data Documentation

## ◆ m_height

nxgl_coord_t NXWidgets::CNxToolbar::m_height
| private

The toolbar height

Definition at line 91 of file cnxtoolbar.hxx.

## ◆ m_hNxTkWindow

NXTKWINDOW NXWidgets::CNxToolbar::m_hNxTkWindow
| private

Parent framed window handle.

Definition at line 89 of file cnxtoolbar.hxx.

## ◆ m_nxTkWindow

CNxTkWindow* NXWidgets::CNxToolbar::m_nxTkWindow
| private

Parent framed window instance.

Definition at line 88 of file cnxtoolbar.hxx.

## ◆ m_widgetControl

CWidgetControl* NXWidgets::CNxToolbar::m_widgetControl
| private

Controlling widget for the toolbar

Definition at line 90 of file cnxtoolbar.hxx.

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

- cnxtoolbar.hxx
- cnxtoolbar.cxx