Skip to content

Commit

Permalink
Make check browser check boxes consistent with other widgets...
Browse files Browse the repository at this point in the history
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@2841 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
  • Loading branch information
michaelrsweet committed Nov 14, 2002
1 parent 7a89877 commit 9c557a3
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
2 changes: 2 additions & 0 deletions CHANGES
Expand Up @@ -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
Expand Down
17 changes: 12 additions & 5 deletions src/Fl_Check_Browser.cxx
@@ -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).
//
Expand Down Expand Up @@ -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());
Expand All @@ -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) {
Expand Down Expand Up @@ -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 $".
//

0 comments on commit 9c557a3

Please sign in to comment.