* LyXView:
- setFocus(): new pure virtual method.
* QCommandBuffer:
- simplify Ctor
- call GuiView::setFocus() instead of centralWidget()->setFocus()
* GuiView:
- implement setFocus():
- focusNextPrevChild(): use setFocus().
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16386
a592a061-630c-0410-9148-
cb99ea01b6c8
virtual void close() = 0;
+ virtual void setFocus() = 0;
+
std::vector<int> const & workAreaIds() const { return work_area_ids_; }
void setWorkArea(frontend::WorkArea * work_area);
}
+void GuiView::setFocus()
+{
+ static_cast<GuiWorkArea *>(work_area_)->setFocus();
+}
+
+
QMenu* GuiView::createPopupMenu()
{
return d.toolBarPopup(this);
bool GuiView::focusNextPrevChild(bool /*next*/)
{
- static_cast<GuiWorkArea *>(work_area_)->setFocus();
+ setFocus();
return true;
}
virtual void init();
virtual void close();
+ virtual void setFocus();
virtual void setGeometry(
unsigned int width,
unsigned int height,
} // end of anon
-QCommandBuffer::QCommandBuffer(GuiView * view, ControlCommandBuffer & control,
- QWidget * parent)
- : QWidget(parent), view_(view), controller_(control)
+QCommandBuffer::QCommandBuffer(GuiView * view, ControlCommandBuffer & control)
+ : QWidget(view), view_(view), controller_(control)
{
QPixmap qpup(toqstr(libFileSearch("images", "up", "xpm").absFilename()));
QPixmap qpdown(toqstr(libFileSearch("images", "down", "xpm").absFilename()));
void QCommandBuffer::dispatch()
{
controller_.dispatch(fromqstr(edit_->text()));
- view_->centralWidget()->setFocus();
+ view_->setFocus();
edit_->setText(QString());
edit_->clearFocus();
}
class QCommandBuffer : public QWidget {
Q_OBJECT
public:
- QCommandBuffer(GuiView * view, ControlCommandBuffer & control,
- QWidget * parent=NULL);
+ QCommandBuffer(GuiView * view, ControlCommandBuffer & control);
/// focus the edit widget
void focus_command();