diff --git a/headers/os/interface/TextControl.h b/headers/os/interface/TextControl.h index a99e91a596..49fd7b5321 100644 --- a/headers/os/interface/TextControl.h +++ b/headers/os/interface/TextControl.h @@ -1,5 +1,5 @@ /* - * Copyright 2006-2012, Haiku, Inc. All rights reserved. + * Copyright 2006-2015, Haiku, Inc. All rights reserved. * Distributed under the terms of the MIT License. */ #ifndef _TEXT_CONTROL_H @@ -40,6 +40,7 @@ public: virtual void SetText(const char* text); const char* Text() const; + int32 TextLength() const; void MarkAsInvalid(bool invalid); virtual void SetValue(int32 value); @@ -145,4 +146,5 @@ private: uint32 _reserved[8]; }; + #endif // _TEXT_CONTROL_H diff --git a/src/kits/interface/TextControl.cpp b/src/kits/interface/TextControl.cpp index 5065accd75..3e2707f3fa 100644 --- a/src/kits/interface/TextControl.cpp +++ b/src/kits/interface/TextControl.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2001-2012, Haiku Inc. + * Copyright 2001-2015, Haiku Inc. * Distributed under the terms of the MIT License. * * Authors: @@ -567,6 +567,13 @@ BTextControl::Text() const } +int32 +BTextControl::TextLength() const +{ + return fText->TextLength(); +} + + void BTextControl::MarkAsInvalid(bool invalid) {