summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorManolo Gouy <Manolo>2016-03-31 17:41:45 +0000
committerManolo Gouy <Manolo>2016-03-31 17:41:45 +0000
commit740760109d9bb2646bf870ebca6af26da0f31f78 (patch)
tree262db410167e4f386a69b61fdd29473cdabd8868
parent2de2f5496820f91c81df65834eee268126086209 (diff)
Finish removal of platform-dependent code from Fl_Input_.cxx
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11487 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
-rw-r--r--src/Fl_Input_.cxx27
1 files changed, 7 insertions, 20 deletions
diff --git a/src/Fl_Input_.cxx b/src/Fl_Input_.cxx
index e17cfb597..e1d84fcf9 100644
--- a/src/Fl_Input_.cxx
+++ b/src/Fl_Input_.cxx
@@ -28,13 +28,6 @@
#include <stdlib.h>
#include <ctype.h>
-#if defined(WIN32) || defined(__APPLE__) // platform editor look and feel
-#elif defined(FL_PORTING)
-# pragma message "FL_PORTING: manage character composing here"
-#else
-#endif
-
-
#define MAXBUF 1024
static int l_secret;
@@ -342,25 +335,21 @@ 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__ // PORTME: Fl_Screen_Driver - Mac OS: underline marked ( = selected + Fl::compose_state != 0) text
- if (Fl::compose_state) {
+ if (Fl::screen_driver()->has_marked_text() && Fl::compose_state) {
fl_color(textcolor());
}
- else
-#endif
+ else
{
- fl_color(selection_color());
- fl_rectf((int)(x1+0.5), Y+ypos, (int)(x2-x1+0.5), height);
- fl_color(fl_contrast(textcolor(), selection_color()));
+ fl_color(selection_color());
+ fl_rectf((int)(x1+0.5), Y+ypos, (int)(x2-x1+0.5), height);
+ fl_color(fl_contrast(textcolor(), selection_color()));
}
fl_draw(buf+offset1, offset2-offset1, x1, (float)(Y+ypos+desc));
-#ifdef __APPLE__ // PORTME: Fl_Screen_Driver - Mac OS: underline marked ( = selected + Fl::compose_state != 0) text
- if (Fl::compose_state) {
+ if (Fl::screen_driver()->has_marked_text() && Fl::compose_state) {
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);
}
-#endif
if (pp < e) {
fl_color(tc);
fl_draw(buf+offset2, (int) strlen(buf+offset2), x2, (float)(Y+ypos+desc));
@@ -376,9 +365,7 @@ void Fl_Input_::drawtext(int X, int Y, int W, int H) {
CONTINUE2:
// draw the cursor:
if (Fl::focus() == this && (
-#ifdef __APPLE__ // PORTME: Fl_Screen_Driver - compose
- Fl::compose_state ||
-#endif
+ (Fl::screen_driver()->has_marked_text() && Fl::compose_state) ||
selstart == selend) &&
position() >= p-value() && position() <= e-value()) {
fl_color(cursor_color());