summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichael R Sweet <michael.r.sweet@gmail.com>2002-08-01 02:15:43 +0000
committerMichael R Sweet <michael.r.sweet@gmail.com>2002-08-01 02:15:43 +0000
commit685100b1222821dedec2e0b22f55ca18027a99df (patch)
tree8e3d5e0669628a2e39070af76d51bba7f87b98b3 /src
parent063d67de86af0fcdad54f28d49ba9aacca6ae96a (diff)
Add default cursor as data the Fl_Window tracks individually (with the
default being the original global default...) git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@2561 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src')
-rw-r--r--src/Fl_Window.cxx8
-rw-r--r--src/fl_cursor.cxx25
2 files changed, 29 insertions, 4 deletions
diff --git a/src/Fl_Window.cxx b/src/Fl_Window.cxx
index 3567fc40d..e3cbb37e5 100644
--- a/src/Fl_Window.cxx
+++ b/src/Fl_Window.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: Fl_Window.cxx,v 1.6.2.3.2.7 2002/07/14 21:25:39 easysw Exp $"
+// "$Id: Fl_Window.cxx,v 1.6.2.3.2.8 2002/08/01 02:15:43 easysw Exp $"
//
// Window widget class for the Fast Light Tool Kit (FLTK).
//
@@ -53,6 +53,10 @@ void Fl_Window::_Fl_Window() {
Fl_Window::Fl_Window(int X,int Y,int W, int H, const char *l)
: Fl_Group(X, Y, W, H, l) {
+ cursor_default = FL_CURSOR_DEFAULT;
+ cursor_fg = FL_BLACK;
+ cursor_bg = FL_WHITE;
+
_Fl_Window();
set_flag(FL_FORCE_POSITION);
}
@@ -119,5 +123,5 @@ Fl_Window *Fl_Window::current() {
//
-// End of "$Id: Fl_Window.cxx,v 1.6.2.3.2.7 2002/07/14 21:25:39 easysw Exp $".
+// End of "$Id: Fl_Window.cxx,v 1.6.2.3.2.8 2002/08/01 02:15:43 easysw Exp $".
//
diff --git a/src/fl_cursor.cxx b/src/fl_cursor.cxx
index 477753e76..026429122 100644
--- a/src/fl_cursor.cxx
+++ b/src/fl_cursor.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: fl_cursor.cxx,v 1.6.2.6.2.4 2002/01/01 15:11:32 easysw Exp $"
+// "$Id: fl_cursor.cxx,v 1.6.2.6.2.5 2002/08/01 02:15:43 easysw Exp $"
//
// Mouse cursor support for the Fast Light Tool Kit (FLTK).
//
@@ -41,6 +41,16 @@ void fl_cursor(Fl_Cursor c, Fl_Color fg, Fl_Color bg) {
if (Fl::first_window()) Fl::first_window()->cursor(c,fg,bg);
}
+void Fl_Window::default_cursor(Fl_Cursor c, Fl_Color fg, Fl_Color bg) {
+ if (c == FL_CURSOR_DEFAULT) c = FL_CURSOR_ARROW;
+
+ cursor_default = c;
+ cursor_fg = fg;
+ cursor_bg = bg;
+
+ cursor(c, fg, bg);
+}
+
#ifdef WIN32
# ifndef IDC_HAND
@@ -49,6 +59,9 @@ void fl_cursor(Fl_Cursor c, Fl_Color fg, Fl_Color bg) {
void Fl_Window::cursor(Fl_Cursor c, Fl_Color, Fl_Color) {
if (!shown()) return;
+ if (c == FL_CURSOR_DEFAULT) {
+ c = cursor_default;
+ }
if (c > FL_CURSOR_NESW) {
i->cursor = 0;
} else if (c == FL_CURSOR_DEFAULT) {
@@ -173,6 +186,9 @@ static Cursor crsrARROW =
void Fl_Window::cursor(Fl_Cursor c, Fl_Color, Fl_Color) {
if (!shown()) return;
+ if (c == FL_CURSOR_DEFAULT) {
+ c = cursor_default;
+ }
switch (c) {
case FL_CURSOR_CROSS: i->cursor = GetCursor( crossCursor ); break;
case FL_CURSOR_WAIT: i->cursor = GetCursor( watchCursor ); break;
@@ -251,6 +267,11 @@ void Fl_Window::cursor(Fl_Cursor c, Fl_Color fg, Fl_Color bg) {
if (!shown()) return;
Cursor cursor;
int deleteit = 0;
+ if (c == FL_CURSOR_DEFAULT) {
+ c = cursor_default;
+ fg = cursor_fg;
+ bg = cursor_bg;
+ }
if (!c) {
cursor = None;
} else {
@@ -290,5 +311,5 @@ void Fl_Window::cursor(Fl_Cursor c, Fl_Color fg, Fl_Color bg) {
#endif
//
-// End of "$Id: fl_cursor.cxx,v 1.6.2.6.2.4 2002/01/01 15:11:32 easysw Exp $".
+// End of "$Id: fl_cursor.cxx,v 1.6.2.6.2.5 2002/08/01 02:15:43 easysw Exp $".
//