Path: blob/master/Source/CursesDialog/cmCursesLongMessageForm.h
4998 views
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying1file LICENSE.rst or https://cmake.org/licensing for details. */2#pragma once34#include "cmConfigure.h" // IWYU pragma: keep56#include <string>7#include <vector>89#include "cmCursesForm.h"10#include "cmCursesStandardIncludes.h"1112class cmCursesLongMessageForm : public cmCursesForm13{14public:15enum class ScrollBehavior16{17NoScroll,18ScrollDown19};2021cmCursesLongMessageForm(std::vector<std::string> const& messages,22char const* title, ScrollBehavior scrollBehavior);23~cmCursesLongMessageForm() override;2425cmCursesLongMessageForm(cmCursesLongMessageForm const&) = delete;26cmCursesLongMessageForm& operator=(cmCursesLongMessageForm const&) = delete;2728void UpdateContent(std::string const& output, std::string const& title);2930// Description:31// Handle user input.32void HandleInput() override;3334// Description:35// Display form. Use a window of size width x height, starting36// at top, left.37void Render(int left, int top, int width, int height) override;3839// Description:40// This method should normally called only by the form.41// The only exception is during a resize.42void PrintKeys();4344// Description:45// This method should normally called only by the form.46// The only exception is during a resize.47void UpdateStatusBar() override;4849protected:50static constexpr int MAX_CONTENT_SIZE = 60000;5152void DrawMessage(char const* msg) const;5354std::string Messages;55std::string Title;56ScrollBehavior Scrolling;5758FIELD* Fields[2];59};606162