release the 4.0.8 version
[hkl.git] / gui / pseudoaxesframe.h
blobf02dd8451868cacef22505146f081064b2cb7940
1 /* This file is part of the hkl library.
3 * The hkl library is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 3 of the License, or
6 * (at your option) any later version.
8 * The hkl library is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
13 * You should have received a copy of the GNU General Public License
14 * along with the hkl library. If not, see <http://www.gnu.org/licenses/>.
16 * Copyright (C) 2003-2010 Synchrotron SOLEIL
17 * L'Orme des Merisiers Saint-Aubin
18 * BP 48 91192 GIF-sur-YVETTE CEDEX
20 * Authors: Picca Frédéric-Emmanuel <picca@synchrotron-soleil.fr>
22 #ifndef __PSEUDO_AXES_FRAME_H__
23 #define __PSEUDO_AXES_FRAME_H__
25 #include <gtkmm.h>
26 #include "hkl.h"
28 class ModeModelColumns : public Gtk::TreeModel::ColumnRecord
30 public:
31 Gtk::TreeModelColumn<Glib::ustring> name;
33 ModeModelColumns()
35 this->add(name);
39 class PseudoAxisModelColumns : public Gtk::TreeModel::ColumnRecord
41 public:
42 Gtk::TreeModelColumn<Glib::ustring> name;
43 Gtk::TreeModelColumn<double> value;
44 Gtk::TreeModelColumn<HklPseudoAxis *> pseudo;
46 PseudoAxisModelColumns()
48 this->add(name);
49 this->add(value);
50 this->add(pseudo);
54 class ModeParameterModelColumns : public Gtk::TreeModel::ColumnRecord
56 public:
57 Gtk::TreeModelColumn<Glib::ustring> name;
58 Gtk::TreeModelColumn<double> value;
59 Gtk::TreeModelColumn<HklParameter *> parameter;
61 ModeParameterModelColumns()
63 this->add(name);
64 this->add(value);
65 this->add(parameter);
69 class PseudoAxesFrame
71 public:
72 PseudoAxesFrame(HklPseudoAxisEngine *engine);
73 Gtk::Frame &frame(void) {return *_frame1;}
74 virtual ~PseudoAxesFrame(void);
76 void update(void);
78 // signals emitted
79 typedef sigc::signal<void> type_signal_changed;
80 type_signal_changed signal_changed(void);
82 // callback
83 protected:
84 void on_combobox1_changed(void);
85 virtual void on_cell_TreeView_pseudoAxis_value_edited(Glib::ustring const &,
86 Glib::ustring const &);
87 virtual void on_cell_treeview2_mode_parameter_value_edited(Glib::ustring const &,
88 Glib::ustring const &);
89 void on_button1_clicked(void);
90 void on_button2_clicked(void);
92 // non callback
93 protected:
94 void updateMode(void);
95 void updatePseudoAxis(void);
96 void updateModeParameters(void);
98 type_signal_changed _signal_changed;
100 // members
101 protected:
102 HklPseudoAxisEngine *_engine;
104 // widget
105 Glib::RefPtr<Gtk::Builder> _refGlade;
106 Gtk::Frame *_frame1;
107 Gtk::Label *_label2;
108 Gtk::ComboBox *_combobox1;
109 Gtk::Expander *_expander1;
110 Gtk::TreeView *_treeview1;
111 Gtk::TreeView *_treeview2;
112 Gtk::Button *_button1;
113 Gtk::Button *_button2;
115 // objects
116 Glib::RefPtr<Gtk::ListStore> _mode_ListStore;
117 Glib::RefPtr<Gtk::ListStore> _pseudoAxis_ListStore;
118 Glib::RefPtr<Gtk::ListStore> _mode_parameter_ListStore;
119 ModeModelColumns _mode_columns;
120 PseudoAxisModelColumns _pseudoAxis_columns;
121 ModeParameterModelColumns _mode_parameter_columns;
124 #endif // __PSEUDO_AXES_FRAME_H__