Mercurial > hg > octave-lyh
comparison src/graphics.cc @ 6938:688ef9440022
[project @ 2007-10-01 15:59:33 by dbateman]
author | dbateman |
---|---|
date | Mon, 01 Oct 2007 16:01:53 +0000 |
parents | 1401a79af68c |
children | 6bbf56a9718a |
comparison
equal
deleted
inserted
replaced
6937:ee12d56c4200 | 6938:688ef9440022 |
---|---|
120 } | 120 } |
121 | 121 |
122 return retval; | 122 return retval; |
123 } | 123 } |
124 | 124 |
125 color_property::color_property (const octave_value& val, const radio_values &v) | 125 color_property::color_property (const octave_value& val) |
126 : radio_val (v), current_val () | 126 : radio_val (), current_val () |
127 { | 127 { |
128 // FIXME -- need some error checking here. | 128 // FIXME -- need some error checking here. |
129 | 129 |
130 if (val.is_string ()) | 130 if (val.is_string ()) |
131 { | 131 { |
132 std::string s = val.string_value (); | 132 std::string s = val.string_value (); |
133 | 133 |
134 if (! s.empty ()) | 134 if (! s.empty ()) |
135 { | 135 { |
136 if (radio_val.contains (s)) | 136 color_values col (s); |
137 if (! error_state) | |
137 { | 138 { |
138 current_val = s; | 139 color_val = col; |
139 current_type = radio_t; | 140 current_type = color_t; |
140 } | |
141 else | |
142 { | |
143 color_values col (s); | |
144 if (! error_state) | |
145 { | |
146 color_val = col; | |
147 current_type = color_t; | |
148 } | |
149 } | 141 } |
150 } | 142 } |
151 else | 143 else |
152 error ("invalid color specification"); | 144 error ("invalid color specification"); |
153 } | 145 } |
2129 else if (name.compare ("ydata")) | 2121 else if (name.compare ("ydata")) |
2130 set_ydata (val); | 2122 set_ydata (val); |
2131 else if (name.compare ("zdata")) | 2123 else if (name.compare ("zdata")) |
2132 set_zdata (val); | 2124 set_zdata (val); |
2133 else if (name.compare ("facecolor")) | 2125 else if (name.compare ("facecolor")) |
2134 set_facecolor (color_property (val, radio_values ("flat|none|interp"))); | 2126 set_facecolor (val); |
2135 else if (name.compare ("facealpha")) | 2127 else if (name.compare ("facealpha")) |
2136 set_facealpha (val); | 2128 set_facealpha (val); |
2137 else if (name.compare ("edgecolor")) | 2129 else if (name.compare ("edgecolor")) |
2138 set_edgecolor (val); | 2130 set_edgecolor (val); |
2139 else if (name.compare ("linestyle")) | 2131 else if (name.compare ("linestyle")) |