diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/Fl_Help_Dialog.cxx | 20 | ||||
| -rw-r--r-- | src/Fl_Help_Dialog.fl | 16 | ||||
| -rw-r--r-- | src/Fl_Menu_.cxx | 41 | ||||
| -rw-r--r-- | src/Fl_Scroll.cxx | 20 | ||||
| -rw-r--r-- | src/Fl_Slider.cxx | 14 | ||||
| -rw-r--r-- | src/Fl_Sys_Menu_Bar.cxx | 8 | ||||
| -rw-r--r-- | src/Fl_mac.cxx | 8 | ||||
| -rw-r--r-- | src/Makefile | 5 | ||||
| -rw-r--r-- | src/filename_absolute.cxx | 14 |
9 files changed, 103 insertions, 43 deletions
diff --git a/src/Fl_Help_Dialog.cxx b/src/Fl_Help_Dialog.cxx index eab956c1b..aadee5495 100644 --- a/src/Fl_Help_Dialog.cxx +++ b/src/Fl_Help_Dialog.cxx @@ -1,4 +1,4 @@ -// generated by Fast Light User Interface Designer (fluid) version 1.0104 +// generated by Fast Light User Interface Designer (fluid) version 1.0105 #include "../FL/Fl_Help_Dialog.H" #include "flstring.h" @@ -55,10 +55,12 @@ if (index_ == 0) forward_->activate(); +int l = line_[index_]; + if (strcmp(view_->filename(), file_[index_]) != 0) view_->load(file_[index_]); -view_->topline(line_[index_]); +view_->topline(l); } void Fl_Help_Dialog::cb_back_(Fl_Button* o, void* v) { ((Fl_Help_Dialog*)(o->parent()->user_data()))->cb_back__i(o,v); @@ -73,10 +75,12 @@ if (index_ >= max_) back_->activate(); +int l = view_->topline(); + if (strcmp(view_->filename(), file_[index_]) != 0) view_->load(file_[index_]); -view_->topline(line_[index_]); +view_->topline(l); } void Fl_Help_Dialog::cb_forward_(Fl_Button* o, void* v) { ((Fl_Help_Dialog*)(o->parent()->user_data()))->cb_forward__i(o,v); @@ -120,12 +124,12 @@ Fl_Help_Dialog::Fl_Help_Dialog() { o->user_data((void*)(this)); { Fl_Help_View* o = view_ = new Fl_Help_View(10, 10, 510, 330); o->box(FL_DOWN_BOX); - o->color(49); - o->selection_color(15); + o->color(FL_BACKGROUND_COLOR); + o->selection_color(FL_SELECTION_COLOR); o->labeltype(FL_NORMAL_LABEL); o->labelfont(0); o->labelsize(14); - o->labelcolor(56); + o->labelcolor(FL_BLACK); o->callback((Fl_Callback*)cb_view_); o->align(FL_ALIGN_TOP); o->when(FL_WHEN_RELEASE); @@ -139,13 +143,13 @@ Fl_Help_Dialog::Fl_Help_Dialog() { { 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->labelcolor((Fl_Color)2); o->callback((Fl_Callback*)cb_back_); } { 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->labelcolor((Fl_Color)2); o->callback((Fl_Callback*)cb_forward_); } { Fl_Button* o = smaller_ = new Fl_Button(285, 350, 25, 25, "F"); diff --git a/src/Fl_Help_Dialog.fl b/src/Fl_Help_Dialog.fl index dff63a7f9..7647aaab6 100644 --- a/src/Fl_Help_Dialog.fl +++ b/src/Fl_Help_Dialog.fl @@ -1,5 +1,5 @@ # data file for the Fltk User Interface Designer (fluid) -version 1.0104 +version 1.0105 header_name {../FL/Fl_Help_Dialog.H} code_name {.cxx} decl {\#include "flstring.h"} {} @@ -17,7 +17,7 @@ class FL_EXPORT Fl_Help_Dialog {open } { Fl_Window window_ { label {Help Dialog} open - private xywh {398 65 530 385} type Double resizable visible + private xywh {398 65 530 385} type Double hide resizable } { Fl_Group view_ { callback {if (view_->changed()) @@ -48,7 +48,7 @@ else if (view_->filename()) { strlcpy(file_[index_], view_->filename(), sizeof(file_[0])); line_[index_] = view_->topline(); -}} open +}} open selected private xywh {10 10 510 330} box DOWN_BOX selection_color 15 resizable code0 {\#include <FL/Fl_Help_View.H>} class Fl_Help_View @@ -69,10 +69,12 @@ if (index_ == 0) forward_->activate(); +int l = line_[index_]; + if (strcmp(view_->filename(), file_[index_]) != 0) view_->load(file_[index_]); -view_->topline(line_[index_]);} +view_->topline(l);} private tooltip {Show the previous help page.} xywh {355 350 25 25} shortcut 0xff51 labelcolor 2 } Fl_Button forward_ { @@ -85,10 +87,12 @@ if (index_ >= max_) back_->activate(); +int l = view_->topline(); + if (strcmp(view_->filename(), file_[index_]) != 0) view_->load(file_[index_]); -view_->topline(line_[index_]);} +view_->topline(l);} private tooltip {Show the next help page.} xywh {390 350 25 25} shortcut 0xff53 labelcolor 2 } Fl_Button smaller_ { @@ -112,7 +116,7 @@ smaller_->activate();} private tooltip {Make the help text larger.} xywh {320 350 25 25} labelfont 1 labelsize 16 } Fl_Input find_ { - callback {find_pos_ = view_->find(find_->value(), find_pos_);} selected + callback {find_pos_ = view_->find(find_->value(), find_pos_);} private xywh {10 350 265 25} when 10 } } diff --git a/src/Fl_Menu_.cxx b/src/Fl_Menu_.cxx index 6b9567547..56ca4e4b3 100644 --- a/src/Fl_Menu_.cxx +++ b/src/Fl_Menu_.cxx @@ -1,5 +1,5 @@ // -// "$Id: Fl_Menu_.cxx,v 1.7.2.8.2.6 2003/01/30 21:42:11 easysw Exp $" +// "$Id: Fl_Menu_.cxx,v 1.7.2.8.2.7 2004/03/11 05:17:12 easysw Exp $" // // Common menu code for the Fast Light Tool Kit (FLTK). // @@ -36,6 +36,43 @@ #include <stdio.h> #include <stdlib.h> +// Set 'pathname' of specified menuitem +// If finditem==NULL, mvalue() is used (the most recently picked menuitem) +// Returns: +// 0 : OK +// -1 : item not found (name="") +// -2 : 'name' not large enough (name="") +// +#define SAFE_STRCAT(s) \ + { len += strlen(s); if ( len >= namelen ) { *name='\0'; return(-2); } else strcat(name,(s)); } +int Fl_Menu_::item_pathname(char *name, int namelen, const Fl_Menu_Item *finditem) const { + int len = 0; + finditem = finditem ? finditem : mvalue(); + name[0] = '\0'; + for ( int t=0; t<size(); t++ ) { + const Fl_Menu_Item *m = &(menu()[t]); + if ( m->submenu() ) { // submenu? descend + if ( *name ) SAFE_STRCAT("/"); + SAFE_STRCAT(m->label()); + } else { + if ( m->label() ) { // menu item? + if ( m == finditem ) { // found? tack on itemname, done. + SAFE_STRCAT("/"); + SAFE_STRCAT(m->label()); + return(0); + } + } else { // end of submenu? pop + char *ss = strrchr(name, '/'); + if ( ss ) { *ss = 0; len = strlen(name); } // "File/Edit" -> "File" + else { name[0] = '\0'; len = 0; } // "File" -> "" + continue; + } + } + } + *name = '\0'; + return(-1); // item not found +} + int Fl_Menu_::value(const Fl_Menu_Item* m) { clear_changed(); if (value_ != m) {value_ = m; return 1;} @@ -150,5 +187,5 @@ void Fl_Menu_::clear() { } // -// End of "$Id: Fl_Menu_.cxx,v 1.7.2.8.2.6 2003/01/30 21:42:11 easysw Exp $". +// End of "$Id: Fl_Menu_.cxx,v 1.7.2.8.2.7 2004/03/11 05:17:12 easysw Exp $". // diff --git a/src/Fl_Scroll.cxx b/src/Fl_Scroll.cxx index 7d09eb8ae..6e2f6a7a7 100644 --- a/src/Fl_Scroll.cxx +++ b/src/Fl_Scroll.cxx @@ -1,5 +1,5 @@ // -// "$Id: Fl_Scroll.cxx,v 1.7.2.6.2.5 2003/06/15 04:41:16 easysw Exp $" +// "$Id: Fl_Scroll.cxx,v 1.7.2.6.2.6 2004/03/11 05:17:12 easysw Exp $" // // Scroll widget for the Fast Light Tool Kit (FLTK). // @@ -74,13 +74,15 @@ void Fl_Scroll::draw_clip(void* v,int X, int Y, int W, int H) { if (NB > B) B = NB; } // fill any area to right & bottom of widgets: - if (R < X+W && B > Y) { - fl_color(s->color()); - fl_rectf(R,Y,X+W-R,B-Y); - } - if (B < Y+H) { - fl_color(s->color()); - fl_rectf(X,B,W,Y+H-B); + if (s->box()) { + if (R < X+W && B > Y) { + fl_color(s->color()); + fl_rectf(R,Y,X+W-R,B-Y); + } + if (B < Y+H) { + fl_color(s->color()); + fl_rectf(X,B,W,Y+H-B); + } } fl_pop_clip(); } @@ -266,5 +268,5 @@ int Fl_Scroll::handle(int event) { } // -// End of "$Id: Fl_Scroll.cxx,v 1.7.2.6.2.5 2003/06/15 04:41:16 easysw Exp $". +// End of "$Id: Fl_Scroll.cxx,v 1.7.2.6.2.6 2004/03/11 05:17:12 easysw Exp $". // diff --git a/src/Fl_Slider.cxx b/src/Fl_Slider.cxx index 921dd5b64..4ceb16af8 100644 --- a/src/Fl_Slider.cxx +++ b/src/Fl_Slider.cxx @@ -1,5 +1,5 @@ // -// "$Id: Fl_Slider.cxx,v 1.8.2.10.2.13 2003/01/30 21:42:44 easysw Exp $" +// "$Id: Fl_Slider.cxx,v 1.8.2.10.2.14 2004/03/11 05:17:12 easysw Exp $" // // Slider widget for the Fast Light Tool Kit (FLTK). // @@ -83,13 +83,9 @@ int Fl_Slider::scrollvalue(int p, int W, int t, int l) { // actually it ranges from 0 to 1/(1-size). void Fl_Slider::draw_bg(int X, int Y, int W, int H) { - if (!(damage()&FL_DAMAGE_ALL)) { // not a complete redraw - fl_push_clip(X, Y, W, H); - draw_box(); - fl_pop_clip(); - } else { - draw_box(); - } + fl_push_clip(X, Y, W, H); + draw_box(); + fl_pop_clip(); Fl_Color black = active_r() ? FL_FOREGROUND_COLOR : FL_INACTIVE_COLOR; if (type() == FL_VERT_NICE_SLIDER) { @@ -290,5 +286,5 @@ int Fl_Slider::handle(int event) { } // -// End of "$Id: Fl_Slider.cxx,v 1.8.2.10.2.13 2003/01/30 21:42:44 easysw Exp $". +// End of "$Id: Fl_Slider.cxx,v 1.8.2.10.2.14 2004/03/11 05:17:12 easysw Exp $". // diff --git a/src/Fl_Sys_Menu_Bar.cxx b/src/Fl_Sys_Menu_Bar.cxx index 7ea2eeec5..6870b2a5f 100644 --- a/src/Fl_Sys_Menu_Bar.cxx +++ b/src/Fl_Sys_Menu_Bar.cxx @@ -1,5 +1,5 @@ // -// "$Id: Fl_Sys_Menu_Bar.cxx,v 1.1.2.7 2003/06/12 01:36:18 easysw Exp $" +// "$Id: Fl_Sys_Menu_Bar.cxx,v 1.1.2.8 2004/03/11 05:17:12 easysw Exp $" // // MacOS system menu bar widget for the Fast Light Tool Kit (FLTK). // @@ -48,6 +48,8 @@ * Changing the menu items has no effect on the menu bar. */ +#if defined(__APPLE__) + #include <FL/X.H> #include <FL/Fl.H> #include <FL/Fl_Sys_Menu_Bar.H> @@ -315,6 +317,8 @@ int Fl_Menu_Bar::handle(int event) { } */ +#endif /* __APPLE__ */ + // -// End of "$Id: Fl_Sys_Menu_Bar.cxx,v 1.1.2.7 2003/06/12 01:36:18 easysw Exp $". +// End of "$Id: Fl_Sys_Menu_Bar.cxx,v 1.1.2.8 2004/03/11 05:17:12 easysw Exp $". // diff --git a/src/Fl_mac.cxx b/src/Fl_mac.cxx index bfda9b7b1..2b9e528a0 100644 --- a/src/Fl_mac.cxx +++ b/src/Fl_mac.cxx @@ -1,5 +1,5 @@ // -// "$Id: Fl_mac.cxx,v 1.1.2.51 2003/08/02 05:54:43 matthiaswm Exp $" +// "$Id: Fl_mac.cxx,v 1.1.2.52 2004/03/11 05:17:12 easysw Exp $" // // MacOS specific code for the Fast Light Tool Kit (FLTK). // @@ -377,8 +377,10 @@ static pascal OSStatus carbonDispatchHandler( EventHandlerCallRef nextHandler, E case kEventMouseDragged: if ( fl_capture ) ret = SendEventToEventTarget( event, GetWindowEventTarget( fl_capture ) ); - else if ( fl_os_capture ) + else if ( fl_os_capture ){ ret = SendEventToEventTarget( event, GetWindowEventTarget( fl_os_capture ) ); + fl_os_capture = 0; + } break; } break; @@ -1877,6 +1879,6 @@ void Fl::paste(Fl_Widget &receiver, int clipboard) { // -// End of "$Id: Fl_mac.cxx,v 1.1.2.51 2003/08/02 05:54:43 matthiaswm Exp $". +// End of "$Id: Fl_mac.cxx,v 1.1.2.52 2004/03/11 05:17:12 easysw Exp $". // diff --git a/src/Makefile b/src/Makefile index d93a3ac6b..834647684 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1,5 +1,5 @@ # -# "$Id: Makefile,v 1.18.2.14.2.54 2003/08/24 13:09:06 easysw Exp $" +# "$Id: Makefile,v 1.18.2.14.2.55 2004/03/11 05:17:12 easysw Exp $" # # Library makefile for the Fast Light Tool Kit (FLTK). # @@ -55,6 +55,7 @@ CPPFILES = \ Fl_Menu.cxx \ Fl_Menu_.cxx \ Fl_Menu_Bar.cxx \ + Fl_Sys_Menu_Bar.cxx \ Fl_Menu_Button.cxx \ Fl_Menu_Window.cxx \ Fl_Menu_add.cxx \ @@ -582,5 +583,5 @@ uninstall: # -# End of "$Id: Makefile,v 1.18.2.14.2.54 2003/08/24 13:09:06 easysw Exp $". +# End of "$Id: Makefile,v 1.18.2.14.2.55 2004/03/11 05:17:12 easysw Exp $". # diff --git a/src/filename_absolute.cxx b/src/filename_absolute.cxx index 6ce6d7042..5a70d9d77 100644 --- a/src/filename_absolute.cxx +++ b/src/filename_absolute.cxx @@ -1,5 +1,5 @@ // -// "$Id: filename_absolute.cxx,v 1.5.2.4.2.10 2003/01/30 21:43:20 easysw Exp $" +// "$Id: filename_absolute.cxx,v 1.5.2.4.2.11 2004/03/11 05:17:12 easysw Exp $" // // Filename expansion routines for the Fast Light Tool Kit (FLTK). // @@ -132,6 +132,11 @@ fl_filename_relative(char *to, // O - Relative filename } #if defined(WIN32) || defined(__EMX__) + if (!strcasecmp(from, cwd)) { + strlcpy(to, ".", tolen); + return (1); + } + if (*from != *cwd) { // Not the same drive... strlcpy(to, from, tolen); @@ -139,6 +144,11 @@ fl_filename_relative(char *to, // O - Relative filename } for (slash = from + 2, newslash = cwd + 2; #else + if (!strcmp(from, cwd)) { + strlcpy(to, ".", tolen); + return (1); + } + for (slash = from, newslash = cwd; #endif // WIN32 || __EMX__ *slash != '\0' && *newslash != '\0'; @@ -176,5 +186,5 @@ fl_filename_relative(char *to, // O - Relative filename // -// End of "$Id: filename_absolute.cxx,v 1.5.2.4.2.10 2003/01/30 21:43:20 easysw Exp $". +// End of "$Id: filename_absolute.cxx,v 1.5.2.4.2.11 2004/03/11 05:17:12 easysw Exp $". // |
