Solves STR# 3305 as ABI feature 1.3.4.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@11808 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
parent
7d3218f7ea
commit
1c761bedc3
@ -66,6 +66,11 @@ class FL_EXPORT Fl_Text_Editor : public Fl_Text_Display {
|
|||||||
*/
|
*/
|
||||||
int insert_mode() { return insert_mode_; }
|
int insert_mode() { return insert_mode_; }
|
||||||
|
|
||||||
|
#if FLTK_ABI_VERSION >= 10304
|
||||||
|
void tab_nav(int val);
|
||||||
|
int tab_nav() const;
|
||||||
|
#endif
|
||||||
|
|
||||||
void add_key_binding(int key, int state, Key_Func f, Key_Binding** list);
|
void add_key_binding(int key, int state, Key_Func f, Key_Binding** list);
|
||||||
/** Adds a \p key of state \p state with the function \p f. */
|
/** Adds a \p key of state \p state with the function \p f. */
|
||||||
void add_key_binding(int key, int state, Key_Func f)
|
void add_key_binding(int key, int state, Key_Func f)
|
||||||
|
@ -770,6 +770,57 @@ int Fl_Text_Editor::handle(int event) {
|
|||||||
return Fl_Text_Display::handle(event);
|
return Fl_Text_Display::handle(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if FLTK_ABI_VERSION >= 10304
|
||||||
|
/**
|
||||||
|
Enables or disables Tab key focus navigation.
|
||||||
|
|
||||||
|
When disabled (default), tab characters are inserted into
|
||||||
|
Fl_Text_Editor. Only the mouse can change focus. This behavior is
|
||||||
|
desireable when Fl_Text_Editor is used, e.g. in a source code editor.
|
||||||
|
|
||||||
|
When enabled, Tab navigates focus to the next widget, and Shift-Tab
|
||||||
|
navigates focus to the previous widget. This behavior is desireable
|
||||||
|
when Fl_Text_Editor is used e.g. in a database input form.
|
||||||
|
|
||||||
|
Currently, this method is implemented as a convenience method
|
||||||
|
that adjusts the key bindings for the Tab key. This implementation
|
||||||
|
detail may change in the future. Know that changing the editor's
|
||||||
|
key bindings for Tab and Shift-Tab may affect tab navigation.
|
||||||
|
|
||||||
|
\param [in] val If \p val is 0, Tab inserts a tab character (default).<br>
|
||||||
|
If \p val is 1, Tab navigates widget focus.
|
||||||
|
|
||||||
|
\see tab_nav(), Fl::OPTION_ARROW_FOCUS.
|
||||||
|
\version 1.3.4 ABI feature
|
||||||
|
*/
|
||||||
|
void Fl_Text_Editor::tab_nav(int val) {
|
||||||
|
if ( val )
|
||||||
|
add_key_binding(FL_Tab, 0, kf_ignore);
|
||||||
|
else
|
||||||
|
remove_key_binding(FL_Tab, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
Check if Tab focus navigation is enabled.
|
||||||
|
|
||||||
|
If disabled (default), hitting Tab inserts a tab character into the
|
||||||
|
editor buffer.
|
||||||
|
|
||||||
|
If enabled, hitting Tab navigates focus to the next widget,
|
||||||
|
and Shift-Tab navigates focus to the previous widget.
|
||||||
|
|
||||||
|
\returns if Tab inserts tab characters or moves the focus
|
||||||
|
\retval 0 Tab inserts tab characters (default)
|
||||||
|
\retval 1 Tab navigation is enabled.
|
||||||
|
|
||||||
|
\see tab_nav(int), Fl::OPTION_ARROW_FOCUS.
|
||||||
|
\version 1.3.4 ABI feature
|
||||||
|
*/
|
||||||
|
int Fl_Text_Editor::tab_nav() const {
|
||||||
|
return (bound_key_function(FL_Tab,0)==kf_ignore) ? 1 : 0;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
//
|
//
|
||||||
// End of "$Id$".
|
// End of "$Id$".
|
||||||
//
|
//
|
||||||
|
Loading…
Reference in New Issue
Block a user