diff options
| -rw-r--r-- | src/Fl_Tabs.cxx | 90 |
1 files changed, 45 insertions, 45 deletions
diff --git a/src/Fl_Tabs.cxx b/src/Fl_Tabs.cxx index bbc662a7b..16b6426f5 100644 --- a/src/Fl_Tabs.cxx +++ b/src/Fl_Tabs.cxx @@ -3,7 +3,7 @@ // // Tab widget for the Fast Light Tool Kit (FLTK). // -// Copyright 1998-2010 by Bill Spitzak and others. +// Copyright 1998-2015 by Bill Spitzak and others. // // This library is free software. Distribution and use rights are outlined in // the file "COPYING" which should have been included with this file. If this @@ -16,7 +16,6 @@ // http://www.fltk.org/str.php // - // This is the "file card tabs" interface to allow you to put lots and lots // of buttons and switches in a panel, as popularized by many toolkits. @@ -174,7 +173,7 @@ int Fl_Tabs::handle(int event) { o = which(Fl::event_x(), Fl::event_y()); if (event == FL_RELEASE) { push(0); - if (o && Fl::visible_focus() && Fl::focus()!=this) { + if (o && Fl::visible_focus() && Fl::focus()!=this) { Fl::focus(this); redraw_tabs(); } @@ -201,7 +200,7 @@ int Fl_Tabs::handle(int event) { return ret; else if ( (H<0) && (Fl::event_y() < y()+h()+H) ) return ret; - else { + else { n = which(Fl::event_x(), Fl::event_y()); if (!n) n = this; } @@ -285,12 +284,13 @@ int Fl_Tabs::push(Fl_Widget *o) { return 1; } -/** - Gets the currently visible widget/tab. - The value() is the first visible child (or the last child if none - are visible) and this also hides any other children. - This allows the tabs to be deleted, moved to other groups, and - show()/hide() called without it screwing up. +/** + Gets the currently visible widget/tab. + + The value() is the first visible child (or the last child if none + are visible) and this also hides any other children. + This allows the tabs to be deleted, moved to other groups, and + show()/hide() called without it screwing up. */ Fl_Widget* Fl_Tabs::value() { Fl_Widget* v = 0; @@ -396,7 +396,7 @@ void Fl_Tabs::draw_tab(int x1, int x2, int W, int H, Fl_Widget* o, int what) { Fl_Color oc = o->labelcolor(); // Draw the label using the current color... - o->labelcolor(sel ? labelcolor() : o->labelcolor()); + o->labelcolor(sel ? labelcolor() : o->labelcolor()); o->draw_label(x1, y() + yofs, W, H - yofs, FL_ALIGN_CENTER); // Restore the original label color... @@ -437,25 +437,25 @@ void Fl_Tabs::draw_tab(int x1, int x2, int W, int H, Fl_Widget* o, int what) { } /** - Creates a new Fl_Tabs widget using the given position, size, - and label string. The default boxtype is FL_THIN_UP_BOX. - - Use add(Fl_Widget*) to add each child, which are usually - Fl_Group widgets. The children should be sized to stay - away from the top or bottom edge of the Fl_Tabs widget, - which is where the tabs will be drawn. - - All children of Fl_Tabs should have the same size and exactly fit on top of - each other. They should only leave space above or below where that tabs will - go, but not on the sides. If the first child of Fl_Tabs is set to - "resizable()", the riders will not resize when the tabs are resized. - - The destructor <I>also deletes all the children</I>. This - allows a whole tree to be deleted at once, without having to - keep a pointer to all the children in the user code. A kludge - has been done so the Fl_Tabs and all of its children - can be automatic (local) variables, but you must declare the - Fl_Tabs widget <I>first</I> so that it is destroyed last. + Creates a new Fl_Tabs widget using the given position, size, + and label string. The default boxtype is FL_THIN_UP_BOX. + + Use add(Fl_Widget*) to add each child, which are usually + Fl_Group widgets. The children should be sized to stay + away from the top or bottom edge of the Fl_Tabs widget, + which is where the tabs will be drawn. + + All children of Fl_Tabs should have the same size and exactly fit on top of + each other. They should only leave space above or below where the tabs will + go, but not on the sides. If the first child of Fl_Tabs is set to + "resizable()", the riders will not resize when the tabs are resized. + + The destructor <I>also deletes all the children</I>. This + allows a whole tree to be deleted at once, without having to + keep a pointer to all the children in the user code. A kludge + has been done so the Fl_Tabs and all of its children + can be automatic (local) variables, but you must declare the + Fl_Tabs widget <I>first</I> so that it is destroyed last. */ Fl_Tabs::Fl_Tabs(int X,int Y,int W, int H, const char *l) : Fl_Group(X,Y,W,H,l) @@ -478,27 +478,27 @@ Fl_Tabs::~Fl_Tabs() { } /** - Returns the position and size available to be used by its children. + Returns the position and size available to be used by its children. - If there isn't any child yet the \p tabh parameter will be used to - calculate the return values. This assumes that the children's labelsize - is the same as the Fl_Tabs' labelsize and adds a small border. + If there isn't any child yet the \p tabh parameter will be used to + calculate the return values. This assumes that the children's labelsize + is the same as the Fl_Tabs' labelsize and adds a small border. - If there are already children, the values of child(0) are returned, and - \p tabh is ignored. + If there are already children, the values of child(0) are returned, and + \p tabh is ignored. - \note Children should always use the same positions and sizes. + \note Children should always use the same positions and sizes. - \p tabh can be one of - \li 0: calculate label size, tabs on top - \li -1: calculate label size, tabs on bottom - \li > 0: use given \p tabh value, tabs on top (height = tabh) - \li < -1: use given \p tabh value, tabs on bottom (height = -tabh) + \p tabh can be one of + \li 0: calculate label size, tabs on top + \li -1: calculate label size, tabs on bottom + \li > 0: use given \p tabh value, tabs on top (height = tabh) + \li < -1: use given \p tabh value, tabs on bottom (height = -tabh) - \param[in] tabh position and optional height of tabs (see above) - \param[out] rx,ry,rw,rh (x,y,w,h) of client area for children + \param[in] tabh position and optional height of tabs (see above) + \param[out] rx,ry,rw,rh (x,y,w,h) of client area for children - \since FLTK 1.3.0 + \since FLTK 1.3.0 */ void Fl_Tabs::client_area(int &rx, int &ry, int &rw, int &rh, int tabh) { |
