#include <config.h>
-#include "GuiView.h"
-
#include "GuiCommandBuffer.h"
+
#include "GuiCommandEdit.h"
+#include "GuiView.h"
#include "qt_helpers.h"
#include "BufferView.h"
#include "LyXAction.h"
#include "FuncRequest.h"
-#include "frontends/LyXView.h"
-
#include "support/lyxalgo.h"
#include "support/lstrings.h"
#include <QHBoxLayout>
#include <QKeyEvent>
-#include <QLayout>
#include <QListWidget>
#include <QMouseEvent>
#include <QPixmap>
#include <QToolTip>
#include <QVBoxLayout>
-using std::back_inserter;
-using std::transform;
-using std::string;
-using std::vector;
-
+using namespace std;
+using namespace lyx::support;
namespace lyx {
namespace frontend {
-using support::prefixIs;
-
-
namespace {
class QTempListBox : public QListWidget {
} // end of anon
-GuiCommandBuffer::GuiCommandBuffer(GuiViewBase * view)
- : view_(view), lv_(*view), history_pos_(history_.end())
+GuiCommandBuffer::GuiCommandBuffer(GuiView * view)
+ : view_(view), history_pos_(history_.end())
{
transform(lyxaction.func_begin(), lyxaction.func_end(),
back_inserter(commands_), firster());
void GuiCommandBuffer::dispatch()
{
- dispatch(fromqstr(edit_->text()));
+ QString cmd = edit_->text();
view_->setFocus();
edit_->setText(QString());
edit_->clearFocus();
+ dispatch(fromqstr(cmd));
}
list->resize(list->sizeHint());
QPoint const pos = edit_->mapToGlobal(QPoint(0, 0));
- int const y = std::max(0, pos.y() - list->height());
+ int const y = max(0, pos.y() - list->height());
list->move(pos.x(), y);
docstring const GuiCommandBuffer::getCurrentState() const
{
- return lv_.view()->cursor().currentState();
+ return view_->view()->cursor().currentState();
}
void GuiCommandBuffer::hide() const
{
- lv_.showMiniBuffer(false);
+ FuncRequest cmd(LFUN_COMMAND_EXECUTE, "off");
+ theLyXFunc().setLyXView(view_);
+ lyx::dispatch(cmd);
}
history_pos_ = history_.end();
FuncRequest func = lyxaction.lookupFunc(str);
func.origin = FuncRequest::COMMANDBUFFER;
- lv_.dispatch(func);
+ theLyXFunc().setLyXView(view_);
+ lyx::dispatch(func);
}
} // namespace frontend