2023-08-19 19:56:36 +08:00
|
|
|
// Copyright 2021 Arthur Sonzogni. All rights reserved.
|
|
|
|
// Use of this source code is governed by the MIT license that can be found in
|
|
|
|
// the LICENSE file.
|
2025-03-19 22:33:05 +08:00
|
|
|
#include <array> // for array
|
|
|
|
#include <iostream>
|
|
|
|
#include <memory> // for shared_ptr, __shared_ptr_access
|
|
|
|
#include <string> // for operator+, to_string
|
2021-12-12 00:58:25 +08:00
|
|
|
|
|
|
|
#include "ftxui/component/captured_mouse.hpp" // for ftxui
|
2025-03-19 22:33:05 +08:00
|
|
|
#include "ftxui/component/component.hpp" // for Checkbox, Renderer, Vertical
|
|
|
|
#include "ftxui/component/component_base.hpp" // for ComponentBase
|
|
|
|
#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
|
2021-12-12 00:58:25 +08:00
|
|
|
#include "ftxui/dom/elements.hpp" // for operator|, Element, size, border, frame, vscroll_indicator, HEIGHT, LESS_THAN
|
2019-01-13 05:25:49 +08:00
|
|
|
|
2025-03-19 22:33:05 +08:00
|
|
|
using namespace ftxui;
|
2021-11-07 19:01:17 +08:00
|
|
|
|
2025-03-19 22:33:05 +08:00
|
|
|
int main() {
|
|
|
|
bool download = false;
|
|
|
|
bool upload = false;
|
|
|
|
bool ping = false;
|
2021-05-10 02:32:27 +08:00
|
|
|
|
2025-03-19 22:33:05 +08:00
|
|
|
auto container = Container::Vertical({
|
|
|
|
Checkbox("Download", &download),
|
|
|
|
Checkbox("Upload", &upload),
|
|
|
|
Checkbox("Ping", &ping),
|
2021-05-10 02:32:27 +08:00
|
|
|
});
|
2020-03-23 05:32:44 +08:00
|
|
|
|
2025-03-19 22:33:05 +08:00
|
|
|
auto screen = ScreenInteractive::FitComponent();
|
|
|
|
screen.Loop(container);
|
|
|
|
|
|
|
|
std::cout << "---" << std::endl;
|
|
|
|
std::cout << "Download: " << download << std::endl;
|
|
|
|
std::cout << "Upload: " << upload << std::endl;
|
|
|
|
std::cout << "Ping: " << ping << std::endl;
|
|
|
|
std::cout << "---" << std::endl;
|
|
|
|
|
|
|
|
return 0;
|
2019-01-13 05:25:49 +08:00
|
|
|
}
|