diff options
| author | Manolo Gouy <Manolo> | 2012-12-24 11:45:07 +0000 |
|---|---|---|
| committer | Manolo Gouy <Manolo> | 2012-12-24 11:45:07 +0000 |
| commit | cf672dba0db831679ba0cb5b9966a6dd1bbcb6e5 (patch) | |
| tree | a01386823937540124aaf43c9f6237a0c4b1fc99 /src/Fl_Text_Display.cxx | |
| parent | 3c72b20458c943f650ddc071577b9876461d6389 (diff) | |
Mac OS text input: defined a small API that user-defined text editing widgets can use to signal marked text.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@9774 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/Fl_Text_Display.cxx')
| -rw-r--r-- | src/Fl_Text_Display.cxx | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/Fl_Text_Display.cxx b/src/Fl_Text_Display.cxx index fb0eee61c..5c418fc7d 100644 --- a/src/Fl_Text_Display.cxx +++ b/src/Fl_Text_Display.cxx @@ -1942,7 +1942,7 @@ void Fl_Text_Display::draw_string(int style, if (style & PRIMARY_MASK) { if (Fl::focus() == (Fl_Widget*)this) { #ifdef __APPLE__ - if (Fl::compose_state) background = color();// Mac OS: underline marked text + if (Fl::marked_text_length()) background = color();// Mac OS: underline marked text else #endif background = selection_color(); @@ -1978,8 +1978,8 @@ void Fl_Text_Display::draw_string(int style, fl_push_clip(X, Y, toX - X, mMaxsize); #endif fl_draw( string, nChars, X, Y + mMaxsize - fl_descent()); -#ifdef __APPLE__ // Mac OS: underline marked (= selected + Fl::compose_state != 0) text - if (Fl::compose_state && (style & PRIMARY_MASK)) { +#ifdef __APPLE__ // Mac OS: underline marked (= selected + Fl::marked_text_length() != 0) text + if (Fl::marked_text_length() && (style & PRIMARY_MASK)) { fl_color( fl_color_average(foreground, background, 0.6) ); fl_line(X, Y + mMaxsize - 1, X + fl_width(string, nChars), Y + mMaxsize - 1); } @@ -3469,7 +3469,11 @@ void Fl_Text_Display::draw(void) { // draw the text cursor if (damage() & (FL_DAMAGE_ALL | FL_DAMAGE_SCROLL | FL_DAMAGE_EXPOSE) - && (Fl::compose_state || !buffer()->primary_selection()->selected()) && + && ( +#ifdef __APPLE__ + Fl::marked_text_length() || +#endif + !buffer()->primary_selection()->selected()) && mCursorOn && Fl::focus() == (Fl_Widget*)this ) { fl_push_clip(text_area.x-LEFT_MARGIN, text_area.y, |
