ardour
Classes | Public Member Functions | Public Attributes | Private Member Functions | Private Attributes | List of all members
VisibilityGroup Class Reference

#include <visibility_group.h>

Classes

struct  Member
 
class  ModelColumns
 

Public Member Functions

 VisibilityGroup (std::string const &)
 
void add (Gtk::Widget *, std::string const &, std::string const &, bool visible=false, boost::function< boost::optional< bool >()>=0)
 
Gtk::Menu * menu ()
 
Gtk::Widget * list_view ()
 
bool button_press_event (GdkEventButton *)
 
void update ()
 
void set_state (XMLNode const &)
 
void set_state (std::string)
 
std::string get_state_name () const
 
std::string get_state_value () const
 

Public Attributes

PBD::Signal0< void > VisibilityChanged
 

Private Member Functions

void toggle (std::vector< Member >::iterator)
 
void list_view_visible_changed (std::string const &)
 
void update_list_view ()
 
bool should_actually_be_visible (Member const &) const
 

Private Attributes

std::vector< Member_members
 
std::string _xml_property_name
 
ModelColumns _model_columns
 
Glib::RefPtr< Gtk::ListStore > _model
 
bool _ignore_list_view_change
 

Detailed Description

A class to manage a group of widgets where the visibility of each can be configured by the user. The class can generate a menu to set up visibility, and save and restore visibility state to XML.

Definition at line 35 of file visibility_group.h.

Constructor & Destructor Documentation

VisibilityGroup::VisibilityGroup ( std::string const &  name)

Definition at line 31 of file visibility_group.cc.

Member Function Documentation

void VisibilityGroup::add ( Gtk::Widget *  ,
std::string const &  ,
std::string const &  ,
bool  visible = false,
boost::function< boost::optional< bool >()>  = 0 
)

Add a widget to the group.

Parameters
widgetThe widget.
idSome single-word ID to be used for the state of this member in XML.
nameUser-visible name for the widget.
visibletrue to default to visible, otherwise false.
overrideA functor to decide whether the visibility specified by the member should be overridden by some external factor; if the returned optional value is given, it will be used to override whatever visibility setting the member has.

Definition at line 49 of file visibility_group.cc.

bool VisibilityGroup::button_press_event ( GdkEventButton *  ev)

Pop up a menu (on right-click) to configure visibility of members

Definition at line 63 of file visibility_group.cc.

string VisibilityGroup::get_state_name ( ) const

Definition at line 171 of file visibility_group.cc.

string VisibilityGroup::get_state_value ( ) const

Definition at line 177 of file visibility_group.cc.

Gtk::Widget * VisibilityGroup::list_view ( )

Definition at line 215 of file visibility_group.cc.

void VisibilityGroup::list_view_visible_changed ( std::string const &  )
private

Definition at line 233 of file visibility_group.cc.

Gtk::Menu * VisibilityGroup::menu ( )

Definition at line 74 of file visibility_group.cc.

void VisibilityGroup::set_state ( XMLNode const &  node)

Definition at line 132 of file visibility_group.cc.

void VisibilityGroup::set_state ( std::string  )
bool VisibilityGroup::should_actually_be_visible ( Member const &  m) const
private
Returns
true if the member should be visible, even taking into account any override functor

Definition at line 93 of file visibility_group.cc.

void VisibilityGroup::toggle ( std::vector< Member >::iterator  m)
private

Definition at line 125 of file visibility_group.cc.

void VisibilityGroup::update ( )

Update visible consequences of any changes to our _members vector

Definition at line 107 of file visibility_group.cc.

void VisibilityGroup::update_list_view ( )
private

Definition at line 193 of file visibility_group.cc.

Member Data Documentation

bool VisibilityGroup::_ignore_list_view_change
private

Definition at line 91 of file visibility_group.h.

std::vector<Member> VisibilityGroup::_members
private

Definition at line 87 of file visibility_group.h.

Glib::RefPtr<Gtk::ListStore> VisibilityGroup::_model
private

Definition at line 90 of file visibility_group.h.

ModelColumns VisibilityGroup::_model_columns
private

Definition at line 89 of file visibility_group.h.

std::string VisibilityGroup::_xml_property_name
private

Definition at line 88 of file visibility_group.h.

PBD::Signal0<void> VisibilityGroup::VisibilityChanged

Definition at line 57 of file visibility_group.h.


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