summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichael R Sweet <michael.r.sweet@gmail.com>2001-09-29 22:59:45 +0000
committerMichael R Sweet <michael.r.sweet@gmail.com>2001-09-29 22:59:45 +0000
commit72b56edc2940e0279a551fa9182d5ffb16cc1953 (patch)
tree224ee91888baf40fb040e8854d7105885f94ab27 /src
parente7f3ad8691e0d2ef1b9c589d0fe702774182541d (diff)
Tooltips, and more tooltips.
Fl_Browser_, Fl_Choice, and Fl_Input_ did not do the tooltip stuff. Fix write_properties so it writes tooltips properly from FLUID. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@1616 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src')
-rw-r--r--src/Fl_Browser_.cxx5
-rw-r--r--src/Fl_Choice.cxx8
-rw-r--r--src/Fl_File_Chooser.cxx4
-rw-r--r--src/Fl_File_Chooser.fl8
-rw-r--r--src/Fl_File_Chooser2.cxx7
-rw-r--r--src/Fl_Help_Dialog.cxx4
-rw-r--r--src/Fl_Help_Dialog.fl8
-rw-r--r--src/Fl_Input.cxx5
-rw-r--r--src/Fl_Input_.cxx8
9 files changed, 38 insertions, 19 deletions
diff --git a/src/Fl_Browser_.cxx b/src/Fl_Browser_.cxx
index 9e7a0fb7d..df69a9963 100644
--- a/src/Fl_Browser_.cxx
+++ b/src/Fl_Browser_.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: Fl_Browser_.cxx,v 1.10.2.16.2.5 2001/08/04 20:17:10 easysw Exp $"
+// "$Id: Fl_Browser_.cxx,v 1.10.2.16.2.6 2001/09/29 22:59:45 easysw Exp $"
//
// Base Browser widget class for the Fast Light Tool Kit (FLTK).
//
@@ -498,6 +498,7 @@ int Fl_Browser_::select_only(void* l, int docallbacks) {
int Fl_Browser_::handle(int event) {
// must do shortcuts first or the scrollbar will get them...
+ if (event == FL_ENTER || event == FL_LEAVE) return 1;
if (event == FL_KEYBOARD && type() >= FL_HOLD_BROWSER) {
void* l1 = selection_;
void* l = l1; if (!l) l = top_; if (!l) l = item_first();
@@ -712,5 +713,5 @@ void Fl_Browser_::item_select(void*, int) {}
int Fl_Browser_::item_selected(void* l) const {return l==selection_;}
//
-// End of "$Id: Fl_Browser_.cxx,v 1.10.2.16.2.5 2001/08/04 20:17:10 easysw Exp $".
+// End of "$Id: Fl_Browser_.cxx,v 1.10.2.16.2.6 2001/09/29 22:59:45 easysw Exp $".
//
diff --git a/src/Fl_Choice.cxx b/src/Fl_Choice.cxx
index 4fe373784..fef598b63 100644
--- a/src/Fl_Choice.cxx
+++ b/src/Fl_Choice.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: Fl_Choice.cxx,v 1.10.2.5.2.1 2001/08/04 20:17:10 easysw Exp $"
+// "$Id: Fl_Choice.cxx,v 1.10.2.5.2.2 2001/09/29 22:59:45 easysw Exp $"
//
// Choice widget for the Fast Light Tool Kit (FLTK).
//
@@ -82,6 +82,10 @@ int Fl_Choice::handle(int e) {
if (!menu() || !menu()->text) return 0;
const Fl_Menu_Item* v;
switch (e) {
+ case FL_ENTER:
+ case FL_LEAVE:
+ return 1;
+
case FL_KEYBOARD:
if (Fl::event_key() != ' ') return 0;
case FL_PUSH:
@@ -110,5 +114,5 @@ int Fl_Choice::handle(int e) {
}
//
-// End of "$Id: Fl_Choice.cxx,v 1.10.2.5.2.1 2001/08/04 20:17:10 easysw Exp $".
+// End of "$Id: Fl_Choice.cxx,v 1.10.2.5.2.2 2001/09/29 22:59:45 easysw Exp $".
//
diff --git a/src/Fl_File_Chooser.cxx b/src/Fl_File_Chooser.cxx
index 42e4747a0..2f17dda52 100644
--- a/src/Fl_File_Chooser.cxx
+++ b/src/Fl_File_Chooser.cxx
@@ -127,20 +127,24 @@ Fl_File_Chooser::Fl_File_Chooser(const char *d, const char *p, int t, const char
fileName->when(FL_WHEN_CHANGED | FL_WHEN_ENTER_KEY_ALWAYS);
}
{ Fl_Button* o = upButton = new Fl_Button(280, 10, 25, 25);
+ o->tooltip("Show the parent directory.");
o->image(bitmap_up);
o->labelsize(8);
o->callback((Fl_Callback*)cb_upButton);
}
{ Fl_Button* o = newButton = new Fl_Button(310, 10, 25, 25);
+ o->tooltip("Create a new directory.");
o->image(bitmap_new);
o->labelsize(8);
o->callback((Fl_Callback*)cb_newButton);
}
{ Fl_Choice* o = dirMenu = new Fl_Choice(95, 10, 180, 25, "Directory:");
+ o->tooltip("Choose a parent directory.");
o->down_box(FL_BORDER_BOX);
o->callback((Fl_Callback*)cb_dirMenu);
}
{ Fl_Button* o = new Fl_Button(340, 10, 25, 25);
+ o->tooltip("Change the filename filter.");
o->image(bitmap_allfiles);
o->labelsize(28);
o->labelcolor(4);
diff --git a/src/Fl_File_Chooser.fl b/src/Fl_File_Chooser.fl
index 1302d773f..6a78a869e 100644
--- a/src/Fl_File_Chooser.fl
+++ b/src/Fl_File_Chooser.fl
@@ -55,11 +55,11 @@ window->hide();}
}
Fl_Button upButton {
callback {up();}
- private image {up.xbm} xywh {280 10 25 25} labelsize 8
+ private image {up.xbm} tooltip {Show the parent directory.} xywh {280 10 25 25} labelsize 8
}
Fl_Button newButton {
callback {newdir();}
- private image {new.xbm} xywh {310 10 25 25} labelsize 8
+ private image {new.xbm} tooltip {Create a new directory.} xywh {310 10 25 25} labelsize 8
}
Fl_Choice dirMenu {
label {Directory:}
@@ -70,7 +70,7 @@ pathname[0] = '\\0';
for (i = 1; i <= dirMenu->value(); i ++)
strcat(pathname, dirMenu->text(i));
directory(pathname);} open
- private xywh {95 10 180 25} down_box BORDER_BOX
+ private tooltip {Choose a parent directory.} xywh {95 10 180 25} down_box BORDER_BOX
} {}
Fl_Button {} {
callback {const char *f;
@@ -80,7 +80,7 @@ if ((f = fl_input("New Filter?",
fileList->filter(f);
rescan();
}}
- private image {allfiles.xbm} xywh {340 10 25 25} labelsize 28 labelcolor 4 align 16
+ private image {allfiles.xbm} tooltip {Change the filename filter.} xywh {340 10 25 25} labelsize 28 labelcolor 4 align 16
code0 {\#include <FL/fl_ask.H>}
}
}
diff --git a/src/Fl_File_Chooser2.cxx b/src/Fl_File_Chooser2.cxx
index 801c6050d..d7585d862 100644
--- a/src/Fl_File_Chooser2.cxx
+++ b/src/Fl_File_Chooser2.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: Fl_File_Chooser2.cxx,v 1.1.2.1 2001/09/29 14:38:59 easysw Exp $"
+// "$Id: Fl_File_Chooser2.cxx,v 1.1.2.2 2001/09/29 22:59:45 easysw Exp $"
//
// More Fl_File_Chooser routines.
//
@@ -287,7 +287,10 @@ Fl_File_Chooser::value(const char *filename) // I - Filename + directory
directory(pathname);
}
else
+ {
+ directory(".");
slash = pathname;
+ }
// Set the input field to the remaining portion
fileName->value(slash);
@@ -684,5 +687,5 @@ Fl_File_Chooser::fileNameCB()
//
-// End of "$Id: Fl_File_Chooser2.cxx,v 1.1.2.1 2001/09/29 14:38:59 easysw Exp $".
+// End of "$Id: Fl_File_Chooser2.cxx,v 1.1.2.2 2001/09/29 22:59:45 easysw Exp $".
//
diff --git a/src/Fl_Help_Dialog.cxx b/src/Fl_Help_Dialog.cxx
index feacd52de..5521cdc8c 100644
--- a/src/Fl_Help_Dialog.cxx
+++ b/src/Fl_Help_Dialog.cxx
@@ -120,21 +120,25 @@ Fl_Help_Dialog::Fl_Help_Dialog() {
o->callback((Fl_Callback*)cb_Close);
}
{ Fl_Button* o = back_ = new Fl_Button(365, 350, 25, 25, "@<-");
+ o->tooltip("Show the previous help page.");
o->shortcut(0xff51);
o->labelcolor(2);
o->callback((Fl_Callback*)cb_back_);
}
{ Fl_Button* o = forward_ = new Fl_Button(395, 350, 25, 25, "@->");
+ o->tooltip("Show the next help page.");
o->shortcut(0xff53);
o->labelcolor(2);
o->callback((Fl_Callback*)cb_forward_);
}
{ Fl_Button* o = smaller_ = new Fl_Button(305, 350, 25, 25, "F");
+ o->tooltip("Make the help text smaller.");
o->labelfont(1);
o->labelsize(10);
o->callback((Fl_Callback*)cb_smaller_);
}
{ Fl_Button* o = larger_ = new Fl_Button(335, 350, 25, 25, "F");
+ o->tooltip("Make the help text larger.");
o->labelfont(1);
o->labelsize(16);
o->callback((Fl_Callback*)cb_larger_);
diff --git a/src/Fl_Help_Dialog.fl b/src/Fl_Help_Dialog.fl
index 79b27b012..9ec4927a9 100644
--- a/src/Fl_Help_Dialog.fl
+++ b/src/Fl_Help_Dialog.fl
@@ -72,7 +72,7 @@ if (strcmp(view_->filename(), file_[index_]) != 0)
view_->load(file_[index_]);
view_->topline(line_[index_]);}
- private xywh {365 350 25 25} shortcut 0xff51 labelcolor 2
+ tooltip {Show the previous help page.} private xywh {365 350 25 25} shortcut 0xff51 labelcolor 2
}
Fl_Button forward_ {
label {@->}
@@ -88,7 +88,7 @@ if (strcmp(view_->filename(), file_[index_]) != 0)
view_->load(file_[index_]);
view_->topline(line_[index_]);}
- private xywh {395 350 25 25} shortcut 0xff53 labelcolor 2
+ tooltip {Show the next help page.} private xywh {395 350 25 25} shortcut 0xff53 labelcolor 2
}
Fl_Button smaller_ {
label F
@@ -98,7 +98,7 @@ view_->topline(line_[index_]);}
if (view_->textsize() <= 8)
smaller_->deactivate();
larger_->activate();}
- private xywh {305 350 25 25} labelfont 1 labelsize 10
+ tooltip {Make the help text smaller.} private xywh {305 350 25 25} labelfont 1 labelsize 10
}
Fl_Button larger_ {
label F
@@ -108,7 +108,7 @@ larger_->activate();}
if (view_->textsize() >= 18)
larger_->deactivate();
smaller_->activate();}
- private xywh {335 350 25 25} labelfont 1 labelsize 16
+ tooltip {Make the help text larger.} private xywh {335 350 25 25} labelfont 1 labelsize 16
}
}
code {back_->deactivate();
diff --git a/src/Fl_Input.cxx b/src/Fl_Input.cxx
index 6dea29917..5cc43f5e3 100644
--- a/src/Fl_Input.cxx
+++ b/src/Fl_Input.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: Fl_Input.cxx,v 1.10.2.15.2.1 2001/08/02 16:17:04 easysw Exp $"
+// "$Id: Fl_Input.cxx,v 1.10.2.15.2.2 2001/09/29 22:59:45 easysw Exp $"
//
// Input widget for the Fast Light Tool Kit (FLTK).
//
@@ -213,7 +213,6 @@ int Fl_Input::handle_key() {
int Fl_Input::handle(int event) {
switch (event) {
-
case FL_FOCUS:
switch (Fl::event_key()) {
case FL_Right:
@@ -284,5 +283,5 @@ Fl_Input::Fl_Input(int x, int y, int w, int h, const char *l)
}
//
-// End of "$Id: Fl_Input.cxx,v 1.10.2.15.2.1 2001/08/02 16:17:04 easysw Exp $".
+// End of "$Id: Fl_Input.cxx,v 1.10.2.15.2.2 2001/09/29 22:59:45 easysw Exp $".
//
diff --git a/src/Fl_Input_.cxx b/src/Fl_Input_.cxx
index cba64c70d..f3fa112f2 100644
--- a/src/Fl_Input_.cxx
+++ b/src/Fl_Input_.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: Fl_Input_.cxx,v 1.21.2.11 2001/01/22 15:13:39 easysw Exp $"
+// "$Id: Fl_Input_.cxx,v 1.21.2.11.2.1 2001/09/29 22:59:45 easysw Exp $"
//
// Common input widget routines for the Fast Light Tool Kit (FLTK).
//
@@ -670,6 +670,10 @@ void Fl_Input_::maybe_do_callback() {
int Fl_Input_::handletext(int event, int X, int Y, int W, int H) {
switch (event) {
+ case FL_ENTER:
+ case FL_LEAVE:
+ return 1;
+
case FL_FOCUS:
if (mark_ == position_) {
minimal_update(size()+1);
@@ -817,5 +821,5 @@ Fl_Input_::~Fl_Input_() {
}
//
-// End of "$Id: Fl_Input_.cxx,v 1.21.2.11 2001/01/22 15:13:39 easysw Exp $".
+// End of "$Id: Fl_Input_.cxx,v 1.21.2.11.2.1 2001/09/29 22:59:45 easysw Exp $".
//