X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ffrontends%2Fxforms%2FXMiniBuffer.C;h=a6b228aa998282939e94cb690ed968520edf594f;hb=37e82a546392d43f787826b85481a11f2a27af15;hp=25505d4f35900cce298e6ad44fc9ac40ef505503;hpb=f5d175ff402a70bb14ca85f9c9266f3f2434f86f;p=lyx.git diff --git a/src/frontends/xforms/XMiniBuffer.C b/src/frontends/xforms/XMiniBuffer.C index 25505d4f35..a6b228aa99 100644 --- a/src/frontends/xforms/XMiniBuffer.C +++ b/src/frontends/xforms/XMiniBuffer.C @@ -1,59 +1,69 @@ -// -*- C++ -*- /** * \file XMiniBuffer.C * This file is part of LyX, the document processor. * 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 + * Full author contact details are available in file CREDITS. */ #include #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 -#include - -#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 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)); @@ -321,10 +331,9 @@ void C_freebrowserCB(FL_FREEBROWSER * fb, int action) } -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); @@ -349,3 +358,6 @@ FL_FREEBROWSER * create_freebrowser(void * parent) } } // namespace anon + +} // namespace frontend +} // namespace lyx