Closed SamSandq closed 3 months ago
listbox_OnDown(): https://github.com/frang75/nappgui_src/commit/711ea786b8d5dabede70180b57e2414fc8b3533c Review doc for details: https://nappgui.com/en/gui/listbox.html#f2
This works well, but a little confusing with a new variable p->tag
instead of p->index
like in the OnSelect
handler.
I also uncovered a small effect: when selecting a line programmatically with listbox_select(lb, index, TRUE)
it does not repaint it immediately, only after having moved the mouse however little. Could be only in the OnDown
handler, have not checked. This does not happen if you return TRUE from the handler -- but the compiler complains about about pointer comparison if you change the handler's signature from void
to bool_t
. It works well in either case, though.
tag
is a generic name (like guicontrol_tag
). Is an extra field in EvMouse
that can be used in high-level controls for diferent purposes. It can contain a index, color, hash, bitfield, etc. In the particular case of ListBox
, tag is the row index.
listbox_select() refresh fix: https://github.com/frang75/nappgui_src/commit/418ef8c72e04c45d31971d39380e92d0d823f91e
I close this issue. Feel free reopen if detect any issue.
If I use a listbox or table (any control with OnSelect), I sometimes wish to use a popup menu with a right click. This is not currently possible.
I propose a new ...OnDown event which gives access to the button pressed, and thus one may check for ekGUI_MOUSE_RIGHT and take appropriate action.
Furthermore, in that case it is necessary to know the index clicked as well. So something like
in addition to the x and y coordinates.