Make check browser check boxes consistent with other widgets...

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@2841 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Michael R Sweet 2002-11-14 21:25:13 +00:00
parent 7a89877eee
commit 9c557a3b87
2 changed files with 14 additions and 5 deletions

View File

@ -4,6 +4,8 @@ CHANGES IN FLTK 1.1.2
text widgets.
- Fl_Check_Browser didn't provide const char * add
methods as documented.
- Fl_Check_Browser didn't draw the same style of check
marks at the other widgets.
- Fl_Button, Fl_Choice, and Fl_Menu_Button incorrectly
activated the button/menu when the spacebar was
pressed in conjunction with shift, control, alt, or

View File

@ -1,5 +1,5 @@
//
// "$Id: Fl_Check_Browser.cxx,v 1.1.2.5 2002/08/09 01:09:48 easysw Exp $"
// "$Id: Fl_Check_Browser.cxx,v 1.1.2.6 2002/11/14 21:25:13 easysw Exp $"
//
// Fl_Check_Browser header file for the Fast Light Tool Kit (FLTK).
//
@ -107,7 +107,7 @@ int Fl_Check_Browser::item_height(void *) const {
return textsize() + 2;
}
#define CHECK_SIZE 8
#define CHECK_SIZE (textsize()-2)
int Fl_Check_Browser::item_width(void *v) const {
fl_font(textfont(), textsize());
@ -126,8 +126,15 @@ void Fl_Check_Browser::item_draw(void *v, int X, int Y, int, int) const {
fl_loop(X, cy, X, cy + CHECK_SIZE,
X + CHECK_SIZE, cy + CHECK_SIZE, X + CHECK_SIZE, cy);
if (i->checked) {
fl_line(X, cy, X + CHECK_SIZE, cy + CHECK_SIZE);
fl_line(X, cy + CHECK_SIZE, X + CHECK_SIZE, cy);
int tx = X + 3;
int tw = CHECK_SIZE - 4;
int d1 = tw/3;
int d2 = tw-d1;
int ty = cy + (CHECK_SIZE+d2)/2-d1-2;
for (int n = 0; n < 3; n++, ty++) {
fl_line(tx, ty, tx+d1, ty+d1);
fl_line(tx+d1, ty+d1, tx+tw-1, ty+d1-d2+1);
}
}
fl_font(textfont(), tsize);
if (i->selected) {
@ -259,5 +266,5 @@ void Fl_Check_Browser::check_none() {
//
// End of "$Id: Fl_Check_Browser.cxx,v 1.1.2.5 2002/08/09 01:09:48 easysw Exp $".
// End of "$Id: Fl_Check_Browser.cxx,v 1.1.2.6 2002/11/14 21:25:13 easysw Exp $".
//