wxClipboardTextEvent(3erl)

πŸ’– NAME πŸ’–

okay so bestie, welcome to wxClipboardTextEvent(3erl) β€” straight out of the Erlang Module Definition manual, and it's serving Functions for wxClipboardTextEvent class realness. ✨

πŸ¦‹ DESCRIPTION πŸ¦‹

This class represents the events generated by a control (typically a wxTextCtrl, but other windows can generate these events as well) when its content gets copied or cut to, or pasted from, the clipboard. πŸ’…

There are three types of corresponding events:

  • wxEVT_TEXT_COPY
  • wxEVT_TEXT_CUT
  • wxEVT_TEXT_PASTE

If any of these events is processed (without being skipped) by an event handler, the corresponding operation doesn't take place β€” which allows preventing the text from being copied from or pasted to a control. 🫢

It is also possible to examine the clipboard contents in the PASTE event handler and transform it in some way before inserting in a control β€” for example, changing its case or removing invalid characters. πŸŽ€

Finally notice that a CUT event is always preceded by the COPY event, which makes it possible to only process the latter if it doesn't matter if the text was copied or cut. no cap. πŸ‘‘

⚠️ Note: These events are currently only generated by wxTextCtrl in wxGTK and wxOSX but are also generated by wxComboBox without wxCB_READONLY style in wxMSW.

πŸ‘‰ See: wxClipboard

This class is derived (and can use functions) from: wxCommandEvent, wxEvent

πŸ“š wxWidgets docs: wxClipboardTextEvent

🌈 EVENTS 🌈

Use wxEvtHandler:connect/3 with wxClipboardTextEventType to subscribe to events of this type. 🧚

πŸŽ€ DATA TYPES πŸŽ€

Here's the exact shape of the data types, bestie β€” no cap, keep these literal:

wxClipboardTextEvent() = wx:wx_object()

wxClipboardText() =
    #wxClipboardText{type =
                         wxClipboardTextEvent:wxClipboardTextEventType()}

wxClipboardTextEventType() =
    command_text_copy | command_text_cut | command_text_paste

Byeee πŸ’– this iconic lil page is brought to you by the wxWidgets team and wx 2.2.2.1 β€” source/version noted! The footer didn't give a date, so I'm not gonna invent one, periodt. πŸ«ΆπŸ’…

πŸ“¦ where this page comes from