summaryrefslogtreecommitdiff
path: root/src/Fl_Tabs.cxx
diff options
context:
space:
mode:
authorBill Spitzak <spitzak@gmail.com>1999-07-22 07:27:12 +0000
committerBill Spitzak <spitzak@gmail.com>1999-07-22 07:27:12 +0000
commit0bb590c832fb50a6bcf40aecbae2cad918ebee94 (patch)
treebd7153ec8d97c9f0fd51207da8e5aed9623e52ba /src/Fl_Tabs.cxx
parentae621ef7787392b1214a4a662a9f70e7c3a74794 (diff)
Pragma added around xlib.h to shut up the IRIX compiler warnings
Fluid writes "class foo;" to the header and c file without prepending "extern" or "static". This patch also does this to "class foo bar;" which is wrong... Tabs draw very short labels. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.0@629 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/Fl_Tabs.cxx')
-rw-r--r--src/Fl_Tabs.cxx12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/Fl_Tabs.cxx b/src/Fl_Tabs.cxx
index c483e5dd9..465f9dbd6 100644
--- a/src/Fl_Tabs.cxx
+++ b/src/Fl_Tabs.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: Fl_Tabs.cxx,v 1.6.2.1 1999/07/06 16:16:38 mike Exp $"
+// "$Id: Fl_Tabs.cxx,v 1.6.2.2 1999/07/22 07:27:11 bill Exp $"
//
// Tab widget for the Fast Light Tool Kit (FLTK).
//
@@ -53,6 +53,7 @@ int Fl_Tabs::tab_positions(int* p, int* w) {
if (o->label()) {
int wt = 0; int ht = 0; o->measure_label(wt,ht);
w[i] = wt+TABSLOPE;
+ if (2*TABSLOPE > w[i]) w[i] = 2*TABSLOPE;
} else
w[i] = 2*TABSLOPE;
p[i+1] = p[i]+w[i];
@@ -174,9 +175,10 @@ Fl_Widget* Fl_Tabs::value() {
int Fl_Tabs::value(Fl_Widget *o) {
if (value_ == o) return 0;
- if (value_) value_->hide();
- if (o) o->show();
+ Fl_Widget* oldvalue = value_;
value_ = o;
+ if (o) o->show();
+ if (oldvalue) oldvalue->hide();
redraw();
do_callback();
return 1;
@@ -246,7 +248,7 @@ void Fl_Tabs::draw_tab(int x1, int x2, int W, int H, Fl_Widget* o, int what) {
fl_color(!sel && o==push_ ? FL_DARK3 : FL_LIGHT3);
fl_line(x1, y()+h()+H, x1+TABSLOPE, y()+h()-1);
}
- if (x2-x1 > 2*TABSLOPE)
+ if (W > TABSLOPE)
o->draw_label(what==LEFT ? x1+TABSLOPE : x2-W+TABSLOPE,
y()+(H<0?h()+H-3:0), W-TABSLOPE,
(H<0?-H:H)+3, FL_ALIGN_CENTER);
@@ -259,5 +261,5 @@ Fl_Tabs::Fl_Tabs(int X,int Y,int W, int H, const char *l) :
}
//
-// End of "$Id: Fl_Tabs.cxx,v 1.6.2.1 1999/07/06 16:16:38 mike Exp $".
+// End of "$Id: Fl_Tabs.cxx,v 1.6.2.2 1999/07/22 07:27:11 bill Exp $".
//