mirror of
https://github.com/ArthurSonzogni/FTXUI.git
synced 2024-12-02 00:12:28 +08:00
456ede70fd
For example: ============ element | size(WIDTH, EQUAL 10); element | size(HEIGHT, GREATER_THAN, 10); element | size(WIDTH, EQUAL, 10) | size(HEIGHT, EQUAL, 10)
35 lines
831 B
C++
35 lines
831 B
C++
#include "ftxui/component/checkbox.hpp"
|
|
#include "ftxui/component/container.hpp"
|
|
#include "ftxui/component/input.hpp"
|
|
#include "ftxui/component/menu.hpp"
|
|
#include "ftxui/component/radiobox.hpp"
|
|
#include "ftxui/component/screen_interactive.hpp"
|
|
#include "ftxui/component/toggle.hpp"
|
|
#include "ftxui/screen/string.hpp"
|
|
|
|
using namespace ftxui;
|
|
|
|
class MyComponent : public Component {
|
|
RadioBox radiobox;
|
|
|
|
public:
|
|
MyComponent() {
|
|
for(int i = 0; i<30; ++i) {
|
|
radiobox.entries.push_back(L"RadioBox " + to_wstring(i));
|
|
}
|
|
Add(&radiobox);
|
|
}
|
|
|
|
Element Render() override {
|
|
return radiobox.Render() | frame | size(HEIGHT, LESS_THAN, 10) | border;
|
|
}
|
|
};
|
|
|
|
int main(int argc, const char* argv[]) {
|
|
auto screen = ScreenInteractive::FitComponent();
|
|
MyComponent component;
|
|
screen.Loop(&component);
|
|
|
|
return 0;
|
|
}
|