mirror of
https://github.com/ArthurSonzogni/FTXUI.git
synced 2025-07-30 09:21:12 +08:00
Cleanup
This commit is contained in:
parent
2339ead35c
commit
7af4446de8
@ -56,8 +56,6 @@ int main() {
|
|||||||
// Tweak how the component tree is rendered:
|
// Tweak how the component tree is rendered:
|
||||||
auto renderer = Renderer(component, [&] {
|
auto renderer = Renderer(component, [&] {
|
||||||
|
|
||||||
textToCopy = screen.getSelection();
|
|
||||||
|
|
||||||
return vbox({
|
return vbox({
|
||||||
hbox(text(" First name : "), input_first_name->Render()),
|
hbox(text(" First name : "), input_first_name->Render()),
|
||||||
hbox(text(" Last name : ") | selectable(), input_last_name->Render()),
|
hbox(text(" Last name : ") | selectable(), input_last_name->Render()),
|
||||||
@ -67,17 +65,10 @@ int main() {
|
|||||||
text("Hello " + first_name + " " + last_name),
|
text("Hello " + first_name + " " + last_name),
|
||||||
text("Your password is " + password),
|
text("Your password is " + password),
|
||||||
text("Your phone number is " + phoneNumber),
|
text("Your phone number is " + phoneNumber),
|
||||||
// text("select_start " + std::to_string(selection.startx) + ";" + std::to_string(selection.starty)),
|
text("Selected test is " + screen.getSelection())
|
||||||
// text("select_end " + std::to_string(selection.endx) + ";" + std::to_string(selection.endy)),
|
|
||||||
text("textToCopy is " + textToCopy)
|
|
||||||
}) |
|
}) |
|
||||||
border; // | selectable([&textToCopy](std::string txtSelected){textToCopy = txtSelected;})
|
border;
|
||||||
});
|
});
|
||||||
|
|
||||||
// renderer |= CatchEvent([&](Event event) {
|
|
||||||
|
|
||||||
// return selectableCatchEvent(event);
|
|
||||||
// });
|
|
||||||
|
|
||||||
screen.Loop(renderer);
|
screen.Loop(renderer);
|
||||||
}
|
}
|
||||||
|
@ -841,10 +841,6 @@ void ScreenInteractive::HandleTask(Component component, Task& task) {
|
|||||||
|
|
||||||
bool ScreenInteractive::selectableCatchEvent(Event event) {
|
bool ScreenInteractive::selectableCatchEvent(Event event) {
|
||||||
|
|
||||||
// std::ofstream MyFile("debug.log", std::ios_base::app);
|
|
||||||
// MyFile << "Top dog!" << std::endl;
|
|
||||||
// MyFile.close();
|
|
||||||
|
|
||||||
if (event.is_mouse()) {
|
if (event.is_mouse()) {
|
||||||
auto& mouse = event.mouse();
|
auto& mouse = event.mouse();
|
||||||
if (mouse.button == Mouse::Left) {
|
if (mouse.button == Mouse::Left) {
|
||||||
@ -854,15 +850,12 @@ bool ScreenInteractive::selectableCatchEvent(Event event) {
|
|||||||
selectedRegion.starty = mouse.y;
|
selectedRegion.starty = mouse.y;
|
||||||
selectedRegion.endx = mouse.x;
|
selectedRegion.endx = mouse.x;
|
||||||
selectedRegion.endy = mouse.y;
|
selectedRegion.endy = mouse.y;
|
||||||
// refreshSelection();
|
|
||||||
} else if (mouse.motion == Mouse::Released) {
|
} else if (mouse.motion == Mouse::Released) {
|
||||||
selectedRegion.endx = mouse.x;
|
selectedRegion.endx = mouse.x;
|
||||||
selectedRegion.endy = mouse.y;
|
selectedRegion.endy = mouse.y;
|
||||||
// refreshSelection();
|
|
||||||
} else if (mouse.motion == Mouse::Moved) {
|
} else if (mouse.motion == Mouse::Moved) {
|
||||||
selectedRegion.endx = mouse.x;
|
selectedRegion.endx = mouse.x;
|
||||||
selectedRegion.endy = mouse.y;
|
selectedRegion.endy = mouse.y;
|
||||||
// refreshSelection();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -887,10 +880,6 @@ void ScreenInteractive::refreshSelection(void) {
|
|||||||
|
|
||||||
std::string ScreenInteractive::getSelection(void) {
|
std::string ScreenInteractive::getSelection(void) {
|
||||||
|
|
||||||
// std::ofstream MyFile("debug.log", std::ios_base::app);
|
|
||||||
// MyFile << "Top dog!" << std::endl;
|
|
||||||
// MyFile.close();
|
|
||||||
|
|
||||||
return selectedText;
|
return selectedText;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user