lyx_mirror/src/frontends/qt4/QParagraph.h
Richard Heck 3fcc6711f0 Fix some issues with the paragraph settings dialog. The main change
is that we distinguish between the "Default" alignment and whatever
that default happens to be: I.e., so far as the code goes, the UI now
distinguishes LYX_ALIGN_LAYOUT from LYX_ALIGN_WHATEVER, when WHATEVER
happens to be the default. So you can explicitly force, say, left-align,
and that will stick between document classes.

* src/Paragraph.cpp:
Don't output params if alignment is the default.

* src/ParagraphParameters.cpp
Treat LYX_ALIGN_LAYOUT as its own alignment.

* src/Text2.cpp
Treat LYX_ALIGN_LAYOUT as its own alignment, and force it to be accepted
as a possible alignment.

* src/frontends/controllers/ControlParagraph.{h,cpp}
New method haveMultiParSelection().

*src/frontends/qt4/QParagraph.{h,cpp}
*src/frontends/qt4/ui/ParagraphUi.ui
UI adjustments as mentioned.



git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18922 a592a061-630c-0410-9148-cb99ea01b6c8
2007-06-28 00:48:06 +00:00

80 lines
1.5 KiB
C++

// -*- C++ -*-
/**
* \file QParagraph.h
* This file is part of LyX, the document processor.
* Licence details can be found in the file COPYING.
*
* \author Edwin Leuven
* \author John Levon
*
* Full author contact details are available in file CREDITS.
*/
#ifndef QPARAGRAPH_H
#define QPARAGRAPH_H
#include "QDialogView.h"
#include "Layout.h"
#include "ui/ParagraphUi.h"
#include <QDialog>
#include <QCloseEvent>
#include <map>
namespace lyx {
namespace frontend {
class QParagraph;
class QParagraphDialog : public QDialog, public Ui::QParagraphUi {
Q_OBJECT
public:
QParagraphDialog(QParagraph * form);
///
void checkAlignmentRadioButtons();
///
void alignmentToRadioButtons(LyXAlignment align = LYX_ALIGN_LAYOUT);
///
LyXAlignment getAlignmentFromDialog();
protected:
void closeEvent (QCloseEvent * e);
private:
QParagraph * form_;
typedef std::map<LyXAlignment, QRadioButton *> QPRadioMap;
QPRadioMap radioMap;
typedef std::map<LyXAlignment, std::string> QPAlignmentLabels;
QPAlignmentLabels labelMap;
protected Q_SLOTS:
///
void change_adaptor();
///
void enableLinespacingValue(int);
};
class ControlParagraph;
class QParagraph
: public QController<ControlParagraph, QView<QParagraphDialog> >
{
public:
friend class QParagraphDialog;
QParagraph(Dialog &);
private:
/// Apply changes
virtual void apply();
/// update
virtual void update_contents();
/// build the dialog
virtual void build_dialog();
};
} // namespace frontend
} // namespace lyx
#endif // QPARAGRAPH_H