wxScrollEvent(3)

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

✨ wxScrollEvent ✨

okay so this is the manual page for wxScrollEvent from the Erlang wx module (wx 2.6 era, bestie, we're going vintage πŸ’…). Buckle up.

🌸 NAME 🌸

wxScrollEvent β€” a scroll event, and it's literally holding info about events that get sent from stand-alone scrollbars (peep wxScrollBar) and sliders (peep wxSlider). πŸŽ€

πŸ’– DESCRIPTION πŸ’–

First things first, queen, because this trips people up: scrolled windows send wxScrollWinEvent, which does not derive from wxCommandEvent β€” it derives from wxEvent directly. Do not confuse these two kinds of events, okay?? The event table macros mentioned below are only for the scrollbar-like controls. πŸ™ˆ


🌈 The difference between EVT_SCROLL_THUMBRELEASE and EVT_SCROLL_CHANGED

  • The EVT_SCROLL_THUMBRELEASE event is only emitted when you're actually dragging the thumb with the mouse and then releasing it. (And this EVT_SCROLL_THUMBRELEASE event is also followed by an EVT_SCROLL_CHANGED event, so it's giving sequel energy.)
  • The EVT_SCROLL_CHANGED event also occurs when you use the keyboard to change the thumb position, and when you click next to the thumb. In all these cases, the EVT_SCROLL_THUMBRELEASE event does not happen. πŸ’€

In short: the EVT_SCROLL_CHANGED event is triggered when scrolling/moving has finished, no matter how it started. Independent main character energy, fr fr. Please see the page_samples_widgets ("Slider" page) to see the difference between EVT_SCROLL_THUMBRELEASE and EVT_SCROLL_CHANGED in action. πŸ‘‘

Remark: note that unless you specify a scroll control identifier, you will need to test for scrollbar orientation with getOrientation/1, since horizontal and vertical scroll events are processed using the same event handler. iykyk 🫢

See:

  • wxScrollBar
  • wxSlider
  • wxSpinButton
  • wxScrollWinEvent
  • Overview events

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

  • wxCommandEvent
  • wxEvent

wxWidgets docs: wxScrollEvent

πŸ¦‹ Events πŸ¦‹

Use wxEvtHandler:connect/3 with wxScrollEventType to subscribe to events of this type. No gatekeeping here. ✨

⭐ DATA TYPES ⭐

wxScroll() :: #wxScroll{}.

wxScrollEvent() :: wx:wx_object().

wxScrollEventType() ::
          scroll_top | scroll_bottom | scroll_lineup | scroll_linedown |
          scroll_pageup | scroll_pagedown | scroll_thumbtrack |
          scroll_thumbrelease | scroll_changed.

πŸŽ€ FUNCTIONS πŸŽ€

  • getOrientation(This) -> integer() when This :: wxScrollEvent(). β€” Returns wxHORIZONTAL or wxVERTICAL, depending on the orientation of the scrollbar. It's giving directional clarity, periodt. 🧚
  • getPosition(This) -> integer() when This :: wxScrollEvent(). β€” Returns the position of the scrollbar. Where's the thumb at? This tells you. πŸ“

and that's the whole page, bestie!! πŸ’œ this was the wxScrollEvent manual for the Erlang wx module, brought to you by Ericsson AB with wx 2.6, dated wxScrollEvent(3). slay, go touch some scrollbars. πŸŒΈβœ¨πŸ’…

πŸ“¦ where this page comes from