1 /*! 2 @file 3 @author Albert Semenov 4 @date 12/2010 5 */ 6 7 #include "Precompiled.h" 8 #include "PropertyFieldNumeric.h" 9 #include "Parse.h" 10 11 namespace tools 12 { 13 PropertyFieldNumeric(MyGUI::Widget * _parent)14 PropertyFieldNumeric::PropertyFieldNumeric(MyGUI::Widget* _parent) : 15 PropertyFieldEditBox(_parent) 16 { 17 } 18 onCheckValue()19 bool PropertyFieldNumeric::onCheckValue() 20 { 21 bool success = true; 22 23 if ("1 int" == mType) 24 success = utility::checkParse<int>(mField, 1); 25 else if ("2 int" == mType) 26 success = utility::checkParse<int>(mField, 2); 27 else if ("4 int" == mType) 28 success = utility::checkParse<int>(mField, 4); 29 else if ("1 float" == mType) 30 success = utility::checkParse<float>(mField, 1); 31 else if ("2 float" == mType) 32 success = utility::checkParse<float>(mField, 2); 33 34 return success; 35 } 36 37 } 38