Changeset 13041 for OpenSceneGraph/trunk/src/osgWidget/StyleManager.cpp
- Timestamp:
- 03/21/12 18:36:20 (14 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/src/osgWidget/StyleManager.cpp
r12292 r13041 26 26 if(_match("pos %i %i", r) || _match("pos %f %f", r)) { 27 27 r.readSequence(vec2); 28 28 29 29 widget->setOrigin(vec2); 30 30 } … … 32 32 else if(_match("pos-x %i", r) || _match("pos-x %f", r)) { 33 33 r.readSequence(f); 34 34 35 35 widget->setX(f); 36 36 } … … 38 38 else if(_match("pos-y %i", r) || _match("pos-y %f", r)) { 39 39 r.readSequence(f); 40 40 41 41 widget->setY(f); 42 42 } … … 44 44 else if(_match("size %i %i", r) || _match("size %f %f", r)) { 45 45 r.readSequence(vec2); 46 46 47 47 widget->setSize(vec2); 48 48 } … … 50 50 else if(_match("width %i", r) || _match("width %f", r)) { 51 51 r.readSequence(f); 52 52 53 53 widget->setWidth(f); 54 54 } … … 56 56 else if(_match("height %i", r) || _match("height %f", r)) { 57 57 r.readSequence(f); 58 58 59 59 widget->setHeight(f); 60 60 } … … 63 63 else if(_match("color %i %i %i %i", r)) { 64 64 r.readSequence(vec4); 65 65 66 66 widget->setColor(vec4 / 255.0f); 67 67 } … … 70 70 else if(_match("color %i %i %i", r)) { 71 71 r.readSequence(vec3); 72 72 73 73 widget->setColor(osg::Vec4(vec3[0], vec3[1], vec3[2], 255.0f) / 255.0f); 74 74 } 75 75 76 76 // Color using 4x 0.0f-1.0f floats. 77 77 else if(_match("color %f %f %f %f", r)) { 78 78 r.readSequence(vec4); 79 79 80 80 widget->setColor(vec4); 81 81 } … … 84 84 else if(_match("color %f %f %f", r)) { 85 85 r.readSequence(vec3); 86 86 87 87 widget->setColor(osg::Vec4(vec3[0], vec3[1], vec3[2], 1.0f)); 88 88 } … … 91 91 else if(_match("padding %i", r)) { 92 92 r.readSequence(f); 93 93 94 94 widget->setPadding(f); 95 95 } … … 98 98 else if(_match("padding-left %i", r)) { 99 99 r.readSequence(f); 100 100 101 101 widget->setPadLeft(f); 102 102 } … … 105 105 else if(_match("padding-right %i", r)) { 106 106 r.readSequence(f); 107 107 108 108 widget->setPadRight(f); 109 109 } … … 112 112 else if(_match("padding-top %i", r)) { 113 113 r.readSequence(f); 114 114 115 115 widget->setPadTop(f); 116 116 } … … 119 119 else if(_match("padding-bottom %i", r)) { 120 120 r.readSequence(f); 121 121 122 122 widget->setPadBottom(f); 123 123 } … … 137 137 else if(_match("halign %w", r)) { 138 138 r.readSequence(str); 139 139 140 140 widget->setAlignHorizontal(strToHAlign(str)); 141 141 } … … 179 179 if(_match("pos %i %i", r) || _match("pos %f %f", r)) { 180 180 r.readSequence(vec2); 181 181 182 182 window->setOrigin(vec2.x(), vec2.y()); 183 183 } … … 185 185 else if(_match("pos-x %i", r) || _match("pos-x %f", r)) { 186 186 r.readSequence(f); 187 187 188 188 window->setX(f); 189 189 } … … 191 191 else if(_match("pos-y %i", r) || _match("pos-y %f", r)) { 192 192 r.readSequence(f); 193 193 194 194 window->setY(f); 195 195 } … … 203 203 else if(_match("width %i", r) || _match("width %f", r)) { 204 204 r.readSequence(f); 205 205 206 206 window->resize(f); 207 207 } … … 209 209 else if(_match("height %i", r) || _match("height %f", r)) { 210 210 r.readSequence(f); 211 211 212 212 window->resize(0.0f, f); 213 213 } … … 252 252 253 253 else if(l == "low") return Widget::LAYER_LOW; 254 254 255 255 else if(l == "bg") return Widget::LAYER_BG; 256 256 … … 313 313 bool Style::strToFill(const std::string& fill) { 314 314 std::string cm = lowerCase(fill); 315 315 316 316 if(cm == "true") return true; 317 317
