2 // "$Id: Fl_Check_Browser.H,v 1.2 2002/12/01 15:38:37 neurosurg Exp $"
4 // Fl_Check_Browser header file for the Fast Light Tool Kit (FLTK).
6 // Copyright 1998-2002 by Bill Spitzak and others.
8 // This library is free software; you can redistribute it and/or
9 // modify it under the terms of the GNU Library General Public
10 // License as published by the Free Software Foundation; either
11 // version 2 of the License, or (at your option) any later version.
13 // This library is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 // Library General Public License for more details.
18 // You should have received a copy of the GNU Library General Public
19 // License along with this library; if not, write to the Free Software
20 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
23 // Please report all bugs and problems to "fltk-bugs@fltk.org".
26 #ifndef Fl_Check_Browser_H
27 #define Fl_Check_Browser_H
30 #include "Fl_Browser_.H"
32 class FL_EXPORT Fl_Check_Browser : public Fl_Browser_ {
33 /* required routines for Fl_Browser_ subclass: */
35 void *item_first() const;
36 void *item_next(void *) const;
37 void *item_prev(void *) const;
38 int item_height(void *) const;
39 int item_width(void *) const;
40 void item_draw(void *, int, int, int, int) const;
41 void item_select(void *, int);
42 int item_selected(void *) const;
46 public: // IRIX 5.3 C++ compiler doesn't support private structures...
64 cb_item *find_item(int) const;
65 int lineno(cb_item *) const;
69 Fl_Check_Browser(int x, int y, int w, int h, const char *l = 0);
71 int add(char *s); // add an (unchecked) item
72 int add(char *s, int b); // add an item and set checked
73 // both return the new nitems()
75 // inline const char * methods to avoid breaking binary compatibility...
76 int add(const char *s) { return add((char *)s); }
77 int add(const char *s, int b) { return add((char *)s, b); }
79 void clear(); // delete all items
80 int nitems() const { return nitems_; }
81 int nchecked() const { return nchecked_; }
82 int checked(int item) const;
83 void checked(int item, int b);
84 void set_checked(int item) { checked(item, 1); }
87 int value() const; // currently selected item
88 char *text(int item) const; // returns pointer to internal buffer
91 #endif // Fl_Check_Browser_H
94 // End of "$Id: Fl_Check_Browser.H,v 1.2 2002/12/01 15:38:37 neurosurg Exp $".