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

#include <cscrollingpanel.hxx>

Inheritance diagram for NXWidgets::CScrollingPanel:
Inheritance graph

Public Member Functions

 CScrollingPanel (CWidgetControl *pWidgetControl, nxgl_coord_t x, nxgl_coord_t y, nxgl_coord_t width, nxgl_coord_t height, uint32_t flags, CWidgetStyle *style=(CWidgetStyle *) NULL)
 
virtual void scroll (int32_t dx, int32_t dy)
 
virtual void jump (int32_t x, int32_t y)
 
bool allowsVerticalScroll (void) const
 
bool allowsHorizontalScroll (void) const
 
virtual const int32_t getCanvasX (void) const
 
virtual const int32_t getCanvasY (void) const
 
virtual const int32_t getCanvasWidth (void) const
 
virtual const int32_t getCanvasHeight (void) const
 
void setAllowsVerticalScroll (bool allow)
 
void setAllowsHorizontalScroll (bool allow)
 
void setContentScrolled (bool scrolled)
 
bool IsContentScrolled (void)
 
virtual void setCanvasWidth (const int32_t width)
 
virtual void setCanvasHeight (const int32_t height)
 
- 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)
 
virtual void getPreferredDimensions (CRect &rect) const
 
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)
 
- Public Member Functions inherited from NXWidgets::IScrollable
virtual ~IScrollable (void)
 

Protected Member Functions

virtual void drawContents (CGraphicsPort *port)
 
virtual void drawBorder (CGraphicsPort *port)
 
virtual void onDrag (nxgl_coord_t x, nxgl_coord_t y, nxgl_coord_t vX, nxgl_coord_t vY)
 
virtual void onClick (nxgl_coord_t x, nxgl_coord_t y)
 
void scrollChildren (int32_t dx, int32_t dy, bool do_redraw)
 
virtual ~CScrollingPanel (void)
 
 CScrollingPanel (const CScrollingPanel &scrollingPanel)
 
- 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 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)
 
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

CWidgetControlm_widgetControl
 
int32_t m_canvasX
 
int32_t m_canvasY
 
int32_t m_canvasWidth
 
int32_t m_canvasHeight
 
bool m_allowVerticalScroll
 
bool m_allowHorizontalScroll
 
bool m_isContentScrolled
 
- 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 containing a scrollable region. Responds to mouse movement. Can contain sub-widgets which will also be scrolled.

Definition at line 105 of file cscrollingpanel.hxx.

Constructor & Destructor Documentation

◆ ~CScrollingPanel()

virtual NXWidgets::CScrollingPanel::~CScrollingPanel ( void  )
inlineprotectedvirtual

Destructor.

Definition at line 180 of file cscrollingpanel.hxx.

◆ CScrollingPanel() [1/2]

NXWidgets::CScrollingPanel::CScrollingPanel ( const CScrollingPanel scrollingPanel)
inlineprotected

Copy constructor is protected to prevent usage.

Definition at line 186 of file cscrollingpanel.hxx.

◆ CScrollingPanel() [2/2]

CScrollingPanel::CScrollingPanel ( CWidgetControl pWidgetControl,
nxgl_coord_t  x,
nxgl_coord_t  y,
nxgl_coord_t  width,
nxgl_coord_t  height,
uint32_t  flags,
CWidgetStyle style = (CWidgetStyle *)NULL 
)

Constructor.

Parameters
pWidgetControlThe widget control for the display.
xThe x coordinate of the widget.
yThe y coordinate of the widget.
widthThe width of the widget.
heightThe height of the widget.
flagsThe usual widget flags.
styleThe style that the widget should use. If this is not specified, the widget will use the values stored in the global g_defaultWidgetStyle object. The widget will copy the properties of the style into its own internal style object.

Definition at line 110 of file cscrollingpanel.cxx.

Member Function Documentation

◆ allowsHorizontalScroll()

bool NXWidgets::CScrollingPanel::allowsHorizontalScroll ( void  ) const
inlinevirtual

Returns true if horizontal scrolling is allowed.

Returns
True if horizontal scrolling is allowed.

Implements NXWidgets::IScrollable.

Definition at line 247 of file cscrollingpanel.hxx.

◆ allowsVerticalScroll()

bool NXWidgets::CScrollingPanel::allowsVerticalScroll ( void  ) const
inlinevirtual

Returns true if vertical scrolling is allowed.

Returns
True if vertical scrolling is allowed.

Implements NXWidgets::IScrollable.

Definition at line 236 of file cscrollingpanel.hxx.

◆ drawBorder()

void CScrollingPanel::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.

Reimplemented in NXWidgets::CMultiLineTextBox, and NXWidgets::CListBox.

Definition at line 306 of file cscrollingpanel.cxx.

◆ drawContents()

void CScrollingPanel::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.

Reimplemented in NXWidgets::CMultiLineTextBox, and NXWidgets::CListBox.

Definition at line 292 of file cscrollingpanel.cxx.

◆ getCanvasHeight()

virtual const int32_t NXWidgets::CScrollingPanel::getCanvasHeight ( void  ) const
inlinevirtual

Gets the height of the virtual canvas.

Returns
The height of the virtual canvas.

Implements NXWidgets::IScrollable.

Definition at line 291 of file cscrollingpanel.hxx.

◆ getCanvasWidth()

virtual const int32_t NXWidgets::CScrollingPanel::getCanvasWidth ( void  ) const
inlinevirtual

Gets the width of the virtual canvas.

Returns
The width of the virtual canvas.

Implements NXWidgets::IScrollable.

Definition at line 280 of file cscrollingpanel.hxx.

◆ getCanvasX()

virtual const int32_t NXWidgets::CScrollingPanel::getCanvasX ( void  ) const
inlinevirtual

Gets the x coordinate of the virtual canvas.

Returns
The x coordinate of the virtual canvas.

Implements NXWidgets::IScrollable.

Definition at line 258 of file cscrollingpanel.hxx.

◆ getCanvasY()

virtual const int32_t NXWidgets::CScrollingPanel::getCanvasY ( void  ) const
inlinevirtual

Gets the y coordinate of the virtual canvas.

Returns
The y coordinate of the virtual canvas.

Implements NXWidgets::IScrollable.

Definition at line 269 of file cscrollingpanel.hxx.

◆ IsContentScrolled()

bool NXWidgets::CScrollingPanel::IsContentScrolled ( void  )
inline

Check if the content of the panel, drawn via the draw() method, is scrolled.

Returns
True if the content is scrolled; false if not.

Definition at line 341 of file cscrollingpanel.hxx.

◆ jump()

void CScrollingPanel::jump ( int32_t  x,
int32_t  y 
)
virtual

Reposition the panel's scrolling region to the specified coordinates.

Parameters
xThe new x coordinate of the scrolling region.
yThe new y coordinate of the scrolling region.

Implements NXWidgets::IScrollable.

Definition at line 277 of file cscrollingpanel.cxx.

◆ onClick()

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

Starts the dragging system.

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

Reimplemented from NXWidgets::CNxWidget.

Reimplemented in NXWidgets::CMultiLineTextBox, and NXWidgets::CListBox.

Definition at line 339 of file cscrollingpanel.cxx.

◆ onDrag()

void CScrollingPanel::onDrag ( nxgl_coord_t  x,
nxgl_coord_t  y,
nxgl_coord_t  vX,
nxgl_coord_t  vY 
)
protectedvirtual

Scrolls the panel to match the drag.

Parameters
xThe x coordinate of the mouse.
yThe y coordinate of the mouse.
vXThe horizontal drag distance.
vYThe vertical drag distance.

Reimplemented from NXWidgets::CNxWidget.

Definition at line 326 of file cscrollingpanel.cxx.

◆ scroll()

void CScrollingPanel::scroll ( int32_t  dx,
int32_t  dy 
)
virtual

Scroll the panel by the specified amounts.

Parameters
dxThe horizontal distance to scroll.
dyThe vertical distance to scroll.

Implements NXWidgets::IScrollable.

Definition at line 144 of file cscrollingpanel.cxx.

◆ scrollChildren()

void CScrollingPanel::scrollChildren ( int32_t  dx,
int32_t  dy,
bool  do_redraw 
)
protected

Scroll all child widgets by the specified amounts. Actually uses the widget's moveTo() function to reposition them.

Parameters
dxThe horizontal distance to scroll.
dyThe vertical distance to scroll.
do_redrawRedraw widgets after moving.

Definition at line 353 of file cscrollingpanel.cxx.

◆ setAllowsHorizontalScroll()

void NXWidgets::CScrollingPanel::setAllowsHorizontalScroll ( bool  allow)
inlinevirtual

Set whether or not horizontal scrolling is allowed.

Parameters
allowTrue to allow horizontal scrolling; false to deny it.

Implements NXWidgets::IScrollable.

Definition at line 313 of file cscrollingpanel.hxx.

◆ setAllowsVerticalScroll()

void NXWidgets::CScrollingPanel::setAllowsVerticalScroll ( bool  allow)
inlinevirtual

Set whether or not horizontal scrolling is allowed.

Parameters
allowTrue to allow horizontal scrolling; false to deny it.

Implements NXWidgets::IScrollable.

Definition at line 302 of file cscrollingpanel.hxx.

◆ setCanvasHeight()

virtual void NXWidgets::CScrollingPanel::setCanvasHeight ( const int32_t  height)
inlinevirtual

Sets the height of the virtual canvas.

Parameters
heightThe height of the virtual canvas.

Implements NXWidgets::IScrollable.

Definition at line 363 of file cscrollingpanel.hxx.

◆ setCanvasWidth()

virtual void NXWidgets::CScrollingPanel::setCanvasWidth ( const int32_t  width)
inlinevirtual

Sets the width of the virtual canvas.

Parameters
widthThe width of the virtual canvas.

Implements NXWidgets::IScrollable.

Definition at line 352 of file cscrollingpanel.hxx.

◆ setContentScrolled()

void NXWidgets::CScrollingPanel::setContentScrolled ( bool  scrolled)
inline

Set whether or not the content of the panel is scrolled. Content is anything drawn to the panel in the draw() method. This property is disabled by default, which will result in faster scrolling of child objects. If the panel contains no child objects, just draw() method content, consider using a SuperBitmap class instead.

Parameters
scrolledTrue to enable content scrolling; false to disable it.

Definition at line 329 of file cscrollingpanel.hxx.

Member Data Documentation

◆ m_allowHorizontalScroll

bool NXWidgets::CScrollingPanel::m_allowHorizontalScroll
protected

True if horizontal scrolling is allowed.

Definition at line 117 of file cscrollingpanel.hxx.

◆ m_allowVerticalScroll

bool NXWidgets::CScrollingPanel::m_allowVerticalScroll
protected

True if vertical scrolling is allowed.

Definition at line 115 of file cscrollingpanel.hxx.

◆ m_canvasHeight

int32_t NXWidgets::CScrollingPanel::m_canvasHeight
protected

Height of the virtual canvas.

Definition at line 114 of file cscrollingpanel.hxx.

◆ m_canvasWidth

int32_t NXWidgets::CScrollingPanel::m_canvasWidth
protected

Width of the virtual canvas.

Definition at line 113 of file cscrollingpanel.hxx.

◆ m_canvasX

int32_t NXWidgets::CScrollingPanel::m_canvasX
protected

X coordinate of the virtual canvas.

Definition at line 109 of file cscrollingpanel.hxx.

◆ m_canvasY

int32_t NXWidgets::CScrollingPanel::m_canvasY
protected

Y coordinate of the virtual canvas.

Definition at line 111 of file cscrollingpanel.hxx.

◆ m_isContentScrolled

bool NXWidgets::CScrollingPanel::m_isContentScrolled
protected

True if the content drawn to the panel is scrolled(ie. everything drawn in the draw() method); false if just child objects are scrolled.

Definition at line 119 of file cscrollingpanel.hxx.

◆ m_widgetControl

CWidgetControl* NXWidgets::CScrollingPanel::m_widgetControl
protected

Widget control instance

Definition at line 108 of file cscrollingpanel.hxx.


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