[773] | 1 | // |
---|
| 2 | // "$Id: StringList.h 2973 2003-04-20 03:17:51Z easysw $" |
---|
| 3 | // |
---|
| 4 | // List that can be used in a Menu (and Browser) where each item |
---|
| 5 | // displays one string from an array. It is pretty much impossible to |
---|
| 6 | // describe a menu in less space than this. |
---|
| 7 | // |
---|
| 8 | // Copyright 1998-2003 by Bill Spitzak and others. |
---|
| 9 | // |
---|
| 10 | // This library is free software; you can redistribute it and/or |
---|
| 11 | // modify it under the terms of the GNU Library General Public |
---|
| 12 | // License as published by the Free Software Foundation; either |
---|
| 13 | // version 2 of the License, or (at your option) any later version. |
---|
| 14 | // |
---|
| 15 | // This library is distributed in the hope that it will be useful, |
---|
| 16 | // but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
| 17 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
---|
| 18 | // Library General Public License for more details. |
---|
| 19 | // |
---|
| 20 | // You should have received a copy of the GNU Library General Public |
---|
| 21 | // License along with this library; if not, write to the Free Software |
---|
| 22 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 |
---|
| 23 | // USA. |
---|
| 24 | // |
---|
| 25 | // Please report all bugs and problems to "fltk-bugs@fltk.org". |
---|
| 26 | // |
---|
| 27 | |
---|
| 28 | #ifndef fltk_StringList_h |
---|
| 29 | #define fltk_StringList_h |
---|
| 30 | |
---|
| 31 | #include "Menu.h" |
---|
| 32 | |
---|
| 33 | namespace fltk { |
---|
| 34 | |
---|
| 35 | class FL_API StringList : public List { |
---|
| 36 | const char* const * array; |
---|
| 37 | int children_; |
---|
| 38 | public: |
---|
| 39 | virtual int children(const Menu*, const int* indexes, int level); |
---|
| 40 | virtual Widget* child(const Menu*, const int* indexes, int level); |
---|
| 41 | StringList(const char*const* a, int n) : array(a), children_(n) {} |
---|
| 42 | StringList(const char*const* a); // null-terminated array |
---|
| 43 | StringList(const char* S); // nul-seperated string, double nul at end |
---|
| 44 | }; |
---|
| 45 | |
---|
| 46 | } |
---|
| 47 | |
---|
| 48 | #endif |
---|