summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Melcher <fltk@matthiasm.com>2007-02-08 07:58:47 +0000
committerMatthias Melcher <fltk@matthiasm.com>2007-02-08 07:58:47 +0000
commit624e885b240c3d287b6852eb8d6e2a0d2cc729f8 (patch)
treefdd78073ab10a4234bf2b6e66306b9597f4b3feb
parent44fab0180e308c13c03aa67ee155e18950741e29 (diff)
STR #1584: even smarter mouse pointer hiding. I also fixed two little historic bugs in "ask" (double adding a widget, and not using "label.obj()" instead of "copy_label()" for non-static buffer. Lastly, I changed "boxtype" to use a Double_Window because it has become so big now that it started flickering.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@5671 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
-rw-r--r--src/Fl_Input.cxx4
-rw-r--r--src/Fl_Text_Editor.cxx3
-rw-r--r--test/ask.cxx4
-rw-r--r--test/boxtype.cxx4
4 files changed, 8 insertions, 7 deletions
diff --git a/src/Fl_Input.cxx b/src/Fl_Input.cxx
index 30a198d0d..ffd8bf230 100644
--- a/src/Fl_Input.cxx
+++ b/src/Fl_Input.cxx
@@ -350,8 +350,8 @@ int Fl_Input::handle(int event) {
position(position());
return (1);
} else {
- if (active_r() && window()) window()->cursor(FL_CURSOR_NONE);
-
+ if (active_r() && window() && this == Fl::belowmouse())
+ window()->cursor(FL_CURSOR_NONE);
return handle_key();
}
diff --git a/src/Fl_Text_Editor.cxx b/src/Fl_Text_Editor.cxx
index 745490e0f..c26532906 100644
--- a/src/Fl_Text_Editor.cxx
+++ b/src/Fl_Text_Editor.cxx
@@ -447,7 +447,8 @@ int Fl_Text_Editor::handle(int event) {
return 1;
case FL_KEYBOARD:
- if (active_r() && window()) window()->cursor(FL_CURSOR_NONE);
+ if (active_r() && window() && this == Fl::belowmouse())
+ window()->cursor(FL_CURSOR_NONE);
return handle_key();
case FL_PASTE:
diff --git a/test/ask.cxx b/test/ask.cxx
index a29952544..c049fccca 100644
--- a/test/ask.cxx
+++ b/test/ask.cxx
@@ -47,7 +47,7 @@ void rename_me(Fl_Widget*o) {
const char *input = fl_input("Input:", o->label());
if (input) {
- o->label(input);
+ o->copy_label(input);
o->redraw();
}
}
@@ -65,7 +65,7 @@ int main(int argc, char **argv) {
Fl_Window window(200, 55);
Fl_Return_Button b(20, 10, 160, 35, buffer); b.callback(rename_me);
- window.add(b);
+ window.end();
window.resizable(&b);
window.show(argc, argv);
diff --git a/test/boxtype.cxx b/test/boxtype.cxx
index 34819f601..11b853075 100644
--- a/test/boxtype.cxx
+++ b/test/boxtype.cxx
@@ -28,7 +28,7 @@
#include <stdlib.h>
#include <stdio.h>
#include <FL/Fl.H>
-#include <FL/Fl_Single_Window.H>
+#include <FL/Fl_Double_Window.H>
#include <FL/Fl_Box.H>
int N = 0;
@@ -50,7 +50,7 @@ void bt(const char *name, Fl_Boxtype type, int square=0) {
}
int main(int argc, char ** argv) {
- window = new Fl_Single_Window(4*W,ROWS*H);
+ window = new Fl_Double_Window(4*W,ROWS*H);
window->box(FL_FLAT_BOX);
#if 0 // this code uses the command line arguments to set arbitrary color schemes
Fl::args(argc, argv);