bool BufferView::Pimpl::fitCursor(LyXText * text)
{
lyx::Assert(screen_.get());
-
+
+ bv_->owner()->getDialogs()->updateParagraph();
+
bool const ret = screen_->FitCursor(text, bv_);
if (ret)
updateScrollbar();
selendpos = bv_->text->selection.end.pos();
selection = bv_->text->selection.set();
mark_set = bv_->text->selection.mark();
- the_locking_inset = bv_->text->the_locking_inset;
+ the_locking_inset = bv_->theLockingInset();
delete bv_->text;
bv_->text = new LyXText(bv_);
} else {
bv_->text->selection.set(false);
}
// remake the inset locking
- bv_->text->the_locking_inset = the_locking_inset;
+ bv_->theLockingInset(the_locking_inset);
}
bv_->text->first = screen_->TopCursorVisible(bv_->text);
buffer_->resizeInsets(bv_);
+2001-06-15 Angus Leeming <a.leeming@ic.ac.uk>
+
+ * BufferView_pimpl.C (fitCursor): emit a signal updateParagraph.
+ (resizeCurrentBuffer): have functions BufferView::theLockingInset()
+ and BufferView::theLockingInset(Inset*), so should use them and not
+ access bv_->text->the_locking_inset directly.
+
+ * lyxfunc.C (Dispatch): cosmetic name change of three signals.
+
2001-06-02 John Levon <moz@compsoc.man.ac.uk>
* Makefile.am:
+2001-06-15 Angus Leeming <a.leeming@ic.ac.uk>
+
+ * Dialogs.h: removed unused signal showCharacter.
+ Renamed signals showLayoutDocument -> showDocument,
+ showLayoutParagraph -> showParagraph,
+ showLayoutCharacter -> showCharacter.
+ Added signal updateParagraph.
+ Rearranged signals in some sort of alphabetical order again.
+
2001-06-14 Angus Leeming <a.leeming@ic.ac.uk>
* FileDialog.h:
class InsetTabular;
class InsetCommand;
class InsetMinipage;
+class LyXParagraph;
/** Container of all dialogs and signals a LyXView needs or uses to access them
The list of dialog signals isn't comprehensive but should be a good guide
SigC::Signal1<void, InsetCommand *> showBibtex;
///
SigC::Signal0<void> showCharacter;
+ /// connected to the character dialog also
+ SigC::Signal0<void> setUserFreeFont;
///
SigC::Signal1<void, InsetCommand *> showCitation;
///
///
SigC::Signal0<void> showCredits;
///
+ SigC::Signal0<void> showDocument;
+ ///
SigC::Signal1<void, InsetError *> showError;
/// show the external inset dialog
SigC::Signal1<void, InsetExternal *> showExternal;
SigC::Signal1<void, string const &> createIndex;
///
SigC::Signal1<void, InsetInfo *> showInfo;
- ///
- SigC::Signal0<void> showLayoutDocument;
- ///
- SigC::Signal0<void> showLayoutParagraph;
- ///
- SigC::Signal0<void> showLayoutCharacter;
- ///
- SigC::Signal0<void> setUserFreeFont;
- /// show the version control log
- SigC::Signal0<void> showVCLogFile;
/// show the LaTeX log or build file
SigC::Signal0<void> showLogFile;
/// display the top-level maths panel
SigC::Signal0<void> showMathPanel;
///
+ SigC::Signal1<void, InsetMinipage *> showMinipage;
+ ///
+ SigC::Signal1<void, InsetMinipage *> updateMinipage;
+ ///
+ SigC::Signal0<void> showParagraph;
+ ///
+ SigC::Signal0<void> updateParagraph;
+ ///
SigC::Signal0<void> showPreamble;
///
SigC::Signal0<void> showPreferences;
///
SigC::Signal0<void> showTabularCreate;
///
- SigC::Signal1<void, InsetMinipage *> showMinipage;
- ///
- SigC::Signal1<void, InsetMinipage *> updateMinipage;
- ///
SigC::Signal1<void, InsetCommand *> showTOC;
///
SigC::Signal1<void, string const &> createTOC;
SigC::Signal1<void, InsetCommand *> showUrl;
///
SigC::Signal1<void, string const &> createUrl;
- ///
- SigC::Signal0<void> updateCharacter; // allow update as cursor moves
+ /// show the version control log
+ SigC::Signal0<void> showVCLogFile;
//@}
private:
/// Add a dialog to the vector of dialogs.
+2001-06-15 Angus Leeming <a.leeming@ic.ac.uk>
+
+ * ControlCharacter.C (c-tor): cosmetic name change of signal.
+
2001-06-13 Angus Leeming <a.leeming@ic.ac.uk>
* *.[h]: added // -*- C++ -*-
: ControlDialog<ControlConnectBD>(lv, d),
font_(0), toggleall_(false)
{
- d_.showLayoutCharacter.connect(slot(this, &ControlCharacter::show));
+ d_.showCharacter.connect(slot(this, &ControlCharacter::show));
d_.setUserFreeFont.connect(slot(this, &ControlCharacter::apply));
}
+2001-06-15 Angus Leeming <a.leeming@ic.ac.uk>
+
+ * FormCharacter.C:
+ * FormParagraph.C (c-tor): cosmetic name change of signal.
+
2001-06-14 Angus Leeming <a.leeming@ic.ac.uk>
* FormCitation.C:
// let the dialog be shown
// This is a permanent connection so we won't bother
// storing a copy because we won't be disconnecting.
- d->showLayoutCharacter.connect(slot(this, &FormCharacter::show));
+ d->showCharacter.connect(slot(this, &FormCharacter::show));
// for LFUN_FREE
d->setUserFreeFont.connect(slot(this, &FormCharacter::apply));
}
// let the dialog be shown
// This is a permanent connection so we won't bother
// storing a copy because we won't be disconnecting.
- d->showLayoutParagraph.connect(slot(this, &FormParagraph::show));
+ d->showParagraph.connect(slot(this, &FormParagraph::show));
}
+2001-06-15 Angus Leeming <a.leeming@ic.ac.uk>
+
+ * FormDocument.C:
+ * FormParagraph.C (c-tor): cosmetic name change of signal.
+
+ * FormParagraph.[Ch]: added machinery to act on an updateParagraph
+ signal. It's pretty crude at the moment! Mental note: would be more
+ elegant if we passed a LyXParagraph & with both the signals rather than
+ search through the Buffer.
+
2001-06-13 Angus Leeming <a.leeming@ic.ac.uk>
* *.[h]: added // -*- C++ -*-
// let the dialog be shown
// This is a permanent connection so we won't bother
// storing a copy because we won't be disconnecting.
- d->showLayoutDocument.connect(slot(this, &FormDocument::show));
+ d->showDocument.connect(slot(this, &FormDocument::show));
}
FormParagraph::FormParagraph(LyXView * lv, Dialogs * d)
- : FormBaseBD(lv, d, _("Paragraph Layout"))
+ : FormBaseBD(lv, d, _("Paragraph Layout")), par_(0)
{
// let the dialog be shown
// This is a permanent connection so we won't bother
// storing a copy because we won't be disconnecting.
- d->showLayoutParagraph.connect(slot(this, &FormParagraph::show));
+ d->showParagraph.connect(slot(this, &FormParagraph::show));
+}
+
+
+void FormParagraph::connect()
+{
+ cp_ = d_->updateParagraph
+ .connect(slot(this, &FormParagraph::changedParagraph));
+ FormBaseBD::connect();
+}
+
+
+void FormParagraph::disconnect()
+{
+ cp_.disconnect();
+ FormBaseBD::disconnect();
+}
+
+
+LyXParagraph const * FormParagraph::getCurrentParagraph() const
+{
+ LyXText * text = 0;
+
+ if (lv_->view()->theLockingInset())
+ text = lv_->view()->theLockingInset()->getLyXText(lv_->view());
+ if (!text)
+ text = lv_->view()->text;
+ return text->cursor.par();
+}
+
+
+void FormParagraph::changedParagraph()
+{
+ /// Record the paragraph
+ LyXParagraph const * const p = getCurrentParagraph();
+ if (p == 0 || p == par_)
+ return;
+
+ // For now don't bother checking if the params are different,
+ // just activate the Apply button
+ bc().valid();
}
return;
Buffer * buf = lv_->view()->buffer();
- LyXText * text = 0;
- if (lv_->view()->theLockingInset())
- text = lv_->view()->theLockingInset()->getLyXText(lv_->view());
- if (!text)
- text = lv_->view()->text;
+ /// Record the paragraph
+ par_ = getCurrentParagraph();
fl_set_input(general_->input_labelwidth,
- text->cursor.par()->GetLabelWidthString().c_str());
+ par_->GetLabelWidthString().c_str());
fl_set_button(general_->radio_align_right, 0);
fl_set_button(general_->radio_align_left, 0);
fl_set_button(general_->radio_align_center, 0);
fl_set_button(general_->radio_align_block, 0);
- int align = text->cursor.par()->GetAlign();
+ int align = par_->GetAlign();
if (align == LYX_ALIGN_LAYOUT)
align = textclasslist.Style(buf->params.textclass,
- text->cursor.par()->GetLayout()).align;
+ par_->GetLayout()).align;
switch (align) {
case LYX_ALIGN_RIGHT:
LyXAlignment alignpos =
textclasslist.Style(buf->params.textclass,
- text->cursor.par()->GetLayout()).alignpossible;
+ par_->GetLayout()).alignpossible;
setEnabled(general_->radio_align_block, bool(alignpos & LYX_ALIGN_BLOCK));
setEnabled(general_->radio_align_center, bool(alignpos & LYX_ALIGN_CENTER));
setEnabled(general_->radio_align_right, bool(alignpos & LYX_ALIGN_RIGHT));
fl_set_button(general_->check_lines_top,
- text->cursor.par()->params.lineTop());
+ par_->params.lineTop());
fl_set_button(general_->check_lines_bottom,
- text->cursor.par()->params.lineBottom());
+ par_->params.lineBottom());
fl_set_button(general_->check_pagebreaks_top,
- text->cursor.par()->params.pagebreakTop());
+ par_->params.pagebreakTop());
fl_set_button(general_->check_pagebreaks_bottom,
- text->cursor.par()->params.pagebreakBottom());
+ par_->params.pagebreakBottom());
fl_set_button(general_->check_noindent,
- text->cursor.par()->params.noindent());
+ par_->params.noindent());
fl_set_input (general_->input_space_above, "");
- switch (text->cursor.par()->params.spaceTop().kind()) {
+ switch (par_->params.spaceTop().kind()) {
case VSpace::NONE:
fl_set_choice (general_->choice_space_above, 1);
break;
break;
case VSpace::LENGTH:
fl_set_choice (general_->choice_space_above, 7);
- fl_set_input(general_->input_space_above, text->cursor.par()->
+ fl_set_input(general_->input_space_above, par_->
params.spaceTop().length().asString().c_str());
break;
}
fl_set_button (general_->check_space_above,
- text->cursor.par()->params.spaceTop().keep());
+ par_->params.spaceTop().keep());
fl_set_input (general_->input_space_below, "");
- switch (text->cursor.par()->params.spaceBottom().kind()) {
+ switch (par_->params.spaceBottom().kind()) {
case VSpace::NONE:
fl_set_choice (general_->choice_space_below, 1);
break;
break;
case VSpace::LENGTH:
fl_set_choice (general_->choice_space_below, 7);
- fl_set_input(general_->input_space_below, text->cursor.par()->
+ fl_set_input(general_->input_space_below, par_->
params.spaceBottom().length().asString().c_str());
break;
}
fl_set_button(general_->check_space_below,
- text->cursor.par()->params.spaceBottom().keep());
+ par_->params.spaceBottom().keep());
fl_set_button(general_->check_noindent,
- text->cursor.par()->params.noindent());
+ par_->params.noindent());
}
#include "FormBaseDeprecated.h"
+class LyXParagraph;
struct FD_form_tabbed_paragraph;
struct FD_form_paragraph_general;
struct FD_form_paragraph_extra;
virtual void update();
/// Filter the inputs on callback from xforms
virtual bool input(FL_OBJECT * ob, long);
-
+ /// Connect signals
+ virtual void connect();
+ /// Disconnect signals
+ virtual void disconnect();
+ ///
+ void changedParagraph();
+ ///
+ LyXParagraph const * getCurrentParagraph() const;
///
virtual FL_FORM * form() const;
boost::scoped_ptr<FD_form_paragraph_general> general_;
/// The ButtonController
ButtonController<NoRepeatedApplyReadOnlyPolicy, xformsBC> bc_;
+ /// Changed Paragraph connection.
+ SigC::Connection cp_;
+
+ /// The current LyXParagraph
+ LyXParagraph const * par_;
};
}
case LFUN_LAYOUT_DOCUMENT:
- owner->getDialogs()->showLayoutDocument();
+ owner->getDialogs()->showDocument();
break;
case LFUN_LAYOUT_PARAGRAPH:
- owner->getDialogs()->showLayoutParagraph();
+ owner->getDialogs()->showParagraph();
break;
case LFUN_LAYOUT_CHARACTER:
- owner->getDialogs()->showLayoutCharacter();
+ owner->getDialogs()->showCharacter();
break;
case LFUN_LAYOUT_TABULAR: