Implemented osgUI::Validator, IntValidator and DoubleValidator classes that manage validation/specialization of LineEdit widgets to work with just integer or double values.
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14398 16af8721-9629-0410-8352-f15c8da7e697
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
#define OSGUI_LINEEDIT
|
||||
|
||||
#include <osgUI/Widget>
|
||||
#include <osgUI/Validator>
|
||||
#include <osgText/Text>
|
||||
|
||||
namespace osgUI
|
||||
@@ -35,9 +36,9 @@ public:
|
||||
virtual void enterImplementation();
|
||||
virtual void leaveImplementation();
|
||||
|
||||
|
||||
virtual bool validate(const std::string& text);
|
||||
virtual bool validateImplementation(const std::string& text);
|
||||
void setValidator(Validator* validator) { _validator = validator; }
|
||||
Validator* getValidator() { return _validator.get(); }
|
||||
const Validator* getValidator() const { return _validator.get(); }
|
||||
|
||||
virtual void textChanged(const std::string& text);
|
||||
virtual void textChangedImplementation(const std::string& text);
|
||||
@@ -48,6 +49,8 @@ public:
|
||||
protected:
|
||||
virtual ~LineEdit() {}
|
||||
|
||||
osg::ref_ptr<Validator> _validator;
|
||||
|
||||
std::string _text;
|
||||
|
||||
// implementation detail
|
||||
|
||||
Reference in New Issue
Block a user