cgv
Loading...
Searching...
No Matches
cgv::gui::dialog Class Reference

use this class to construct and execute a modal dialog. More...

#include <dialog.h>

Public Member Functions

 dialog (const std::string &title, const std::string &group_type="align_group")
 create from title and adjust size according to content
 
 dialog (int w, int h, const std::string &title, const std::string &group_type="align_group")
 create from dimensions and title
 
cgv::gui::gui_group_ptr group ()
 return the gui group to which new elements are to be add
 
void add_std_buttons (const std::string &ok_label="ok", const std::string &cancel_label="")
 add buttons for ok and or cancel
 
bool exec ()
 execute modal dialog and freeze all other windows
 

Static Protected Member Functions

static void set_true_and_hide (bool *result, cgv::gui::window *w)
 

Protected Attributes

cgv::gui::window_ptr D
 

Detailed Description

use this class to construct and execute a modal dialog.

Definition at line 21 of file dialog.h.

Constructor & Destructor Documentation

◆ dialog() [1/2]

cgv::gui::dialog::dialog ( const std::string &  title,
const std::string &  group_type = "align_group" 
)

create from title and adjust size according to content

Definition at line 76 of file dialog.cxx.

References cgv::gui::application::create_window().

◆ dialog() [2/2]

cgv::gui::dialog::dialog ( int  w,
int  h,
const std::string &  title,
const std::string &  group_type = "align_group" 
)

create from dimensions and title

Definition at line 85 of file dialog.cxx.

References cgv::gui::application::create_window().

Member Function Documentation

◆ add_std_buttons()

void cgv::gui::dialog::add_std_buttons ( const std::string &  ok_label = "ok",
const std::string &  cancel_label = "" 
)

add buttons for ok and or cancel

Definition at line 100 of file dialog.cxx.

References group(), and cgv::gui::window::hide().

◆ exec()

bool cgv::gui::dialog::exec ( )

execute modal dialog and freeze all other windows

Definition at line 109 of file dialog.cxx.

References group().

◆ group()

cgv::gui::gui_group_ptr cgv::gui::dialog::group ( )

return the gui group to which new elements are to be add

Definition at line 94 of file dialog.cxx.

Referenced by add_std_buttons(), and exec().

◆ set_true_and_hide()

void cgv::gui::dialog::set_true_and_hide ( bool *  result,
cgv::gui::window w 
)
staticprotected

Definition at line 70 of file dialog.cxx.

Member Data Documentation

◆ D

cgv::gui::window_ptr cgv::gui::dialog::D
protected

Definition at line 26 of file dialog.h.


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