当前位置: 首页>>代码示例>>C++>>正文


C++ TextInput::SetHeightExceedPolicy方法代码示例

本文整理汇总了C++中TextInput::SetHeightExceedPolicy方法的典型用法代码示例。如果您正苦于以下问题:C++ TextInput::SetHeightExceedPolicy方法的具体用法?C++ TextInput::SetHeightExceedPolicy怎么用?C++ TextInput::SetHeightExceedPolicy使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TextInput的用法示例。


在下文中一共展示了TextInput::SetHeightExceedPolicy方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: UtcDaliTextInputSetAndGetHeightExceedPolicy

int UtcDaliTextInputSetAndGetHeightExceedPolicy(void)
{
  ToolkitTestApplication application;

  tet_infoline("UtcDaliTextInputSetAndGetHeightExceedPolicy: ");

  const TextView::ExceedPolicy EXCEED_POLICIES[] = { TextView::Original, TextView::Fade, TextView::ShrinkToFit };
  const unsigned int NUM_EXCEED_POLICIES = sizeof( EXCEED_POLICIES ) / sizeof( unsigned int );

  TextInput textInput = TextInput::New();
  textInput.SetInitialText( "Hello world!" );

  for( unsigned int epIndex = 0; epIndex < NUM_EXCEED_POLICIES; ++epIndex )
  {
    textInput.SetHeightExceedPolicy( EXCEED_POLICIES[epIndex] );

    DALI_TEST_EQUALS( textInput.GetHeightExceedPolicy(), EXCEED_POLICIES[epIndex], TEST_LOCATION );
  }
  END_TEST;
}
开发者ID:Tarnyko,项目名称:dal-toolkit,代码行数:20,代码来源:utc-Dali-TextInput.cpp

示例2: UtcDaliTextInputScroll

int UtcDaliTextInputScroll(void)
{
  tet_infoline("UtcDaliTextInputScroll: ");
  ToolkitTestApplication application;

  // Avoids the frame buffer texture to throw an exception.
  application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE );

  TextInput view = TextInput::New();
  view.SetMultilinePolicy( TextView::SplitByNewLineChar );
  view.SetWidthExceedPolicy( TextView::Original );
  view.SetHeightExceedPolicy( TextView::Original );
  view.SetTextAlignment( static_cast<Toolkit::Alignment::Type>( Toolkit::Alignment::HorizontalCenter | Toolkit::Alignment::VerticalCenter ) );
  view.SetInitialText( "Hello world! This is a scroll test." );
  view.SetSize( 100.f, 100.f );
  view.SetSnapshotModeEnabled( false );

  Stage::GetCurrent().Add( view );

  application.SendNotification();
  application.Render();

  DALI_TEST_CHECK( !view.IsScrollEnabled() ); // Scroll should be disabled by default.

  view.SetScrollEnabled( true );

  DALI_TEST_CHECK( view.IsScrollEnabled() );
  DALI_TEST_CHECK( view.IsSnapshotModeEnabled() ); // Scroll should enable snapshot mode.

  view.SetScrollPosition( Vector2( 400.f, 400.f ) );

  application.SendNotification();
  application.Render();

  const Vector2& scrollPosition = view.GetScrollPosition();
  DALI_TEST_EQUALS( scrollPosition, Vector2( 149.153656f, 0.f ), Math::MACHINE_EPSILON_1000, TEST_LOCATION );
  END_TEST;
}
开发者ID:Tarnyko,项目名称:dal-toolkit,代码行数:38,代码来源:utc-Dali-TextInput.cpp


注:本文中的TextInput::SetHeightExceedPolicy方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。