* Licence details can be found in the file COPYING.
*
* \author Lars
- * \author Asger and Juergen
+ * \author Asger and JΓΌrgen
*
* Full author contact details are available in file CREDITS.
*/
#include <config.h>
#include "XMiniBuffer.h"
-#include "ControlCommandBuffer.h"
+#include "XFormsView.h"
+
#include "freebrowser.h"
#include "xforms_helpers.h"
-#include "gettext.h"
+#include "controllers/ControlCommandBuffer.h"
#include "frontends/Timeout.h"
-#include "support/lstrings.h"
+#include "gettext.h"
#include <boost/bind.hpp>
-#include <vector>
-
-#ifndef CXX_GLOBAL_CSTD
-using std::isprint;
-#endif
+using boost::shared_ptr;
-using std::endl;
using std::vector;
+using std::string;
+namespace lyx {
+namespace frontend {
namespace {
/// This creates the input widget for the minibuffer
-FL_OBJECT * create_input_box(void * parent, int type,
- FL_Coord, FL_Coord, FL_Coord, FL_Coord);
+FL_OBJECT * create_input_box(void * parent, int type);
FL_FREEBROWSER * create_freebrowser(void * parent);
} // namespace anon
-XMiniBuffer::XMiniBuffer(ControlCommandBuffer & control,
- FL_Coord x, FL_Coord y, FL_Coord h, FL_Coord w)
+XMiniBuffer::XMiniBuffer(XFormsView & owner,
+ ControlCommandBuffer & control)
: controller_(control),
info_shown_(false)
{
- input_ = create_input_box(this, FL_NORMAL_INPUT, x, y, h, w);
+ input_ = create_input_box(this, FL_NORMAL_INPUT);
freebrowser_.reset(create_freebrowser(this), fl_free_freebrowser);
+ // The minibuffer is 25 pixels high and is embedded inside a
+ // 2 pixel deep frame.
+ int const air = 2;
+
+ BoxList & boxlist = owner.getBox(XFormsView::Bottom)->children();
+ minibuffer_ = boxlist.push_back(Box(0,0));
+ shared_ptr<Box> center = embed(input_, minibuffer_->children(), widgets_, air);
+ center->set(Box::Expand);
+ center->setMinimumDimensions(0, 25);
+
+ owner.metricsUpdated.connect(boost::bind(&WidgetMap::updateMetrics,
+ &widgets_));
+
info_timer_.reset(new Timeout(1500));
idle_timer_.reset(new Timeout(6000));
info_con = info_timer_->timeout.connect(boost::bind(&XMiniBuffer::info_timeout, this));
}
-FL_OBJECT * create_input_box(void * parent, int type,
- FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h)
+FL_OBJECT * create_input_box(void * parent, int type)
{
- FL_OBJECT * obj = fl_add_input(type, x, y, w, h, "");
+ FL_OBJECT * obj = fl_add_input(type, 0, 0, 0, 0, "");
fl_set_object_boxtype(obj, FL_DOWN_BOX);
fl_set_object_resize(obj, FL_RESIZE_ALL);
fl_set_object_gravity(obj, SouthWestGravity, SouthEastGravity);
}
} // namespace anon
+
+} // namespace frontend
+} // namespace lyx