Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add single click event handler to listbox #684

Open
wants to merge 1 commit into
base: develop-1.8
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions include/nana/gui/widgets/listbox.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -801,6 +801,8 @@ namespace nana
void mouse_leave(graph_reference, const arg_mouse&) override;
void mouse_down(graph_reference, const arg_mouse&) override;
void mouse_up(graph_reference, const arg_mouse&) override;
void click_common(graph_reference);
void click(graph_reference, const arg_click&) override;
void dbl_click(graph_reference, const arg_mouse&) override;
void resized(graph_reference, const arg_resized&) override;
void key_press(graph_reference, const arg_keyboard&) override;
Expand Down
14 changes: 12 additions & 2 deletions source/gui/widgets/listbox.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4533,8 +4533,8 @@ namespace nana
api::dev::lazy_refresh();
}
}

void trigger::dbl_click(graph_reference graph, const arg_mouse&)
void trigger::click_common(graph_reference graph)
{
using parts = essence::parts;

Expand Down Expand Up @@ -4581,6 +4581,16 @@ namespace nana
}
}
}

void trigger::click(graph_reference graph, const arg_click&)
{
click_common(graph);
}

void trigger::dbl_click(graph_reference graph, const arg_mouse&)
{
click_common(graph);
}

void trigger::resized(graph_reference graph, const arg_resized&)
{
Expand Down