Author: TobiasFar
Date: 2008-07-17 12:37:04 -0700 (Thu, 17 Jul 2008)
New Revision: 6148
Log:
* adding support for newlines in columns of fltk::Browser; STR #2008 ( Thanks
to Brian Olsen )
* adding a multi line column to test/browser.cxx
* applying patch to make some test work on 64-bit systems ( Thanks to Brian
Olsen )
Modified:
trunk/src/Browser.cxx
trunk/test/Makefile
trunk/test/browser.cxx
trunk/test/callbacks.cxx
Modified: trunk/src/Browser.cxx
===================================================================
--- trunk/src/Browser.cxx 2008-07-16 06:35:10 UTC (rev 6147)
+++ trunk/src/Browser.cxx 2008-07-17 19:37:04 UTC (rev 6148)
@@ -860,8 +860,10 @@
int headerh = 0;
if (header_) {
- header_[0]->layout();
- headerh = header_[0]->h();
+ for (int i=0; i<nHeader; ++i) {
+ if (headerh < header_[i]->h())
+ headerh = header_[i]->h();
+ }
interior.move_y(headerh);
}
@@ -1743,8 +1745,11 @@
} // handle() method
void layout() {
- setfont(labelfont(),labelsize());
- h(int(getascent()+getdescent()+leading()+2));
+ if (h() == 0) {
+ int wide, high;
+ measure_label(wide, high);
+ h(high + leading() + 3);
+ }
Button::layout();
}
}; // BButton class
Modified: trunk/test/Makefile
===================================================================
--- trunk/test/Makefile 2008-07-16 06:35:10 UTC (rev 6147)
+++ trunk/test/Makefile 2008-07-17 19:37:04 UTC (rev 6148)
@@ -45,7 +45,7 @@
CPPFILES = \
CubeMain.cxx \
CubeView.cxx \
- ansiwidget.cxx \
+ ansiwidget.cxx \
arc.cxx \
ask.cxx \
bitmap.cxx \
@@ -123,6 +123,7 @@
boxtype$(EXEEXT) \
browser$(EXEEXT) \
cairo$(EXEEXT) \
+ callbacks$(EXEEXT) \
checkers$(EXEEXT) \
clock$(EXEEXT) \
button$(EXEEXT) \
@@ -167,6 +168,7 @@
scroll$(EXEEXT) \
shape$(EXEEXT) \
sizes$(EXEEXT) \
+ subwindow$(EXEEXT) \
symbols$(EXEEXT) \
threads$(EXEEXT) \
tabs$(EXEEXT) \
Modified: trunk/test/browser.cxx
===================================================================
--- trunk/test/browser.cxx 2008-07-16 06:35:10 UTC (rev 6147)
+++ trunk/test/browser.cxx 2008-07-17 19:37:04 UTC (rev 6148)
@@ -158,7 +158,7 @@
printf("Button %s pushed\n", b->label());
}
-const char *labels[] = {"Column 1", "Column 2", "Column 3", 0};
+const char *labels[] = {"Column 1", "Column 2\nwith new\nlines", "Column 3",
0};
int widths[] = {100, 70, 70, 0};
Browser *browser=0;
Modified: trunk/test/callbacks.cxx
===================================================================
--- trunk/test/callbacks.cxx 2008-07-16 06:35:10 UTC (rev 6147)
+++ trunk/test/callbacks.cxx 2008-07-17 19:37:04 UTC (rev 6148)
@@ -44,7 +44,8 @@
intinput.value(0.0);
Button copy_button(110, 10, 100, 20, "copy to slider");
Slider slider(10,35,300,20);
- slider.type(Slider::HORIZONTAL|Slider::TICK_ABOVE);
+ slider.type(Slider::TICK_ABOVE);
+ slider.clear_flag(LAYOUT_VERTICAL);
slider.callback(slider_callback);
copy_button.callback(copy_callback, &slider);
slider.range(-10,10);
_______________________________________________
fltk-commit mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-commit