SDL3pp
A slim C++ wrapper for SDL3
Loading...
Searching...
No Matches
SDL::TrayEntryScoped Struct Reference

RAII owning version TrayEntry. More...

Inheritance diagram for SDL::TrayEntryScoped:
[legend]

Public Member Functions

constexpr TrayEntryScoped (const TrayEntryScoped &other)=delete
constexpr TrayEntryScoped (TrayEntryScoped &&other) noexcept
 Move constructor.
constexpr TrayEntryScoped (TrayEntry &&other) noexcept
 Move constructor.
 ~TrayEntryScoped ()
 Destructor.
 TrayEntry (TrayMenu menu, int pos, StringParam label, TrayEntryFlags flags)
 Insert a tray entry at a given position.
 TrayEntry (TrayMenuRaw menu, StringParam label, TrayEntryFlags flags)
 Appends a tray entry.
Public Member Functions inherited from SDL::TrayEntry
 TrayEntry (TrayMenu menu, int pos, StringParam label, TrayEntryFlags flags)
 Insert a tray entry at a given position.
 TrayEntry (TrayMenuRaw menu, StringParam label, TrayEntryFlags flags)
 Appends a tray entry.
constexpr operator TrayEntryRaw () const noexcept
 Converts to underlying TrayEntryRaw.
void Remove ()
 Removes a tray entry.
TrayMenu CreateSubmenu ()
 Create a submenu for a system tray entry.
TrayMenu GetSubmenu ()
 Gets a previously created tray entry submenu.
void SetLabel (StringParam label)
 Sets the label of an entry.
const char * GetLabel () const
 Gets the label of an entry.
void SetChecked (bool checked)
 Sets whether or not an entry is checked.
bool GetChecked () const
 Gets whether or not an entry is checked.
void SetEnabled (bool enabled)
 Sets whether or not an entry is enabled.
bool GetEnabled () const
 Gets whether or not an entry is enabled.
void SetCallback (TrayCallback callback, void *userdata)
 Sets a callback to be invoked when the entry is selected.
void SetCallback (TrayCB callback)
 Sets a callback to be invoked when the entry is selected.
void Click ()
 Simulate a click on a tray entry.
TrayMenu GetParent ()
 Gets the menu containing a certain tray entry.
constexpr ResourceBase (RawPointer resource)
 Constructs from resource pointer.
constexpr ResourceBase (std::nullptr_t=nullptr)
 Constructs null/invalid.
Public Member Functions inherited from SDL::ResourceBase< TrayEntryRaw >
constexpr ResourceBase (RawPointer resource)
 Constructs from resource pointer.
constexpr operator bool () const
 Converts to bool.
constexpr auto operator<=> (const ResourceBase &other) const=default
 Comparison.
constexpr RawConstPointer operator-> () const noexcept
 member access to underlying resource pointer.
constexpr RawPointer get () const noexcept
 Retrieves underlying resource pointer.
constexpr RawPointer release () noexcept
 Retrieves underlying resource pointer and clear this.

Additional Inherited Members

Public Types inherited from SDL::ResourceBase< TrayEntryRaw >
using RawPointer
 The underlying raw pointer type.
using RawConstPointer
 The underlying const raw pointer type.

Detailed Description

RAII owning version TrayEntry.

Member Function Documentation

◆ TrayEntry() [1/2]

SDL::TrayEntry::TrayEntry ( TrayMenu menu,
int pos,
StringParam label,
TrayEntryFlags flags )
inline

Insert a tray entry at a given position.

If label is nullptr, the entry will be a separator. Many functions won't work for an entry that is a separator.

An entry does not need to be destroyed; it will be destroyed with the tray.

Parameters
menuthe menu to append the entry to.
posthe desired position for the new entry. Entries at or following this place will be moved. If pos is -1, the entry is appended.
labelthe text to be displayed on the entry, in UTF-8 encoding, or nullptr for a separator.
flagsa combination of flags, some of which are mandatory.
Postcondition
the newly created entry, or nullptr if pos is out of bounds.
Thread safety:
This function should be called on the thread that created the tray.
Since
This function is available since SDL 3.2.0.
See also
TrayEntryFlags
TrayMenu.GetEntries
TrayEntry.Remove
TrayEntry.GetParent

◆ TrayEntry() [2/2]

Appends a tray entry.

If label is nullptr, the entry will be a separator. Many functions won't work for an entry that is a separator.

An entry does not need to be destroyed; it will be destroyed with the tray.

Parameters
menuthe menu to append the entry to.
labelthe text to be displayed on the entry, in UTF-8 encoding, or nullptr for a separator.
flagsa combination of flags, some of which are mandatory.
Postcondition
the newly created entry, or nullptr if pos is out of bounds.
Thread safety:
This function should be called on the thread that created the tray.
Since
This function is available since SDL 3.2.0.
See also
TrayMenu.InsertEntry
TrayEntryFlags
TrayMenu.GetEntries
TrayEntry.Remove
TrayEntry.GetParent

The documentation for this struct was generated from the following file: