Last change
on this file since 1389 was
1386,
checked in by dkearney, 15 years ago
|
adding a few object prototypes we can play with for future developement. the plot object is probably the most interesting. examples are located in examples/objects dirs
|
File size:
1.6 KB
|
Line | |
---|
1 | /* |
---|
2 | * ====================================================================== |
---|
3 | * AUTHOR: Derrick Kearney, Purdue University |
---|
4 | * Copyright (c) 2005-2009 Purdue Research Foundation |
---|
5 | * |
---|
6 | * See the file "license.terms" for information on usage and |
---|
7 | * redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. |
---|
8 | * ====================================================================== |
---|
9 | */ |
---|
10 | #include <errno.h> |
---|
11 | #include "RpVariable.h" |
---|
12 | #include "RpChain.h" |
---|
13 | |
---|
14 | #ifndef RAPPTURE_CHOICE_H |
---|
15 | #define RAPPTURE_CHOICE_H |
---|
16 | |
---|
17 | namespace Rappture { |
---|
18 | |
---|
19 | class Choice : public Variable |
---|
20 | { |
---|
21 | public: |
---|
22 | |
---|
23 | Choice ( const char *path, |
---|
24 | const char *val ); |
---|
25 | |
---|
26 | Choice ( const char *path, |
---|
27 | const char *val, |
---|
28 | const char *label, |
---|
29 | const char *desc); |
---|
30 | |
---|
31 | Choice ( const Choice& o ); |
---|
32 | virtual ~Choice (); |
---|
33 | |
---|
34 | Accessor<const char *> def; |
---|
35 | Accessor<const char *> cur; |
---|
36 | |
---|
37 | Choice& addOption ( const char *label, |
---|
38 | const char *desc, |
---|
39 | const char *val ); |
---|
40 | |
---|
41 | Choice& delOption ( const char *label); |
---|
42 | |
---|
43 | private: |
---|
44 | |
---|
45 | // hash or linked list of preset values |
---|
46 | Rp_Chain *_options; |
---|
47 | |
---|
48 | struct option{ |
---|
49 | Accessor<const char *> label; |
---|
50 | Accessor<const char *> desc; |
---|
51 | Accessor<const char *> val; |
---|
52 | }; |
---|
53 | }; |
---|
54 | |
---|
55 | } // namespace Rappture |
---|
56 | |
---|
57 | /*--------------------------------------------------------------------------*/ |
---|
58 | /*--------------------------------------------------------------------------*/ |
---|
59 | |
---|
60 | #endif |
---|
Note: See
TracBrowser
for help on using the repository browser.