mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-23 18:24:48 +00:00
next one
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20773 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
06fe2c019f
commit
540a00cd02
@ -1,51 +0,0 @@
|
||||
/**
|
||||
* \file ControlTabularCreate.cpp
|
||||
* This file is part of LyX, the document processor.
|
||||
* Licence details can be found in the file COPYING.
|
||||
*
|
||||
* \author unknown
|
||||
*
|
||||
* Full author contact details are available in file CREDITS.
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include "ControlTabularCreate.h"
|
||||
#include "FuncRequest.h"
|
||||
|
||||
#include "support/convert.h"
|
||||
|
||||
|
||||
using std::string;
|
||||
|
||||
namespace lyx {
|
||||
namespace frontend {
|
||||
|
||||
ControlTabularCreate::ControlTabularCreate(Dialog & parent)
|
||||
: Controller(parent)
|
||||
{}
|
||||
|
||||
|
||||
bool ControlTabularCreate::initialiseParams(string const &)
|
||||
{
|
||||
params_.first = 5;
|
||||
params_.second = 5;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
void ControlTabularCreate::clearParams()
|
||||
{
|
||||
params_.first = 0;
|
||||
params_.second = 0;
|
||||
}
|
||||
|
||||
|
||||
void ControlTabularCreate::dispatchParams()
|
||||
{
|
||||
string const data = convert<string>(params().first) + ' ' + convert<string>(params().second);
|
||||
dispatch(FuncRequest(getLfun(), data));
|
||||
}
|
||||
|
||||
} // namespace frontend
|
||||
} // namespace lyx
|
@ -1,51 +0,0 @@
|
||||
// -*- C++ -*-
|
||||
/**
|
||||
* \file ControlTabularCreate.h
|
||||
* This file is part of LyX, the document processor.
|
||||
* Licence details can be found in the file COPYING.
|
||||
*
|
||||
* \author unknown
|
||||
*
|
||||
* Full author contact details are available in file CREDITS.
|
||||
*/
|
||||
|
||||
#ifndef CONTROLTABULARCREATE_H
|
||||
#define CONTROLTABULARCREATE_H
|
||||
|
||||
#include "Dialog.h"
|
||||
#include <utility>
|
||||
|
||||
namespace lyx {
|
||||
namespace frontend {
|
||||
|
||||
/** A controller for the TabularCreate Dialog.
|
||||
*/
|
||||
class ControlTabularCreate : public Controller {
|
||||
public:
|
||||
///
|
||||
ControlTabularCreate(Dialog &);
|
||||
///
|
||||
virtual bool initialiseParams(std::string const & data);
|
||||
/// clean-up on hide.
|
||||
virtual void clearParams();
|
||||
///
|
||||
virtual void dispatchParams();
|
||||
///
|
||||
virtual bool isBufferDependent() const { return true; }
|
||||
///
|
||||
virtual kb_action getLfun() const { return LFUN_TABULAR_INSERT; }
|
||||
|
||||
///
|
||||
typedef std::pair<size_t, size_t> rowsCols;
|
||||
///
|
||||
rowsCols & params() { return params_; }
|
||||
|
||||
private:
|
||||
/// rows, cols params
|
||||
rowsCols params_;
|
||||
};
|
||||
|
||||
} // namespace frontend
|
||||
} // namespace lyx
|
||||
|
||||
#endif // CONTROLTABULARCREATE_H
|
@ -31,7 +31,6 @@ SOURCEFILES = \
|
||||
ControlSearch.cpp \
|
||||
ControlSendto.cpp \
|
||||
ControlSpellchecker.cpp \
|
||||
ControlTabularCreate.cpp \
|
||||
ControlThesaurus.cpp \
|
||||
ControlToc.cpp \
|
||||
frontend_helpers.cpp
|
||||
@ -60,7 +59,6 @@ HEADERFILES = \
|
||||
ControlSearch.h \
|
||||
ControlSendto.h \
|
||||
ControlSpellchecker.h \
|
||||
ControlTabularCreate.h \
|
||||
ControlThesaurus.h \
|
||||
ControlToc.h \
|
||||
frontend_helpers.h
|
||||
|
@ -41,8 +41,6 @@
|
||||
#include "GuiSendto.h"
|
||||
#include "GuiShowFile.h"
|
||||
#include "GuiSpellchecker.h"
|
||||
#include "GuiTabular.h"
|
||||
#include "GuiTabularCreate.h"
|
||||
#include "GuiToc.h"
|
||||
#include "GuiView.h"
|
||||
#include "GuiViewSource.h"
|
||||
@ -232,7 +230,7 @@ Dialog * Dialogs::build(string const & name)
|
||||
} else if (name == "tabular") {
|
||||
dialog = createGuiTabular(lyxview_);
|
||||
} else if (name == "tabularcreate") {
|
||||
dialog = new GuiTabularCreateDialog(lyxview_);
|
||||
dialog = createGuiTabularCreate(lyxview_);
|
||||
} else if (name == "texinfo") {
|
||||
dialog = createGuiTexInfo(lyxview_);
|
||||
#ifdef HAVE_LIBAIKSAURUS
|
||||
|
@ -12,23 +12,27 @@
|
||||
|
||||
#include "GuiTabularCreate.h"
|
||||
|
||||
#include "ControlTabularCreate.h"
|
||||
#include "EmptyTable.h"
|
||||
#include "FuncRequest.h"
|
||||
|
||||
#include "support/convert.h"
|
||||
|
||||
#include <QCloseEvent>
|
||||
#include <QSpinBox>
|
||||
#include <QPushButton>
|
||||
|
||||
using std::string;
|
||||
|
||||
|
||||
namespace lyx {
|
||||
namespace frontend {
|
||||
|
||||
GuiTabularCreateDialog::GuiTabularCreateDialog(LyXView & lv)
|
||||
: GuiDialog(lv, "tabularcreate")
|
||||
GuiTabularCreate::GuiTabularCreate(LyXView & lv)
|
||||
: GuiDialog(lv, "tabularcreate"), Controller(this)
|
||||
{
|
||||
setupUi(this);
|
||||
setViewTitle(_("Insert Table"));
|
||||
setController(new ControlTabularCreate(*this));
|
||||
setController(this, false);
|
||||
|
||||
rowsSB->setValue(5);
|
||||
columnsSB->setValue(5);
|
||||
@ -47,30 +51,53 @@ GuiTabularCreateDialog::GuiTabularCreateDialog(LyXView & lv)
|
||||
}
|
||||
|
||||
|
||||
ControlTabularCreate & GuiTabularCreateDialog::controller()
|
||||
{
|
||||
return static_cast<ControlTabularCreate &>(GuiDialog::controller());
|
||||
}
|
||||
|
||||
|
||||
void GuiTabularCreateDialog::columnsChanged(int)
|
||||
void GuiTabularCreate::columnsChanged(int)
|
||||
{
|
||||
changed();
|
||||
}
|
||||
|
||||
|
||||
void GuiTabularCreateDialog::rowsChanged(int)
|
||||
void GuiTabularCreate::rowsChanged(int)
|
||||
{
|
||||
changed();
|
||||
}
|
||||
|
||||
|
||||
void GuiTabularCreateDialog::applyView()
|
||||
void GuiTabularCreate::applyView()
|
||||
{
|
||||
controller().params().first = rowsSB->value();
|
||||
controller().params().second = columnsSB->value();
|
||||
params_.first = rowsSB->value();
|
||||
params_.second = columnsSB->value();
|
||||
}
|
||||
|
||||
|
||||
bool GuiTabularCreate::initialiseParams(string const &)
|
||||
{
|
||||
params_.first = 5;
|
||||
params_.second = 5;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
void GuiTabularCreate::clearParams()
|
||||
{
|
||||
params_.first = 0;
|
||||
params_.second = 0;
|
||||
}
|
||||
|
||||
|
||||
void GuiTabularCreate::dispatchParams()
|
||||
{
|
||||
string const data = convert<string>(params().first) + ' ' + convert<string>(params().second);
|
||||
dispatch(FuncRequest(getLfun(), data));
|
||||
}
|
||||
|
||||
|
||||
Dialog * createGuiTabularCreate(LyXView & lv)
|
||||
{
|
||||
return new GuiTabularCreate(lv);
|
||||
}
|
||||
|
||||
|
||||
} // namespace frontend
|
||||
} // namespace lyx
|
||||
|
||||
|
@ -13,29 +13,51 @@
|
||||
#define GUITABULARCREATE_H
|
||||
|
||||
#include "GuiDialog.h"
|
||||
#include "ControlTabularCreate.h"
|
||||
#include "ui_TabularCreateUi.h"
|
||||
|
||||
#include <utility>
|
||||
|
||||
namespace lyx {
|
||||
namespace frontend {
|
||||
|
||||
class GuiTabularCreateDialog : public GuiDialog, public Ui::TabularCreateUi
|
||||
|
||||
class GuiTabularCreate
|
||||
: public GuiDialog, public Ui::TabularCreateUi, public Controller
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
GuiTabularCreateDialog(LyXView & lv);
|
||||
GuiTabularCreate(LyXView & lv);
|
||||
|
||||
private Q_SLOTS:
|
||||
void columnsChanged(int);
|
||||
void rowsChanged(int);
|
||||
|
||||
/// parent controller
|
||||
ControlTabularCreate & controller();
|
||||
Controller & controller() { return *this; }
|
||||
|
||||
private:
|
||||
/// Apply changes
|
||||
void applyView();
|
||||
///
|
||||
bool initialiseParams(std::string const & data);
|
||||
/// clean-up on hide.
|
||||
void clearParams();
|
||||
///
|
||||
void dispatchParams();
|
||||
///
|
||||
bool isBufferDependent() const { return true; }
|
||||
///
|
||||
kb_action getLfun() const { return LFUN_TABULAR_INSERT; }
|
||||
|
||||
///
|
||||
typedef std::pair<size_t, size_t> rowsCols;
|
||||
///
|
||||
rowsCols & params() { return params_; }
|
||||
|
||||
private:
|
||||
/// rows, cols params
|
||||
rowsCols params_;
|
||||
};
|
||||
|
||||
} // namespace frontend
|
||||
|
Loading…
Reference in New Issue
Block a user