File: multi_view.h

package info (click to toggle)
mysql-workbench 6.3.8%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 113,932 kB
  • ctags: 87,814
  • sloc: ansic: 955,521; cpp: 427,465; python: 59,728; yacc: 59,129; xml: 54,204; sql: 7,091; objc: 965; makefile: 638; sh: 613; java: 237; perl: 30; ruby: 6; php: 1
file content (65 lines) | stat: -rw-r--r-- 2,430 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
//!
//! \addtogroup linuxui Linux UI
//! @{
//! 

#ifndef _MULTIVIEW_H_
#define _MULTIVIEW_H_

#include <gtkmm/box.h>
#include "treemodel_wrapper.h"
#include "grt/tree_model.h"
#include "editable_iconview.h"

class MultiView : public Gtk::VBox
{
  Gtk::TreeView                    *_tree_view;
  EditableIconView                 *_icon_view;
  Glib::RefPtr<TreeModelWrapper>    _tv_model;
  Glib::RefPtr<TreeModelWrapper>    _iv_model;
  Glib::RefPtr<Gtk::TreeSelection>  _selection;

  sigc::signal<void, const std::vector<bec::NodeId>& > _selection_changed;
  sigc::signal<void, Gtk::TreeModel::Path, guint32> _popup_menu;
  sigc::signal<void, Gtk::TreeModel::Path> _activate_item;

  void tree_row_activated(const Gtk::TreeModel::Path &path,
                          const Gtk::TreeViewColumn  *column);
  void icon_activated(const Gtk::TreeModel::Path &path);
  void icon_button_release_event(GdkEventButton* event);
  void tree_button_release_event(GdkEventButton* event);
  void icon_selection_changed();
  void tree_selection_changed();
protected:
  virtual void on_selection_changed(const std::vector<bec::NodeId>& sel);
  
public:
  MultiView(bool tree_view, bool icon_view);
  virtual ~MultiView();

  Gtk::TreeView *get_tree_view() const { return _tree_view; }
  Gtk::IconView *get_icon_view() const { return _icon_view; }

  virtual void refresh();
  void set_tree_model(const Glib::RefPtr<TreeModelWrapper> &model);
  void set_icon_model(const Glib::RefPtr<TreeModelWrapper> &model);
  void unset_models();
  Glib::RefPtr<TreeModelWrapper> get_tree_model() { return _tv_model; }
  Glib::RefPtr<TreeModelWrapper> get_icon_model() { return _iv_model; }

  void set_icon_mode(bool flag, bool horizontal_icons= false);

  Gtk::TreeModel::Path get_selected();
  void select_node(const bec::NodeId& node);
  
  sigc::signal<void, const std::vector<bec::NodeId>& > signal_selection_changed() { return _selection_changed; }
  sigc::signal<void, Gtk::TreeModel::Path, guint32> signal_popup_menu() { return _popup_menu; }
  sigc::signal<void, Gtk::TreeModel::Path> signal_activate_item() { return _activate_item; }
};


#endif /* _MULTIVIEW_H_ */

//!                                                                                                                                     
//! @}                                                                                                                                  
//!