Designer is working great now, and this fixes a bunch of things about the mouse.

This commit is contained in:
Zed A. Shaw 2024-12-12 10:14:43 -05:00
parent f05f652c26
commit ffc787df64
10 changed files with 4958 additions and 91 deletions

View file

@ -38,13 +38,27 @@ const std::wstring& Panel::to_string() {
void Panel::mouse_click(ftxui::Mouse::Button btn, Point pos) {
ftxui::Mouse mev{
.button=btn,
.motion=ftxui::Mouse::Motion::Pressed,
.x=int(pos.x), .y=int(pos.y)
};
$component->OnEvent(ftxui::Event::Mouse("", mev));
}
void Panel::mouse_release(ftxui::Mouse::Button btn, Point pos) {
ftxui::Mouse mev{
.button=btn,
.motion=ftxui::Mouse::Motion::Released,
.x=int(pos.x), .y=int(pos.y)
};
const Screen &Panel::screen() {
$component->OnEvent(ftxui::Event::Mouse("", mev));
}
const Screen& Panel::screen() {
return $screen;
}
void Panel::key_press(ftxui::Event event) {
$component->OnEvent(event);
}