00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031 #ifndef Fl_Check_Browser_H
00032 #define Fl_Check_Browser_H
00033
00034 #include "Fl.H"
00035 #include "Fl_Browser_.H"
00036
00041 class FL_EXPORT Fl_Check_Browser : public Fl_Browser_ {
00042
00043
00044 void *item_first() const;
00045 void *item_next(void *) const;
00046 void *item_prev(void *) const;
00047 int item_height(void *) const;
00048 int item_width(void *) const;
00049 void item_draw(void *, int, int, int, int) const;
00050 void item_select(void *, int);
00051 int item_selected(void *) const;
00052
00053
00054
00055 public:
00056
00057 #ifndef FL_DOXYGEN
00058
00059 struct cb_item {
00060 cb_item *next;
00061 cb_item *prev;
00062 char checked;
00063 char selected;
00064 char *text;
00065 };
00066 #endif // !FL_DOXYGEN
00067
00068 private:
00069
00070 cb_item *first;
00071 cb_item *last;
00072 cb_item *cache;
00073 int cached_item;
00074 int nitems_;
00075 int nchecked_;
00076 cb_item *find_item(int) const;
00077 int lineno(cb_item *) const;
00078
00079 public:
00080
00081 Fl_Check_Browser(int x, int y, int w, int h, const char *l = 0);
00083 ~Fl_Check_Browser() { clear(); }
00084 int add(char *s);
00085 int add(char *s, int b);
00086
00087 int remove(int item);
00088
00089
00091 int add(const char *s) { return add((char *)s); }
00093 int add(const char *s, int b) { return add((char *)s, b); }
00094
00095 void clear();
00100 int nitems() const { return nitems_; }
00102 int nchecked() const { return nchecked_; }
00103 int checked(int item) const;
00104 void checked(int item, int b);
00106 void set_checked(int item) { checked(item, 1); }
00107 void check_all();
00108 void check_none();
00109 int value() const;
00110 char *text(int item) const;
00111
00112 protected:
00113
00114 int handle(int);
00115 };
00116
00117 #endif // Fl_Check_Browser_H
00118
00119
00120
00121
00122