#include <dali-toolkit/internal/controls/text-controls/text-field-impl.h>
// EXTERNAL INCLUDES
-#include <string>
-#include <iostream>
#include <cstring>
#include <dali/public-api/adaptor-framework/key.h>
#include <dali/public-api/common/stage.h>
#include <dali/public-api/images/resource-image.h>
-#include <dali/public-api/object/type-registry.h>
-#include <dali/devel-api/object/type-registry-helper.h>
-#include <dali/devel-api/scripting/scripting.h>
#include <dali/devel-api/adaptor-framework/virtual-keyboard.h>
+#include <dali/devel-api/object/type-registry-helper.h>
#include <dali/integration-api/debug.h>
// INTERNAL INCLUDES
#include <dali-toolkit/public-api/text/rendering-backend.h>
-#include <dali-toolkit/internal/text/layouts/layout-engine.h>
+#include <dali-toolkit/internal/controls/text-controls/text-font-style.h>
#include <dali-toolkit/internal/text/rendering/text-backend.h>
#include <dali-toolkit/internal/text/text-view.h>
#include <dali-toolkit/internal/styling/style-manager-impl.h>
#endif
const unsigned int DEFAULT_RENDERING_BACKEND = Dali::Toolkit::Text::DEFAULT_RENDERING_BACKEND;
-
} // unnamed namespace
namespace
{
const std::string fontFamily = value.Get< std::string >();
DALI_LOG_INFO( gLogFilter, Debug::General, "TextField %p FONT_FAMILY %s\n", impl.mController.Get(), fontFamily.c_str() );
-
- if( impl.mController->GetDefaultFontFamily() != fontFamily )
- {
- impl.mController->SetDefaultFontFamily( fontFamily, true ); // "true" as SetProperty means user defined font so don't change when system font changes.
- }
+ impl.mController->SetDefaultFontFamily( fontFamily );
}
break;
}
case Toolkit::TextField::Property::FONT_STYLE:
{
- if( impl.mController )
- {
- const std::string fontStyle = value.Get< std::string >();
- DALI_LOG_INFO( gLogFilter, Debug::General, "TextField %p FONT_STYLE %s\n", impl.mController.Get(), fontStyle.c_str() );
-
- if( impl.mController->GetDefaultFontStyle() != fontStyle )
- {
- impl.mController->SetDefaultFontStyle( fontStyle );
- }
- }
+ SetFontStyleProperty( impl.mController, value );
break;
}
case Toolkit::TextField::Property::POINT_SIZE:
{
const Image image = Scripting::NewImage( value );
- if( impl.mDecorator )
+ if( impl.mDecorator && image )
{
impl.mDecorator->SetHandleImage( LEFT_SELECTION_HANDLE, HANDLE_IMAGE_RELEASED, image );
impl.RequestTextRelayout();
{
const Image image = Scripting::NewImage( value );
- if( impl.mDecorator )
+ if( impl.mDecorator && image )
{
impl.mDecorator->SetHandleImage( RIGHT_SELECTION_HANDLE, HANDLE_IMAGE_RELEASED, image );
impl.RequestTextRelayout();
{
const Image image = Scripting::NewImage( value );
- if( impl.mDecorator )
+ if( impl.mDecorator && image )
{
impl.mDecorator->SetHandleImage( LEFT_SELECTION_HANDLE, HANDLE_IMAGE_PRESSED, image );
impl.RequestTextRelayout();
{
const Image image = Scripting::NewImage( value );
- if( impl.mDecorator )
+ if( impl.mDecorator && image )
{
impl.mDecorator->SetHandleImage( RIGHT_SELECTION_HANDLE, HANDLE_IMAGE_PRESSED, image );
impl.RequestTextRelayout();
case Toolkit::TextField::Property::SELECTION_HANDLE_MARKER_IMAGE_LEFT:
{
const Image image = Scripting::NewImage( value );
- if( impl.mDecorator )
+
+ if( impl.mDecorator && image )
{
impl.mDecorator->SetHandleImage( LEFT_SELECTION_HANDLE_MARKER, HANDLE_IMAGE_RELEASED, image );
impl.RequestTextRelayout();
case Toolkit::TextField::Property::SELECTION_HANDLE_MARKER_IMAGE_RIGHT:
{
const Image image = Scripting::NewImage( value );
- if( impl.mDecorator )
+
+ if( impl.mDecorator && image )
{
impl.mDecorator->SetHandleImage( RIGHT_SELECTION_HANDLE_MARKER, HANDLE_IMAGE_RELEASED, image );
impl.RequestTextRelayout();
}
case Toolkit::TextField::Property::FONT_STYLE:
{
- if( impl.mController )
- {
- value = impl.mController->GetDefaultFontStyle();
- }
+ GetFontStyleProperty( impl.mController, value );
break;
}
case Toolkit::TextField::Property::POINT_SIZE:
{
if( impl.mDecorator )
{
- value = impl.mDecorator->GetBoundingBox();
+ Rect<int> boundingBox;
+ impl.mDecorator->GetBoundingBox( boundingBox );
+ value = boundingBox;
}
break;
}
self.TouchedSignal().Connect( this, &TextField::OnTouched );
// Set BoundingBox to stage size if not already set.
- if ( mDecorator->GetBoundingBox().IsEmpty() )
+ Rect<int> boundingBox;
+ mDecorator->GetBoundingBox( boundingBox );
+
+ if( boundingBox.IsEmpty() )
{
Vector2 stageSize = Dali::Stage::GetCurrent().GetSize();
mDecorator->SetBoundingBox( Rect<int>( 0.0f, 0.0f, stageSize.width, stageSize.height ) );