diff options
| author | Michael R Sweet <michael.r.sweet@gmail.com> | 2003-05-21 16:12:14 +0000 |
|---|---|---|
| committer | Michael R Sweet <michael.r.sweet@gmail.com> | 2003-05-21 16:12:14 +0000 |
| commit | ba892d265222409f0887b9cb92923c501b48decd (patch) | |
| tree | 032e0ba3d8ceca83af23f4ccb8d01b53aca0cbf7 /src/Fl_Help_Dialog.cxx | |
| parent | 2549a4ad6285fe28341979b0a64f289feaedb531 (diff) | |
Add find() method to help widget and search box to help dialog.
Default to blue for the selection color on OSX; otherwise links and
other visual elements are not the correct color.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@2993 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/Fl_Help_Dialog.cxx')
| -rw-r--r-- | src/Fl_Help_Dialog.cxx | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/src/Fl_Help_Dialog.cxx b/src/Fl_Help_Dialog.cxx index 9cbb757ff..eab956c1b 100644 --- a/src/Fl_Help_Dialog.cxx +++ b/src/Fl_Help_Dialog.cxx @@ -106,6 +106,13 @@ void Fl_Help_Dialog::cb_larger_(Fl_Button* o, void* v) { ((Fl_Help_Dialog*)(o->parent()->user_data()))->cb_larger__i(o,v); } +inline void Fl_Help_Dialog::cb_find__i(Fl_Input*, void*) { + find_pos_ = view_->find(find_->value(), find_pos_); +} +void Fl_Help_Dialog::cb_find_(Fl_Input* o, void* v) { + ((Fl_Help_Dialog*)(o->parent()->user_data()))->cb_find__i(o,v); +} + Fl_Help_Dialog::Fl_Help_Dialog() { Fl_Double_Window* w; { Fl_Double_Window* o = window_ = new Fl_Double_Window(530, 385, "Help Dialog"); @@ -129,37 +136,42 @@ Fl_Help_Dialog::Fl_Help_Dialog() { o->callback((Fl_Callback*)cb_Close); o->label(fl_close); } - { Fl_Button* o = back_ = new Fl_Button(365, 350, 25, 25, "@<-"); + { Fl_Button* o = back_ = new Fl_Button(355, 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, "@->"); + { Fl_Button* o = forward_ = new Fl_Button(390, 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"); + { Fl_Button* o = smaller_ = new Fl_Button(285, 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"); + { Fl_Button* o = larger_ = new Fl_Button(320, 350, 25, 25, "F"); o->tooltip("Make the help text larger."); o->labelfont(1); o->labelsize(16); o->callback((Fl_Callback*)cb_larger_); } + { Fl_Input* o = find_ = new Fl_Input(10, 350, 265, 25); + o->callback((Fl_Callback*)cb_find_); + o->when(FL_WHEN_ENTER_KEY_ALWAYS); + } o->end(); } back_->deactivate(); forward_->deactivate(); -index_ = -1; -max_ = 0; +index_ = -1; +max_ = 0; +find_pos_ = 0; fl_register_images(); } |
