X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ffrontends%2Fqt4%2FGuiBox.h;h=4c32dcf8fa81b42d189fa3a818091c586c3a444c;hb=28be7d552f62cc02fa86d7f79201d089bfb2d7b5;hp=2763a591c64a8b555aac0cc4a7f9b943e3cd2255;hpb=a1cec91afaca91968b46e695533c10ad2a3f73d3;p=lyx.git diff --git a/src/frontends/qt4/GuiBox.h b/src/frontends/qt4/GuiBox.h index 2763a591c6..4c32dcf8fa 100644 --- a/src/frontends/qt4/GuiBox.h +++ b/src/frontends/qt4/GuiBox.h @@ -4,78 +4,68 @@ * This file is part of LyX, the document processor. * Licence details can be found in the file COPYING. * - * \author Jürgen Spitzmüller - * \ author Martin Vermeer + * \author Jürgen Spitzmüller + * \author Martin Vermeer (with useful hints from Angus Leeming) * * Full author contact details are available in file CREDITS. */ -#ifndef QBOX_H -#define QBOX_H - -#include "GuiDialogView.h" +#ifndef GUIBOX_H +#define GUIBOX_H +#include "InsetParamsWidget.h" #include "ui_BoxUi.h" - -#include -#include - -#include - +#include "Font.h" namespace lyx { namespace frontend { -class ControlBox; -class GuiBox; - -class GuiBoxDialog : public QDialog, public Ui::BoxUi { +class GuiBox : public InsetParamsWidget, public Ui::BoxUi +{ Q_OBJECT + public: - GuiBoxDialog(GuiBox * form); -protected Q_SLOTS: - virtual void change_adaptor(); - virtual void innerBoxChanged(const QString &); - virtual void typeChanged(int); - virtual void restoreClicked(); -protected: - virtual void closeEvent(QCloseEvent * e); -private: - GuiBox * form_; -}; + GuiBox(QWidget * parent = 0); +private Q_SLOTS: + void on_innerBoxCO_activated(int); + void on_typeCO_activated(int); + void on_frameColorCO_currentIndexChanged(int); + void initDialog(); + void on_widthCB_stateChanged(int state); + void on_heightCB_stateChanged(int state); + void on_pagebreakCB_stateChanged(); -/// -class GuiBox - : public QController > -{ -public: - /// - friend class GuiBoxDialog; - /// - GuiBox(Dialog &); +private: + /// \name DialogView inherited methods + //@{ + InsetCode insetCode() const { return BOX_CODE; } + FuncCode creationCode() const { return LFUN_BOX_INSERT; } + QString dialogTitle() const { return qt_("Box Settings"); } + void paramsToDialog(Inset const *); + docstring dialogToParams() const; + bool checkWidgets(bool readonly) const; + //@} + + /// Fill the color combos + void fillComboColor(QComboBox * combo, bool const is_none); /// add and remove special lengths void setSpecial(bool ibox); /// only show valid inner box items - void setInnerType(bool frameless, int i); -private: - /// Apply changes - virtual void apply(); - /// update - virtual void update_contents(); - /// build the dialog - virtual void build_dialog(); + void setInnerType(bool frameless, QString const & type); + + QStringList ids_; /// - std::vector ids_; + QStringList gui_names_; /// - std::vector gui_names_; + QStringList ids_spec_; /// - std::vector ids_spec_; + QStringList gui_names_spec_; /// - std::vector gui_names_spec_; + QList color_codes_; }; } // namespace frontend } // namespace lyx -#endif // QBOX_H +#endif // GUIBOX_H