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


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

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


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

示例1: UtcDaliTextInputStartSignalEmit

int UtcDaliTextInputStartSignalEmit(void)
{
  ToolkitTestApplication application;

  tet_infoline("Testing SetEditable emits start signal");

  TextInput textInput = TextInput::New();  // create empty TextInput

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

  textInput.InputStartedSignal().Connect( &OnStartInput );

  gHasStartSignalBeenReceived = false;

  textInput.SetEditable(true);  // Set editable first time

  DALI_TEST_EQUALS(true, gHasStartSignalBeenReceived, TEST_LOCATION);

  gHasStartSignalBeenReceived = false;

  textInput.SetEditable(true); // Set editable second time, signal should not be sent again.

  DALI_TEST_EQUALS(false, gHasStartSignalBeenReceived, TEST_LOCATION);

  textInput.SetEditable(false);

  gHasStartSignalBeenReceived = false;

  textInput.SetEditable(true);  // Set editable again

  DALI_TEST_EQUALS(true, gHasStartSignalBeenReceived, TEST_LOCATION);
  END_TEST;
}
开发者ID:Tarnyko,项目名称:dal-toolkit,代码行数:33,代码来源:utc-Dali-TextInput.cpp

示例2: UtcDaliTextInputSetEditableAndIsEditable

int UtcDaliTextInputSetEditableAndIsEditable(void)
{
  ToolkitTestApplication application;

  tet_infoline("Testing SetEditable And IsEditable");

  const std::string initialString = "initial text";

  TextInput textInput = TextInput::New();  // create empty TextInput
  textInput.SetInitialText( initialString );

  Stage::GetCurrent().Add(textInput);
  application.SendNotification();
  application.Render();

  bool editableStateFalse ( false );
  bool editableStateTrue ( true );

  textInput.SetEditable ( editableStateFalse );
  application.SendNotification();
  application.Render();
  DALI_TEST_EQUALS( editableStateFalse, textInput.IsEditable() , TEST_LOCATION);

  textInput.SetEditable ( editableStateTrue );
  application.SendNotification();
  application.Render();
  DALI_TEST_EQUALS( editableStateTrue, textInput.IsEditable() , TEST_LOCATION);
  END_TEST;
}
开发者ID:Tarnyko,项目名称:dal-toolkit,代码行数:29,代码来源:utc-Dali-TextInput.cpp

示例3: UtcDaliTextInputExceedMaxCharacters

int UtcDaliTextInputExceedMaxCharacters(void)
{
  ToolkitTestApplication application;

  tet_infoline("Testing Max characters is obeyed when inputting key events ");

  TextInput textInput = TextInput::New();  // create empty TextInput

  Stage::GetCurrent().Add(textInput);
  textInput.SetMaxCharacterLength(4);
  textInput.SetInitialText("");
  textInput.SetEditable(true);

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

  Integration::KeyEvent eventA("a", "a", 0, 0, 0, Integration::KeyEvent::Down );
  Integration::KeyEvent eventB("b", "b", 0, 0, 0, Integration::KeyEvent::Down );

  application.ProcessEvent(eventA);
  application.ProcessEvent(eventB);
  application.ProcessEvent(eventA);
  application.ProcessEvent(eventB);

  application.ProcessEvent(eventA);
  application.ProcessEvent(eventB);

  tet_printf( "Get text result : %s\n", textInput.GetText().c_str());

  DALI_TEST_EQUALS("abab",textInput.GetText(), TEST_LOCATION); // Get text which should be only 4 characters
  END_TEST;
}
开发者ID:Tarnyko,项目名称:dal-toolkit,代码行数:32,代码来源:utc-Dali-TextInput.cpp

示例4: UtcDaliTextInputTextSelection

int UtcDaliTextInputTextSelection(void)
{
  ToolkitTestApplication application;

  tet_infoline("Testing Text Selection");

  const std::string initialString = "initial text";

  TextInput textInput = TextInput::New();
  textInput.SetInitialText( initialString );

  Stage::GetCurrent().Add(textInput);
  application.SendNotification();
  application.Render();

  textInput.SetEditable( true );

  tet_infoline("Testing IsTextSelected negative");
  DALI_TEST_EQUALS( false, textInput.IsTextSelected(), TEST_LOCATION);

  textInput.SelectText(1,7);
  DALI_TEST_EQUALS( true, textInput.IsTextSelected(), TEST_LOCATION);

  textInput.DeSelectText();
  DALI_TEST_EQUALS( false, textInput.IsTextSelected(), TEST_LOCATION);
  END_TEST;
}
开发者ID:Tarnyko,项目名称:dal-toolkit,代码行数:27,代码来源:utc-Dali-TextInput.cpp

示例5: UtcDaliTextInputEndSignalEmit

int UtcDaliTextInputEndSignalEmit(void)
{
  ToolkitTestApplication application;

  tet_infoline("Testing Set editable false emits end signal");

  TextInput textInput = TextInput::New();  // create empty TextInput

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

  textInput.InputFinishedSignal().Connect( &OnEndInput );

  textInput.SetEditable(true) ;

  gHasEndSignalBeenReceived = false;

  textInput.SetEditable(false) ;

  DALI_TEST_EQUALS(true, gHasEndSignalBeenReceived, TEST_LOCATION);
  END_TEST;
}
开发者ID:Tarnyko,项目名称:dal-toolkit,代码行数:21,代码来源:utc-Dali-TextInput.cpp

示例6: UtcDaliTextInputSetMaxCharacterLength

int UtcDaliTextInputSetMaxCharacterLength(void)
{
  ToolkitTestApplication application;

  tet_infoline("Testing Setting of max characters");

  const int maxChars = 4;
  const char* testChar  = "v";

  TextInput textInput = TextInput::New();  // create empty TextInput
  Stage::GetCurrent().Add(textInput);
  application.SendNotification();
  application.Render();

  textInput.SetMaxCharacterLength(maxChars);

  Integration::KeyEvent event(testChar, testChar, 0, 0, 0, Integration::KeyEvent::Down );

  std::string testString = "";

  tet_infoline("Starting editmode");
  textInput.SetEditable( true );

  tet_infoline("Sending Key Events");
  // Send max number of characters
  for (int i=0; i < maxChars; i++)
    {
      application.ProcessEvent(event);
      testString.append(testChar);
    }

  tet_printf( "Get text result : %s\n", textInput.GetText().c_str());

  DALI_TEST_EQUALS(testString, textInput.GetText(), TEST_LOCATION);

  tet_infoline("Sending Key Event which exceeds max characters");

  application.ProcessEvent(event); // try to append additional character

  DALI_TEST_EQUALS(testString,textInput.GetText(), TEST_LOCATION);

  tet_infoline("Increase max characters limit");

  textInput.SetMaxCharacterLength(maxChars+1); // increment max characters by 1

  tet_infoline("Send character again which should now fit");
  application.ProcessEvent(event); // append additional character
  testString.append(testChar);

  DALI_TEST_EQUALS(testString,textInput.GetText(), TEST_LOCATION);
  END_TEST;
}
开发者ID:Tarnyko,项目名称:dal-toolkit,代码行数:52,代码来源:utc-Dali-TextInput.cpp


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