MCPcopy Create free account
hub / github.com/Kitware/CMake / HandleInput

Method HandleInput

Source/CursesDialog/cmCursesMainForm.cxx:672–968  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

670}
671
672void cmCursesMainForm::HandleInput()
673{
674 int x = 0;
675 int y = 0;
676
677 if (!this->Form) {
678 return;
679 }
680
681 FIELD* currentField;
682 cmCursesWidget* currentWidget;
683
684 char debugMessage[128];
685
686 for (;;) {
687 this->UpdateStatusBar();
688 this->PrintKeys();
689 if (this->SearchMode) {
690 std::string searchstr = "Search: " + this->SearchString;
691 this->UpdateStatusBar(searchstr);
692 this->PrintKeys(1);
693 move(y - 5, static_cast<unsigned int>(searchstr.size()));
694 // move(1,1);
695 touchwin(stdscr);
696 refresh();
697 }
698 int key = getch();
699
700#ifdef _WIN32
701 if (key == KEY_RESIZE) {
702 HandleResize();
703 }
704#endif // _WIN32
705
706 getmaxyx(stdscr, y, x);
707 // If window too small, handle 'q' only
708 if (x < cmCursesMainForm::MIN_WIDTH || y < cmCursesMainForm::MIN_HEIGHT) {
709 // quit
710 if (key == 'q') {
711 break;
712 }
713 continue;
714 }
715
716 currentField = current_field(this->Form);
717 currentWidget =
718 reinterpret_cast<cmCursesWidget*>(field_userptr(currentField));
719
720 bool widgetHandled = false;
721
722 if (this->SearchMode) {
723 if (key == 10 || key == KEY_ENTER) {
724 this->SetSearchMode(false);
725 if (!this->SearchString.empty()) {
726 this->JumpToCacheEntry(this->SearchString.c_str());
727 this->OldSearchString = this->SearchString;
728 }
729 this->SearchString.clear();

Callers 3

ConfigureMethod · 0.45
GenerateMethod · 0.45
mainFunction · 0.45

Calls 15

UpdateStatusBarMethod · 0.95
PrintKeysMethod · 0.95
SetSearchModeMethod · 0.95
JumpToCacheEntryMethod · 0.95
WriteMethod · 0.95
ConfigureMethod · 0.95
RenderMethod · 0.95
RePostMethod · 0.95
GenerateMethod · 0.95
RemoveEntryMethod · 0.95
moveFunction · 0.85
touchwinFunction · 0.85

Tested by

no test coverage detected