From d68f927a1382d1603a03e5be77f79b7a51854360 Mon Sep 17 00:00:00 2001 From: Greg Ercolano Date: Mon, 7 Nov 2022 17:08:14 -0800 Subject: [PATCH] Document Fl_Multiline_Output keynav and caret cursor --- FL/Fl_Multiline_Output.H | 9 +++++++++ src/Fl_Input_.cxx | 1 + 2 files changed, 10 insertions(+) diff --git a/FL/Fl_Multiline_Output.H b/FL/Fl_Multiline_Output.H index a8bd088bc..480fc8f52 100644 --- a/FL/Fl_Multiline_Output.H +++ b/FL/Fl_Multiline_Output.H @@ -34,6 +34,15 @@ and need scrollbars, or full color control of characters, then use Fl_Text_Display. If you want to display HTML text, use Fl_Help_View. + + A caret cursor (^) shows the keyboard navigation mark + for keyboard selection of the output text, e.g. Arrow Keys + to move the cursor, Shift + Arrow Keys to create a text + selection, and '^C' to copy the selected text to the paste buffer. + The caret cursor can be disabled by disabling the widget's + "visible focus" using clear_visible_focus(), inherited from the + Fl_Widget base class. Doing this also disables the widget's + keyboard navigation. */ class FL_EXPORT Fl_Multiline_Output : public Fl_Output { public: diff --git a/src/Fl_Input_.cxx b/src/Fl_Input_.cxx index 37edba106..55190b258 100644 --- a/src/Fl_Input_.cxx +++ b/src/Fl_Input_.cxx @@ -371,6 +371,7 @@ void Fl_Input_::drawtext(int X, int Y, int W, int H) { // cursor position may need to be recomputed (see STR #2486) curx = int(expandpos(p, value()+position(), buf, 0)+.5); if (readonly()) { + // Draw '^' caret cursor fl_line((int)(xpos+curx-2.5f), Y+ypos+height-1, (int)(xpos+curx+0.5f), Y+ypos+height-4, (int)(xpos+curx+3.5f), Y+ypos+height-1);