summaryrefslogtreecommitdiff
path: root/src/Fl_Input_.cxx
diff options
context:
space:
mode:
authorManolo Gouy <Manolo>2012-12-24 11:45:07 +0000
committerManolo Gouy <Manolo>2012-12-24 11:45:07 +0000
commitcf672dba0db831679ba0cb5b9966a6dd1bbcb6e5 (patch)
treea01386823937540124aaf43c9f6237a0c4b1fc99 /src/Fl_Input_.cxx
parent3c72b20458c943f650ddc071577b9876461d6389 (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_Input_.cxx')
-rw-r--r--src/Fl_Input_.cxx14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/Fl_Input_.cxx b/src/Fl_Input_.cxx
index bf96bd4c9..644d954c3 100644
--- a/src/Fl_Input_.cxx
+++ b/src/Fl_Input_.cxx
@@ -339,8 +339,8 @@ void Fl_Input_::drawtext(int X, int Y, int W, int H) {
int offset2;
if (pp <= e) x2 = xpos + (float)expandpos(p, pp, buf, &offset2);
else offset2 = (int) strlen(buf);
-#ifdef __APPLE__ // Mac OS: underline marked ( = selected + Fl::compose_state != 0) text
- if (Fl::compose_state) {
+#ifdef __APPLE__ // Mac OS: underline marked ( = selected + Fl::marked_text_length() != 0) text
+ if (Fl::marked_text_length()) {
fl_color(textcolor());
}
else
@@ -351,8 +351,8 @@ void Fl_Input_::drawtext(int X, int Y, int W, int H) {
fl_color(fl_contrast(textcolor(), selection_color()));
}
fl_draw(buf+offset1, offset2-offset1, x1, (float)(Y+ypos+desc));
-#ifdef __APPLE__ // Mac OS: underline marked ( = selected + Fl::compose_state != 0) text
- if (Fl::compose_state) {
+#ifdef __APPLE__ // Mac OS: underline marked ( = selected + Fl::marked_text_length() != 0) text
+ if (Fl::marked_text_length()) {
fl_color( fl_color_average(textcolor(), color(), 0.6) );
float width = fl_width(buf+offset1, offset2-offset1);
fl_line(x1, Y+ypos+height-1, x1+width, Y+ypos+height-1);
@@ -372,7 +372,11 @@ void Fl_Input_::drawtext(int X, int Y, int W, int H) {
CONTINUE2:
// draw the cursor:
- if (Fl::focus() == this && (Fl::compose_state || selstart == selend) &&
+ if (Fl::focus() == this && (
+#ifdef __APPLE__
+ Fl::marked_text_length() ||
+#endif
+ selstart == selend) &&
position() >= p-value() && position() <= e-value()) {
fl_color(cursor_color());
// cursor position may need to be recomputed (see STR #2486)