diff options
author | inmarket <andrewh@inmarket.com.au> | 2015-08-16 21:53:47 +1000 |
---|---|---|
committer | inmarket <andrewh@inmarket.com.au> | 2015-08-16 21:53:47 +1000 |
commit | 15e7342fd7b21b76a565561a3caafee394e70c88 (patch) | |
tree | aeb6898cfdbcb875f4b109d202f2b4560df42021 /src/gwin/gwin_class.h | |
parent | 377fe644d1233e955dfd05e40fa9d335447de325 (diff) | |
download | uGFX-15e7342fd7b21b76a565561a3caafee394e70c88.tar.gz uGFX-15e7342fd7b21b76a565561a3caafee394e70c88.tar.bz2 uGFX-15e7342fd7b21b76a565561a3caafee394e70c88.zip |
Updates to focus.
Diffstat (limited to 'src/gwin/gwin_class.h')
-rw-r--r-- | src/gwin/gwin_class.h | 51 |
1 files changed, 48 insertions, 3 deletions
diff --git a/src/gwin/gwin_class.h b/src/gwin/gwin_class.h index 03d2d506..ad6df423 100644 --- a/src/gwin/gwin_class.h +++ b/src/gwin/gwin_class.h @@ -256,9 +256,8 @@ void _gwinDrawEnd(GHandle gh); * @param[in] gh The window * @param[in] how Do we wait for the lock? * - * @note This call will delete the window. If called without the - * drawing lock 'how' must be REDRAW_WAIT. If called with the drawing - * lock 'how' must be REDRAW_INSESSION. + * @note If called without the drawing lock 'how' must be REDRAW_WAIT. + * If called with the drawing lock 'how' must be REDRAW_INSESSION. * * @notapi */ @@ -322,6 +321,50 @@ bool_t _gwinWMAdd(GHandle gh, const GWindowInit *pInit); */ void _gwinSendEvent(GHandle gh, GEventType type); + #if (GFX_USE_GINPUT && GINPUT_NEED_KEYBOARD) || defined(__DOXYGEN__) + /** + * @brief Move the focus off the current focus window. + * + * @notapi + */ + void _gwinMoveFocus(void); + + /** + * @brief Do focus fixup's after a change of state for a window. + * @details If a focus window has become invisible or disabled then + * the focus must be taken away from it. If there is no focus + * window and this window is eligible then this window becomes + * the focus. + * + * @param[in] gh The window + * + * @note This routine does not actually do a redraw. It assumes that surrounding code + * will because of the change of state that lead to this being called. + * + * @notapi + */ + void _gwinFixFocus(GHandle gh); + + /** + * @brief Draw a simple focus rectangle in the default style. + * + * @param[in] gw The widget + * @param[in] x, y The start x, y position (relative to the window) + * @param[in] cx, cy The width & height of the rectangle + * + * @note Assumes the widget is in a state where it can draw. + * @note Nothing is drawn if the window doesn't have focus. + * @note The focus rectangle may be more than one pixel thick and may + * not be a continuous line. + * + * @notapi + */ + void _gwidgetDrawFocusRect(GWidgetObject *gw, coord_t x, coord_t y, coord_t cx, coord_t cy); + + #else + #define _gwinFixFocus(gh) + #define _gwidgetDrawFocusRect(gh,x,y,cx,cy) + #endif #if GWIN_NEED_FLASHING || defined(__DOXYGEN__) /** @@ -335,6 +378,8 @@ bool_t _gwinWMAdd(GHandle gh, const GWindowInit *pInit); */ const GColorSet *_gwinGetFlashedColor(GWidgetObject *gw, const GColorSet *pcol, bool_t flashOffState); #endif +#else + #define _gwinFixFocus(gh) #endif #if GWIN_NEED_CONTAINERS || defined(__DOXYGEN__) |