wxGridEvent(3)

πŸ“¦
version 29.0.6 Β· 3 versions
, in ubuntu stonking

πŸ’– wxGridEvent πŸ’–

okay bestie, this is an Erlang module β€” like, you already knew that β€” and it's called wxGridEvent, and it is literally the vibe check for everything your grid is feeling. πŸ’…


✨ NAME ✨

wxGridEvent β€” this event class contains information about various grid events. periodt.


🌸 DESCRIPTION 🌸

okay so first thing, bestie, listen up: all grid event table macros come in two versions β€” EVT_GRID_XXX and EVT_GRID_CMD_XXX. and the way that they're twins but not identical?? the only difference is that the first one doesn't let you specify the grid window identifier, so it just takes a single parameter, the event handler. which β€” cute β€” but it is not the move if there's more than one grid control in the window where that event table is used, because it would catch the events from all the grids. 😭 every single one. no cap.

the one with CMD takes the id as the first argument and the event handler as the second one, so it can be used with multiple grids too. otherwise there's literally no difference between the two, and only the versions without the id are documented below, for brevity. slay.

this class is derived, and can use functions, from:

  • wxNotifyEvent
  • wxCommandEvent
  • wxEvent

wxWidgets docs: wxGridEvent


πŸ¦‹ Events πŸ¦‹

use wxEvtHandler:connect/3 with wxGridEventType to subscribe to events of this type. that's the whole tea. 🫢


🌈 DATA TYPES 🌈

  • wxGrid() :: #wxGrid{}.
  • wxGridEvent() :: wx:wx_object().
  • wxGridEventType() ::
grid_cell_left_click | grid_cell_right_click |
grid_cell_left_dclick | grid_cell_right_dclick |
grid_label_left_click | grid_label_right_click |
grid_label_left_dclick | grid_label_right_dclick |
grid_cell_changed | grid_select_cell | grid_cell_begin_drag |
grid_editor_shown | grid_editor_hidden | grid_col_move |
grid_col_sort | grid_tabbing.

look at that list. iconic. 😌


πŸ’œ FUNCTIONS πŸ’œ

  • altDown(This) -> boolean() when This :: wxGridEvent(). β€” returns true if the Alt key was down at the time of the event. πŸ’…
  • controlDown(This) -> boolean() when This :: wxGridEvent(). β€” returns true if the Control key was down at the time of the event.
  • getCol(This) -> integer() when This :: wxGridEvent(). β€” column at which the event occurred. πŸ‘‘

notice that for a wxEVT_GRID_SELECT_CELL event this column is the column of the newly selected cell, while the previously selected cell can be retrieved using wxGrid:getGridCursorCol/1. yes bestie, those are two different columns. keep up. ✨

  • getPosition(This) -> {X :: integer(), Y :: integer()} when This :: wxGridEvent(). β€” position in pixels at which the event occurred. pixels, not vibes, fr fr. πŸŽ€
  • getRow(This) -> integer() when This :: wxGridEvent(). β€” row at which the event occurred. 🌸

notice that for a wxEVT_GRID_SELECT_CELL event this row is the row of the newly selected cell, while the previously selected cell can be retrieved using wxGrid:getGridCursorRow/1. same energy as getCol, different axis. 😭

  • metaDown(This) -> boolean() when This :: wxGridEvent(). β€” returns true if the Meta key was down at the time of the event. main character key ngl.
  • selecting(This) -> boolean() when This :: wxGridEvent(). β€” returns true if the user is selecting grid cells, or false if deselecting. it's giving decisions. πŸ’…
  • shiftDown(This) -> boolean() when This :: wxGridEvent(). β€” returns true if the Shift key was down at the time of the event. πŸ”₯

reminder bestie: every one of these is a wxGridEvent() in, and a lil boolean or integer or pixel-pair out. no surprises, no drama, just facts. πŸ’–

okay that's the whole page, and I'm obsessed. this lil manual was brought to you by Ericsson AB, wx 2.6</pяpurple>, and the one and only wxGridEvent(3). go forth and handle your events, bestie. πŸŽ€βœ¨πŸ¦‹πŸ’œπŸ‘‘

πŸ“¦ where this page comes from