Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
pulp::view::DialogWindow Class Reference

#include <window_classes.hpp>

Public Types

using CompletionHandler = std::function<void(DialogResult)>

Public Member Functions

 DialogWindow (const std::string &title, View &content_root)
 ~DialogWindow ()
 DialogWindow (const DialogWindow &)=delete
DialogWindow & operator= (const DialogWindow &)=delete
void set_ok_label (std::string label)
 Customize the OK button label (default "OK").
const std::string & ok_label () const
void set_cancel_label (std::string label)
 Customize the Cancel button label (default "Cancel").
const std::string & cancel_label () const
void set_completion_handler (CompletionHandler handler)
 Set the completion handler.
bool show (bool modal=true)
 Show the dialog.
void dismiss (DialogResult result)
 Programmatic dismissal — call from a button handler.
bool is_dismissed () const
DialogResult last_result () const
bool is_modal () const
const std::string & title () const
View & content ()
WindowHost * host ()

Member Typedef Documentation

◆ CompletionHandler

Constructor & Destructor Documentation

◆ DialogWindow() [1/2]

pulp::view::DialogWindow::DialogWindow ( const std::string & title,
View & content_root )

◆ ~DialogWindow()

pulp::view::DialogWindow::~DialogWindow ( )

◆ DialogWindow() [2/2]

pulp::view::DialogWindow::DialogWindow ( const DialogWindow & )
delete

Member Function Documentation

◆ cancel_label()

const std::string & pulp::view::DialogWindow::cancel_label ( ) const
inline

◆ content()

View & pulp::view::DialogWindow::content ( )
inline

◆ dismiss()

void pulp::view::DialogWindow::dismiss ( DialogResult result)

Programmatic dismissal — call from a button handler.

Fires the completion handler with the supplied result. No-op if the dialog has already been dismissed.

◆ host()

WindowHost * pulp::view::DialogWindow::host ( )
inline

◆ is_dismissed()

bool pulp::view::DialogWindow::is_dismissed ( ) const
inline

◆ is_modal()

bool pulp::view::DialogWindow::is_modal ( ) const
inline

◆ last_result()

DialogResult pulp::view::DialogWindow::last_result ( ) const
inline

◆ ok_label()

const std::string & pulp::view::DialogWindow::ok_label ( ) const
inline

◆ operator=()

DialogWindow & pulp::view::DialogWindow::operator= ( const DialogWindow & )
delete

◆ set_cancel_label()

void pulp::view::DialogWindow::set_cancel_label ( std::string label)
inline

Customize the Cancel button label (default "Cancel").

Empty string hides the Cancel button — useful for AlertWindow-style "OK only" dialogs.

◆ set_completion_handler()

void pulp::view::DialogWindow::set_completion_handler ( CompletionHandler handler)
inline

Set the completion handler.

Called exactly once when the dialog is dismissed.

◆ set_ok_label()

void pulp::view::DialogWindow::set_ok_label ( std::string label)
inline

Customize the OK button label (default "OK").

Empty string hides the OK button entirely.

◆ show()

bool pulp::view::DialogWindow::show ( bool modal = true)

Show the dialog.

Returns false if no WindowHost::Factory exists. modal is a hint — on platforms that support modal native windows the host puts it into modal mode; otherwise the dialog floats over its parent.

◆ title()

const std::string & pulp::view::DialogWindow::title ( ) const
inline

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