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