Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
pulp::view::ContextMenu::Item Struct Reference

#include <context_menu.hpp>

Public Types

enum class  ControlKind { action , toggle , slider , choice }

Public Member Functions

void set_toggled (bool value)
void set_normalized_value (float value)
void set_choice_index (std::size_t value)

Static Public Member Functions

static Item make_separator ()
static Item make_header (std::string title)
static Item make_toggle (int id, std::string label, bool checked, std::function< void(const Item &)> on_change)
static Item make_slider (int id, std::string label, float normalized, float step, std::function< void(const Item &)> on_change)
static Item make_choice (int id, std::string label, std::vector< std::string > choices, std::size_t selected, std::function< void(const Item &)> on_change)

Public Attributes

int id = 0
std::string label
bool enabled = true
bool checked = false
ControlKind control_kind = ControlKind::action
float normalized_value = 0.0f
std::string value_label
 Text shown at the right end of a slider row ("2.50 Hz", "65%").
bool tab = false
 A toggle that is one of several sibling tabs (an "edit lane 1 / edit lane 2" pair): painted as a row with a leading accent bar when checked instead of a switch, since it selects rather than enables.
float normalized_step = 0.05f
std::vector< std::string > choices
std::size_t choice_index = 0
std::function< void(const Item &)> on_change
bool separator = false
bool header = false
 A non-selectable title row that groups the items below it.
bool has_submenu = false

Member Enumeration Documentation

◆ ControlKind

Enumerator
action 
toggle 
slider 
choice 

Member Function Documentation

◆ make_choice()

Item pulp::view::ContextMenu::Item::make_choice ( int id,
std::string label,
std::vector< std::string > choices,
std::size_t selected,
std::function< void(const Item &)> on_change )
inlinestatic

◆ make_header()

Item pulp::view::ContextMenu::Item::make_header ( std::string title)
inlinestatic

◆ make_separator()

Item pulp::view::ContextMenu::Item::make_separator ( )
inlinestatic

◆ make_slider()

Item pulp::view::ContextMenu::Item::make_slider ( int id,
std::string label,
float normalized,
float step,
std::function< void(const Item &)> on_change )
inlinestatic

◆ make_toggle()

Item pulp::view::ContextMenu::Item::make_toggle ( int id,
std::string label,
bool checked,
std::function< void(const Item &)> on_change )
inlinestatic

◆ set_choice_index()

void pulp::view::ContextMenu::Item::set_choice_index ( std::size_t value)
inline

◆ set_normalized_value()

void pulp::view::ContextMenu::Item::set_normalized_value ( float value)
inline

◆ set_toggled()

void pulp::view::ContextMenu::Item::set_toggled ( bool value)
inline

Member Data Documentation

◆ checked

bool pulp::view::ContextMenu::Item::checked = false

◆ choice_index

std::size_t pulp::view::ContextMenu::Item::choice_index = 0

◆ choices

std::vector<std::string> pulp::view::ContextMenu::Item::choices

◆ control_kind

ControlKind pulp::view::ContextMenu::Item::control_kind = ControlKind::action

◆ enabled

bool pulp::view::ContextMenu::Item::enabled = true

◆ has_submenu

bool pulp::view::ContextMenu::Item::has_submenu = false

◆ header

bool pulp::view::ContextMenu::Item::header = false

A non-selectable title row that groups the items below it.

◆ id

int pulp::view::ContextMenu::Item::id = 0

◆ label

std::string pulp::view::ContextMenu::Item::label

◆ normalized_step

float pulp::view::ContextMenu::Item::normalized_step = 0.05f

◆ normalized_value

float pulp::view::ContextMenu::Item::normalized_value = 0.0f

◆ on_change

std::function<void(const Item&)> pulp::view::ContextMenu::Item::on_change

◆ separator

bool pulp::view::ContextMenu::Item::separator = false

◆ tab

bool pulp::view::ContextMenu::Item::tab = false

A toggle that is one of several sibling tabs (an "edit lane 1 / edit lane 2" pair): painted as a row with a leading accent bar when checked instead of a switch, since it selects rather than enables.

◆ value_label

std::string pulp::view::ContextMenu::Item::value_label

Text shown at the right end of a slider row ("2.50 Hz", "65%").

When set, the track stops short of it so the thumb never runs under the text; the product keeps it current from on_change.


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