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