diff options
| author | Greg Ercolano <erco@seriss.com> | 2013-03-23 07:55:09 +0000 |
|---|---|---|
| committer | Greg Ercolano <erco@seriss.com> | 2013-03-23 07:55:09 +0000 |
| commit | 81c20e30a4e1100fc97dff83f3b963d5f2cf4efb (patch) | |
| tree | 9585708a9ccf966bcb097738c7aec4a64a4c30eb /FL/Fl_Table.H | |
| parent | bdd227806f65f2e4592bddce8760778c47473d6a (diff) | |
o Added tab_cell_nav() method to control Tab/Shift-Tab navigation of table cells.
o Added move_cursor(R,C,shiftflag). Needed allow Shift-Tab not to create a reverse selection.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@9841 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'FL/Fl_Table.H')
| -rw-r--r-- | FL/Fl_Table.H | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/FL/Fl_Table.H b/FL/Fl_Table.H index 28836c9a0..cf6519fcc 100644 --- a/FL/Fl_Table.H +++ b/FL/Fl_Table.H @@ -210,6 +210,12 @@ private: #if FLTK_ABI_VERSION >= 10301 int _scrollbar_size; #endif +#if FLTK_ABI_VERSION >= 10303 + enum { + TABCELLNAV = 1<<0, ///> tab cell navigation flag + }; + unsigned int flags_; +#endif // An STL-ish vector without templates class FL_EXPORT IntVector { @@ -823,6 +829,7 @@ public: int is_selected(int r, int c); // selected cell void get_selection(int &row_top, int &col_left, int &row_bot, int &col_right); void set_selection(int row_top, int col_left, int row_bot, int col_right); + int move_cursor(int R, int C, int shiftselect); int move_cursor(int R, int C); /** @@ -1107,6 +1114,36 @@ public: _scrollbar_size = newSize; } #endif +#if FLTK_ABI_VERSION >= 10303 + /** + Flag to control if Tab navigates table cells or not. + + If on, Tab key navigates table cells. + If off, Tab key navigates fltk widget focus. (default) + + As of fltk 1.3, the default behavior of the Tab key is to navigate focus off + the current widget, and on to the next one. But in some applications, + it's useful for Tab to be used to navigate cells in the Fl_Table. + + \param [in] val If \p val is 1, Tab key navigates cells in table, not fltk widgets.<BR> + If \p val is 0, Tab key will advance focus to the next fltk widget (default), and does not navigate cells in table. + */ + void tab_cell_nav(int val) { + if ( val ) flags_ |= TABCELLNAV; + else flags_ &= ~TABCELLNAV; + } + + /** + Get state of fltk widget tab navigation flag. + + \returns 1 if Tab configured to navigate widget focus (default) or 0 for Tab to navigate table cells. + + \see tab_cell_nav(int) + */ + int tab_cell_nav() const { + return(flags_ & TABCELLNAV ? 1 : 0); + } +#endif }; #endif /*_FL_TABLE_H*/ |
