00001 #include "GestureFinderGUI.h"
00002
00003 GestureFinderGUI::GestureFinderGUI(GestureFinder *module) :
00004 AbstractGtkmmModuleGUI(module, "Finder"),
00005 m_box(false, 0),
00006 m_boxMaxFramesDropped(false, 5),
00007 m_lblMaxFramesDropped("Max Frames to drop: "),
00008 m_adjMaxFramesDropped(0.0, 1.0, 20.0, 1.0, 5.0, 0.0),
00009 m_spbMaxFramesDropped(m_adjMaxFramesDropped),
00010 m_boxThreshold(false, 5),
00011 m_lblThreshold("Threshold: "),
00012 m_adjThreshold(0.0, 0.0, 3.0, .1, 1.0, 0.0),
00013 m_spbThreshold(m_adjThreshold, 0.0, 2)
00014 {
00015 m_spbMaxFramesDropped.signal_value_changed().connect(sigc::mem_fun(*this, &GestureFinderGUI::setMaxFramesDropped));
00016 m_spbThreshold.signal_value_changed().connect(sigc::mem_fun(*this, &GestureFinderGUI::setThreshold));
00017
00018 m_boxMaxFramesDropped.pack_start(m_lblMaxFramesDropped, Gtk::PACK_SHRINK, 0);
00019 m_boxMaxFramesDropped.pack_start(m_spbMaxFramesDropped, Gtk::PACK_SHRINK, 0);
00020
00021 m_boxThreshold.pack_start(m_lblThreshold, Gtk::PACK_SHRINK, 0);
00022 m_boxThreshold.pack_start(m_spbThreshold, Gtk::PACK_SHRINK, 0);
00023
00024 m_box.pack_start(m_boxMaxFramesDropped, Gtk::PACK_SHRINK, 0);
00025 m_box.pack_start(m_boxThreshold, Gtk::PACK_SHRINK);
00026
00027 add(m_box);
00028 }
00029
00030 void GestureFinderGUI::init()
00031 {
00032 m_spbMaxFramesDropped.set_value(static_cast<GestureFinder*>(getModule())->getMaxFramesDropped());
00033 m_spbThreshold.set_value(static_cast<GestureFinder*>(getModule())->getThreshold());
00034 show_all();
00035 }
00036
00037 void GestureFinderGUI::destroy()
00038 {
00039 hide_all();
00040 }
00041
00042 void GestureFinderGUI::setMaxFramesDropped()
00043 {
00044 static_cast<GestureFinder*>(getModule())->setMaxFramesDropped(static_cast<size_t>(m_spbMaxFramesDropped.get_value()));
00045 }
00046
00047 void GestureFinderGUI::setThreshold()
00048 {
00049 static_cast<GestureFinder*>(getModule())->setThreshold(m_spbThreshold.get_value());
00050 }