#elif defined __DECCXX
# define BOOST_NO_SLIST
# define BOOST_NO_HASH
-# define BOOST_NO_INCLASS_MEMBER_INITIALIZATION
// Greenhills C++ -----------------------------------------------------------//
new_inset->setOwner(bv_->theLockingInset());
new_inset->SetAutoBreakRows(true);
new_inset->SetDrawFrame(0, InsetText::LOCKED);
- new_inset->SetFrameColor(0, LColor::footnoteframe);
+ new_inset->SetFrameColor(0, LColor::captionframe);
if (insertInset(new_inset))
new_inset->Edit(bv_, 0, 0, 0);
else
+2001-06-05 Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>
+
+ * gettext.h (gettext_init):
+ (locale_init): use a real definition instead of a macro
+
+2001-06-02 John Levon <moz@compsoc.man.ac.uk>
+
+ * Bufferview_pimpl.C:
+ * LColor.h:
+ * LColor.C: further lcolor tidies
+
2001-06-05 Lars Gullik Bjønnes <larsbj@birdstep.com>
* BufferView_pimpl.C (updateScrollbar): simplify.
{ background, N_("background"), "background", "linen", "background" },
{ foreground, N_("text"), "foreground", "black", "foreground" },
{ selection, N_("selection"), "selection", "LightBlue", "selection" },
- { latex, N_("latex"), "latex", "DarkRed", "latex" },
+ { latex, N_("latex text"), "latex", "DarkRed", "latex" },
{ note, N_("note"), "note", "black", "note" },
{ notebg, N_("note background"), "notebg", "yellow", "notebg" },
{ noteframe, N_("note frame"), "noteframe", "black", "noteframe" },
{ mathframe, N_("math frame"), "mathframe", "Magenta", "mathframe" },
{ mathcursor, N_("math cursor"), "mathcursor", "black", "mathcursor" },
{ mathline, N_("math line"), "mathline", "Blue", "mathline" },
- { footnote, N_("footnote"), "footnote", "DarkRed", "footnote" },
- { footnoteframe, N_("footnote frame"), "footnoteframe", "IndianRed", "footnoteframe" },
- { ert, N_("latex inset"), "ert", "DarkRed", "ert" },
+ { captionframe, N_("caption frame"), "captionframe", "DarkRed", "captionframe" },
+ { collapsable, N_("collapsable inset text"), "collapsable", "DarkRed", "collapsable" },
+ { collapsableframe, N_("collapsable inset frame"), "collapsableframe", "IndianRed", "collapsableframe" },
{ insetbg, N_("inset background"), "insetbg", "grey60", "insetbg" },
{ insetframe, N_("inset frame"), "insetframe", "IndianRed", "insetframe" },
{ error, N_("LaTeX error"), "error", "Red", "error" },
/// Math line color
mathline,
- /// Footnote marker text
- // FIXME: this is seemingly mis-used all over the place
- footnote,
- /// Footnote line color
- footnoteframe,
-
- /// ERT marker text
- // FIXME: is there any reason this is different from latex ?
- ert,
-
+ /// caption frame color
+ captionframe,
+
+ /// collapsable insets text
+ collapsable,
+ /// collapsable insets frame
+ collapsableframe,
+
/// Inset marker background color
insetbg,
/// Inset marker frame color
+2001-06-02 John Levon <moz@compsoc.man.ac.uk>
+
+ * <various>: fix random space pepper to use
+ hard tabs. Also add <config.h> where necessitated
+ by using LString.h
+
2001-05-22 Adrien Rebollo <rebollo@iaf.cnrs-gif.fr>
* FormDocument.C (build): add iso8859-15 support.
Dialogs::Dialogs(LyXView * lv)
{
- splash_.reset( new FormSplash(lv, this) );
+ splash_.reset( new FormSplash(lv, this) );
- // dialogs that have been converted to new scheme
- add( new GUICitation<FormCitation, qt2BC>( *lv, *this ) );
- add( new GUICopyright<FormCopyright, qt2BC>( *lv, *this ) );
- add( new GUICredits<FormCredits, qt2BC>( *lv, *this ) );
+ // dialogs that have been converted to new scheme
+ add( new GUICitation<FormCitation, qt2BC>( *lv, *this ) );
+ add( new GUICopyright<FormCopyright, qt2BC>( *lv, *this ) );
+ add( new GUICredits<FormCredits, qt2BC>( *lv, *this ) );
- // ------------------------------------------
+ // ------------------------------------------
- // dialogs that are still old-style
- add( new FormCharacter(lv, this));
+ // dialogs that are still old-style
+ add( new FormCharacter(lv, this));
- // add(new FormDocument(lv, this));
+ // add(new FormDocument(lv, this));
- // REMOVED THIS UNTIL CHANGED TO NEW SCHEME -- Kalle, 2001-03-23
- // add(new FormError(lv, this));
+ // REMOVED THIS UNTIL CHANGED TO NEW SCHEME -- Kalle, 2001-03-23
+ // add(new FormError(lv, this));
- // REMOVED THIS UNTIL CHANGED TO NEW SCHEME -- Kalle, 2001-03-28
- // add(new FormGraphics(lv, this));
- // add(new FormIndex(lv, this));
- add(new FormParagraph(lv, this));
- add(new FormPreferences(lv, this));
- add(new FormPrint(lv, this));
- // add(new FormRef(lv, this));
- add(new FormSearch(lv, this));
- add(new FormTabular(lv, this));
- add(new FormTabularCreate(lv, this));
- // add(new FormToc(lv, this));
- // add(new FormUrl(lv, this));
+ // REMOVED THIS UNTIL CHANGED TO NEW SCHEME -- Kalle, 2001-03-28
+ // add(new FormGraphics(lv, this));
+ // add(new FormIndex(lv, this));
+ add(new FormParagraph(lv, this));
+ add(new FormPreferences(lv, this));
+ add(new FormPrint(lv, this));
+ // add(new FormRef(lv, this));
+ add(new FormSearch(lv, this));
+ add(new FormTabular(lv, this));
+ add(new FormTabularCreate(lv, this));
+ // add(new FormToc(lv, this));
+ // add(new FormUrl(lv, this));
- // reduce the number of connections needed in
- // dialogs by a simple connection here.
- hideAll.connect(hideBufferDependent.slot());
+ // reduce the number of connections needed in
+ // dialogs by a simple connection here.
+ hideAll.connect(hideBufferDependent.slot());
}
-
-
FormCharacter::FormCharacter(LyXView *v, Dialogs *d)
: dialog_(0), lv_(v), d_(d), h_(0), u_(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->showLayoutCharacter.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->showLayoutCharacter.connect(slot(this, &FormCharacter::show));
+ // for LFUN_FREE
+ d->setUserFreeFont.connect(slot(this, &FormCharacter::apply));
}
FormCharacter::~FormCharacter()
{
- delete dialog_;
+ delete dialog_;
}
void FormCharacter::apply()
{
- if (!lv_->view()->available() || !dialog_)
- return;
+ if (!lv_->view()->available() || !dialog_)
+ return;
- LyXFont font = dialog_->getChar();
+ LyXFont font = dialog_->getChar();
- if (dialog_->langItem()==1)
- font.setLanguage(lv_->buffer()->params.language);
+ if (dialog_->langItem()==1)
+ font.setLanguage(lv_->buffer()->params.language);
- ToggleAndShow(lv_->view(), font, dialog_->toggleAll());
- lv_->view()->setState();
- lv_->buffer()->markDirty();
- setMinibuffer(lv_, _("Character set"));
+ ToggleAndShow(lv_->view(), font, dialog_->toggleAll());
+ lv_->view()->setState();
+ lv_->buffer()->markDirty();
+ setMinibuffer(lv_, _("Character set"));
}
void FormCharacter::show()
{
- if (!dialog_) {
- dialog_ = new CharDlgImpl(this, 0, _("Character Options"), false);
- // add languages
- for (Languages::const_iterator cit = languages.begin();
- cit != languages.end(); ++cit) {
- const string language = (*cit).second.lang();
- dialog_->lang->insertItem( tostr(language).c_str(), -1 );
- }
- }
-
- if (!dialog_->isVisible()) {
- h_ = d_->hideBufferDependent.connect(slot(this, &FormCharacter::hide));
- u_ = d_->updateBufferDependent.connect(slot(this, &FormCharacter::update));
- }
-
- dialog_->raise();
- dialog_->setActiveWindow();
- update();
- dialog_->show();
+ if (!dialog_) {
+ dialog_ = new CharDlgImpl(this, 0, _("Character Options"), false);
+ // add languages
+ for (Languages::const_iterator cit = languages.begin();
+ cit != languages.end(); ++cit) {
+ const string language = (*cit).second.lang();
+ dialog_->lang->insertItem( tostr(language).c_str(), -1 );
+ }
+ }
+
+ if (!dialog_->isVisible()) {
+ h_ = d_->hideBufferDependent.connect(slot(this, &FormCharacter::hide));
+ u_ = d_->updateBufferDependent.connect(slot(this, &FormCharacter::update));
+ }
+
+ dialog_->raise();
+ dialog_->setActiveWindow();
+ update();
+ dialog_->show();
}
void FormCharacter::close()
{
- h_.disconnect();
- u_.disconnect();
+ h_.disconnect();
+ u_.disconnect();
}
void FormCharacter::hide()
{
- dialog_->hide();
- close();
+ dialog_->hide();
+ close();
}
void FormCharacter::update(bool)
{
+ if (!lv_->view()->available())
+ return;
- if (!lv_->view()->available())
- return;
-
- dialog_->setReadOnly(lv_->buffer()->isReadonly());
+ dialog_->setReadOnly(lv_->buffer()->isReadonly());
}
class FormCharacter : public DialogBase {
public:
- ///
- FormCharacter(LyXView *, Dialogs *);
- ///
- ~FormCharacter();
-
- /// Apply changes.
- void apply();
- /// Close connections.
- void close();
+ ///
+ FormCharacter(LyXView *, Dialogs *);
+ ///
+ ~FormCharacter();
+ /// Apply changes.
+ void apply();
+ /// Close connections.
+ void close();
private:
- /// Show the dialog.
- void show();
- /// Hide the dialog.
- void hide();
- /// Update the dialog.
- void update(bool switched = false);
-
- /// Real GUI implementation.
- CharDlgImpl * dialog_;
+ /// Show the dialog.
+ void show();
+ /// Hide the dialog.
+ void hide();
+ /// Update the dialog.
+ void update(bool switched = false);
- /// the LyXView we belong to.
- LyXView * lv_;
+ /// Real GUI implementation.
+ CharDlgImpl * dialog_;
- /** Which Dialogs do we belong to?
- * Used so we can get at the signals we have to connect to.
- */
- Dialogs * d_;
+ /// the LyXView we belong to.
+ LyXView * lv_;
- /// is the buffer readonly?
- bool readonly;
+ /** Which Dialogs do we belong to?
+ * Used so we can get at the signals we have to connect to.
+ */
+ Dialogs * d_;
- /// Hide connection.
- SigC::Connection h_;
+ /// is the buffer readonly?
+ bool readonly;
- /// Update connection.
- SigC::Connection u_;
+ /// Hide connection.
+ SigC::Connection h_;
+ /// Update connection.
+ SigC::Connection u_;
};
#endif
/* This file is part of
* ======================================================
*
- * LyX, The Document Processor
+ * LyX, The Document Processor
*
- * Copyright 2000 The LyX Team.
+ * Copyright 2000 The LyX Team.
*
* ======================================================
*
typedef Qt2CB<ControlCitation, Qt2DB<FormCitationDialogImpl> > base_class;
FormCitation::FormCitation(ControlCitation & c)
- : base_class(c, _("Citation"))
+ : base_class(c, _("Citation"))
{}
void FormCitation::apply()
{
- controller().params().setCmdName("cite");
- controller().params().setContents(getStringFromVector(citekeys));
-
- string const after = dialog_->textAfterED->text().latin1();
- controller().params().setOptions(after);
+ controller().params().setCmdName("cite");
+ controller().params().setContents(getStringFromVector(citekeys));
+
+ string const after = dialog_->textAfterED->text().latin1();
+ controller().params().setOptions(after);
}
void FormCitation::hide()
{
- citekeys.clear();
- bibkeys.clear();
-
- Qt2Base::hide();
+ citekeys.clear();
+ bibkeys.clear();
+
+ Qt2Base::hide();
}
void FormCitation::build()
{
- // PENDING(kalle) Parent?
- dialog_.reset( new FormCitationDialogImpl( this ));
-
- dialog_->searchTypeCB->setChecked( false );
- dialog_->searchCaseCB->setChecked( false );
-
- // Manage the ok, apply, restore and cancel/close buttons
- bc().setOK(dialog_->okPB);
- bc().setApply(dialog_->applyPB);
- bc().setCancel(dialog_->cancelPB);
- bc().setRestore(dialog_->restorePB);
-
- bc().addReadOnly(dialog_->addPB);
- bc().addReadOnly(dialog_->delPB);
- bc().addReadOnly(dialog_->upPB);
- bc().addReadOnly(dialog_->downPB);
- bc().addReadOnly(dialog_->citationStyleCO);
- bc().addReadOnly(dialog_->textBeforeED);
- bc().addReadOnly(dialog_->textAfterED);
-
- bc().refresh();
+ // PENDING(kalle) Parent?
+ dialog_.reset( new FormCitationDialogImpl( this ));
+
+ dialog_->searchTypeCB->setChecked( false );
+ dialog_->searchCaseCB->setChecked( false );
+
+ // Manage the ok, apply, restore and cancel/close buttons
+ bc().setOK(dialog_->okPB);
+ bc().setApply(dialog_->applyPB);
+ bc().setCancel(dialog_->cancelPB);
+ bc().setRestore(dialog_->restorePB);
+
+ bc().addReadOnly(dialog_->addPB);
+ bc().addReadOnly(dialog_->delPB);
+ bc().addReadOnly(dialog_->upPB);
+ bc().addReadOnly(dialog_->downPB);
+ bc().addReadOnly(dialog_->citationStyleCO);
+ bc().addReadOnly(dialog_->textBeforeED);
+ bc().addReadOnly(dialog_->textAfterED);
+
+ bc().refresh();
}
void FormCitation::update()
{
- // Make the list of all available bibliography keys
- bibkeys = biblio::getKeys(controller().bibkeysInfo());
- updateBrowser(dialog_->bibLB, bibkeys);
-
- // Ditto for the keys cited in this inset
- citekeys = getVectorFromString(controller().params().getContents());
- updateBrowser(dialog_->citeLB, citekeys);
+ // Make the list of all available bibliography keys
+ bibkeys = biblio::getKeys(controller().bibkeysInfo());
+ updateBrowser(dialog_->bibLB, bibkeys);
+
+ // Ditto for the keys cited in this inset
+ citekeys = getVectorFromString(controller().params().getContents());
+ updateBrowser(dialog_->citeLB, citekeys);
- // No keys have been selected yet, so...
- dialog_->infoML->clear();
- setBibButtons(OFF);
- setCiteButtons(OFF);
+ // No keys have been selected yet, so...
+ dialog_->infoML->clear();
+ setBibButtons(OFF);
+ setCiteButtons(OFF);
- int noKeys = int(max(bibkeys.size(), citekeys.size()));
+ int noKeys = int(max(bibkeys.size(), citekeys.size()));
- // Place bounds, so that 4 <= noKeys <= 10
- noKeys = max(4, min(10, noKeys));
+ // Place bounds, so that 4 <= noKeys <= 10
+ noKeys = max(4, min(10, noKeys));
- dialog_->textAfterED->setText( controller().params().getOptions().c_str());
+ dialog_->textAfterED->setText( controller().params().getOptions().c_str());
}
void FormCitation::updateBrowser( QListBox* browser,
vector<string> const & keys) const
{
- browser->clear();
-
- for (vector<string>::const_iterator it = keys.begin();
- it < keys.end(); ++it) {
- string key = frontStrip(strip(*it));
- if( !key.empty() )
- browser->insertItem( key.c_str() );
- }
+ browser->clear();
+
+ for (vector<string>::const_iterator it = keys.begin();
+ it < keys.end(); ++it) {
+ string key = frontStrip(strip(*it));
+ if( !key.empty() )
+ browser->insertItem( key.c_str() );
+ }
}
void FormCitation::setBibButtons(State status) const
{
- dialog_->addPB->setEnabled( (status == ON) );
+ dialog_->addPB->setEnabled( (status == ON) );
}
void FormCitation::setCiteButtons(State status) const
{
- int const sel = dialog_->citeLB->currentItem();
- int const maxline = dialog_->citeLB->count()-1;
- bool const activate = (status == ON);
- bool const activate_up = (activate && sel != 0);
- bool const activate_down = (activate && sel != maxline);
-
- dialog_->delPB->setEnabled( activate );
- dialog_->upPB->setEnabled( activate_up );
- dialog_->downPB->setEnabled( activate_down );
+ int const sel = dialog_->citeLB->currentItem();
+ int const maxline = dialog_->citeLB->count()-1;
+ bool const activate = (status == ON);
+ bool const activate_up = (activate && sel != 0);
+ bool const activate_down = (activate && sel != maxline);
+
+ dialog_->delPB->setEnabled( activate );
+ dialog_->upPB->setEnabled( activate_up );
+ dialog_->downPB->setEnabled( activate_down );
}
-
-
class FormCitationDialogImpl;
class FormCitation : public Qt2CB<ControlCitation, Qt2DB<FormCitationDialogImpl> > {
- friend class FormCitationDialogImpl;
+ friend class FormCitationDialogImpl;
public:
- ///
- FormCitation(ControlCitation &);
+ ///
+ FormCitation(ControlCitation &);
private:
- ///
- enum State {
- ///
- ON,
///
- OFF
- };
+ enum State {
+ ///
+ ON,
+ ///
+ OFF
+ };
- /// Set the Params variable for the Controller.
- virtual void apply();
- /// Build the dialog.
- virtual void build();
- /// Hide the dialog.
- virtual void hide();
- /// Update dialog before/whilst showing it.
- virtual void update();
- // /// Filter the inputs on callback from xforms
- // virtual ButtonPolicy::SMInput input(FL_OBJECT *, long);
+ /// Set the Params variable for the Controller.
+ virtual void apply();
+ /// Build the dialog.
+ virtual void build();
+ /// Hide the dialog.
+ virtual void hide();
+ /// Update dialog before/whilst showing it.
+ virtual void update();
+ // /// Filter the inputs on callback from xforms
+ // virtual ButtonPolicy::SMInput input(FL_OBJECT *, long);
- void updateBrowser(QListBox*, std::vector<string> const &) const;
- ///
- void setBibButtons(State) const;
- ///
- void setCiteButtons(State) const;
+ void updateBrowser(QListBox*, std::vector<string> const &) const;
+ ///
+ void setBibButtons(State) const;
+ ///
+ void setCiteButtons(State) const;
- ///
- std::vector<string> citekeys;
- ///
- std::vector<string> bibkeys;
+ ///
+ std::vector<string> citekeys;
+ ///
+ std::vector<string> bibkeys;
};
#endif // FORMCITATION_H
/**
- * $Id: FormCitationDialogImpl.C,v 1.6 2001/04/02 20:08:43 kalle Exp $
+ * $Id: FormCitationDialogImpl.C,v 1.7 2001/06/05 17:05:51 lasgouttes Exp $
*/
+#include <config.h>
+
#include "FormCitationDialogImpl.h"
#include "Dialogs.h"
#include "FormCitation.h"
typedef Qt2CB<ControlCopyright, Qt2DB<FormCopyrightDialogImpl> > base_class;
FormCopyright::FormCopyright( ControlCopyright& c ) :
- base_class( c, _( "Copyright and Warranty" ) )
+ base_class( c, _( "Copyright and Warranty" ) )
{
}
void FormCopyright::build()
{
- // PENDING(kalle) Parent???
- dialog_.reset( new FormCopyrightDialogImpl() );
- connect( dialog_.get()->closePB, SIGNAL( clicked() ),
- this, SLOT( slotCancel() ) );
-
- dialog_->copyrightLA->setText( controller().getCopyright().c_str() );
- dialog_->licenseLA->setText( controller().getLicence().c_str() );
- dialog_->disclaimerLA->setText( controller().getDisclaimer().c_str() );
-
- // Manage the cancel/close button
- bc().setCancel(dialog_->closePB);
- bc().refresh();
+ // PENDING(kalle) Parent???
+ dialog_.reset( new FormCopyrightDialogImpl() );
+ connect( dialog_.get()->closePB, SIGNAL( clicked() ),
+ this, SLOT( slotCancel() ) );
+
+ dialog_->copyrightLA->setText( controller().getCopyright().c_str() );
+ dialog_->licenseLA->setText( controller().getLicence().c_str() );
+ dialog_->disclaimerLA->setText( controller().getDisclaimer().c_str() );
+
+ // Manage the cancel/close button
+ bc().setCancel(dialog_->closePB);
+ bc().refresh();
}
-
-
-
@author Kalle Dalheimer
*/
class FormCopyright
- : public Qt2CB<ControlCopyright, Qt2DB<FormCopyrightDialogImpl> >
+ : public Qt2CB<ControlCopyright, Qt2DB<FormCopyrightDialogImpl> >
{
public:
FormCopyright( ControlCopyright& );
void FormCredits::build()
{
- // PENDING(kalle) Parent?
- dialog_.reset(new FormCreditsDialogImpl( this ));
-
- // Manage the cancel/close button
- bc().setCancel(dialog_->okPB);
- bc().refresh();
-
- std::stringstream ss;
- QString xformscredits = controller().getCredits( ss ).str().c_str();
- QStringList xformslist = QStringList::split( '\n', controller().getCredits( ss ).str().c_str(), true );
- for( QStringList::Iterator it = xformslist.begin(); it != xformslist.end(); ++it ) {
- QString line = *it;
- if( line.left( 2 ) == "@b" )
- dialog_->creditsTV->append( "<b>" + line.mid( 2 ) + "</b>" );
- else if( line.left( 2 ) == "@i" )
- dialog_->creditsTV->append( "<i>" + line.mid( 2 ) + "</i>" );
- else
- dialog_->creditsTV->append( line );
- }
+ // PENDING(kalle) Parent?
+ dialog_.reset(new FormCreditsDialogImpl( this ));
+
+ // Manage the cancel/close button
+ bc().setCancel(dialog_->okPB);
+ bc().refresh();
+
+ std::stringstream ss;
+ QString xformscredits = controller().getCredits( ss ).str().c_str();
+ QStringList xformslist = QStringList::split( '\n', controller().getCredits( ss ).str().c_str(), true );
+ for( QStringList::Iterator it = xformslist.begin(); it != xformslist.end(); ++it ) {
+ QString line = *it;
+ if( line.left( 2 ) == "@b" )
+ dialog_->creditsTV->append( "<b>" + line.mid( 2 ) + "</b>" );
+ else if( line.left( 2 ) == "@i" )
+ dialog_->creditsTV->append( "<i>" + line.mid( 2 ) + "</i>" );
+ else
+ dialog_->creditsTV->append( line );
+ }
}
/* This file is part of
* ======================================================
*
- * LyX, The Document Processor
+ * LyX, The Document Processor
*
- * Copyright 2000 The LyX Team.
+ * Copyright 2000 The LyX Team.
*
- * @author Kalle Dalheimer
+ * @author Kalle Dalheimer
*
*======================================================*/
typedef Qt2CB<ControlDocument, Qt2DB<FormDocumentDialogImpl> > base_class;
FormDocument::FormDocument( ControlDocument& c )
- : base_class( c, _("Document Layout"))
+ : base_class( c, _("Document Layout"))
{
}
void FormDocument::build()
{
- int n;
-
- // the tabbed folder
- // PENDING(kalle) Parent???
- dialog_.reset( new FormDocumentDialogImpl());
-
- // Manage the restore, ok, apply, restore and cancel/close buttons
- bc().setOK(dialog_->okPB);
- bc().setApply(dialog_->applyPB);
- bc().setCancel(dialog_->cancelPB);
- bc().setRestore(dialog_->restorePB);
- bc().refresh();
-
- // the document paper page
- FormDocumentDialogImpl* dialog = dialog_.get();
- dialog->papersize2CO->insertItem( _( "Default" ) );
- dialog->papersize2CO->insertItem( _( "Custom" ) );
- dialog->papersize2CO->insertItem( _( "USletter" ) );
- dialog->papersize2CO->insertItem( _( "USlegal" ) );
- dialog->papersize2CO->insertItem( _( "USexecutive" ) );
- dialog->papersize2CO->insertItem( _( "A3" ) );
- dialog->papersize2CO->insertItem( _( "A4" ) );
- dialog->papersize2CO->insertItem( _( "A5" ) );
- dialog->papersize2CO->insertItem( _( "B3" ) );
- dialog->papersize2CO->insertItem( _( "B4" ) );
- dialog->papersize2CO->insertItem( _( "B5" ) );
-
- dialog->paperPackageCO->insertItem( _( "None" ) );
- dialog->paperPackageCO->insertItem( _( "A4 small Margins (only portrait)" ) );
- dialog->paperPackageCO->insertItem( _( "A4 very small Margins (only portrait)" ) );
- dialog->paperPackageCO->insertItem( _( "A4 very wide margins (only portrait)" ) );
-
- bc().addReadOnly (dialog->paperPackageCO);
- bc().addReadOnly (dialog->orientationBG);
- bc().addReadOnly (dialog->portraitRB);
- bc().addReadOnly (dialog->landscapeRB);
- bc().addReadOnly (dialog->papersize2CO);
- bc().addReadOnly (dialog->useGeometryCB);
- bc().addReadOnly (dialog->customWidthED);
- bc().addReadOnly (dialog->customHeightED);
- bc().addReadOnly (dialog->topMarginED);
- bc().addReadOnly (dialog->bottomMarginED);
- bc().addReadOnly (dialog->leftMarginED);
- bc().addReadOnly (dialog->rightMarginED);
- bc().addReadOnly (dialog->headHeightED);
- bc().addReadOnly (dialog->headSepED);
- bc().addReadOnly (dialog->footSkipED);
-
- // the document page
- for (LyXTextClassList::const_iterator cit = textclasslist.begin();
- cit != textclasslist.end(); ++cit)
- {
- docClassCO->insertItem( (*cit).description().c_str() );
+ int n;
+
+ // the tabbed folder
+ // PENDING(kalle) Parent???
+ dialog_.reset( new FormDocumentDialogImpl());
+
+ // Manage the restore, ok, apply, restore and cancel/close buttons
+ bc().setOK(dialog_->okPB);
+ bc().setApply(dialog_->applyPB);
+ bc().setCancel(dialog_->cancelPB);
+ bc().setRestore(dialog_->restorePB);
+ bc().refresh();
+
+ // the document paper page
+ FormDocumentDialogImpl* dialog = dialog_.get();
+ dialog->papersize2CO->insertItem( _( "Default" ) );
+ dialog->papersize2CO->insertItem( _( "Custom" ) );
+ dialog->papersize2CO->insertItem( _( "USletter" ) );
+ dialog->papersize2CO->insertItem( _( "USlegal" ) );
+ dialog->papersize2CO->insertItem( _( "USexecutive" ) );
+ dialog->papersize2CO->insertItem( _( "A3" ) );
+ dialog->papersize2CO->insertItem( _( "A4" ) );
+ dialog->papersize2CO->insertItem( _( "A5" ) );
+ dialog->papersize2CO->insertItem( _( "B3" ) );
+ dialog->papersize2CO->insertItem( _( "B4" ) );
+ dialog->papersize2CO->insertItem( _( "B5" ) );
+
+ dialog->paperPackageCO->insertItem( _( "None" ) );
+ dialog->paperPackageCO->insertItem( _( "A4 small Margins (only portrait)" ) );
+ dialog->paperPackageCO->insertItem( _( "A4 very small Margins (only portrait)" ) );
+ dialog->paperPackageCO->insertItem( _( "A4 very wide margins (only portrait)" ) );
+
+ bc().addReadOnly (dialog->paperPackageCO);
+ bc().addReadOnly (dialog->orientationBG);
+ bc().addReadOnly (dialog->portraitRB);
+ bc().addReadOnly (dialog->landscapeRB);
+ bc().addReadOnly (dialog->papersize2CO);
+ bc().addReadOnly (dialog->useGeometryCB);
+ bc().addReadOnly (dialog->customWidthED);
+ bc().addReadOnly (dialog->customHeightED);
+ bc().addReadOnly (dialog->topMarginED);
+ bc().addReadOnly (dialog->bottomMarginED);
+ bc().addReadOnly (dialog->leftMarginED);
+ bc().addReadOnly (dialog->rightMarginED);
+ bc().addReadOnly (dialog->headHeightED);
+ bc().addReadOnly (dialog->headSepED);
+ bc().addReadOnly (dialog->footSkipED);
+
+ // the document page
+ for (LyXTextClassList::const_iterator cit = textclasslist.begin();
+ cit != textclasslist.end(); ++cit) {
+ docClassCO->insertItem( (*cit).description().c_str() );
}
- dialog->docSpacingCO->insertItem( _( "Single" ) );
- dialog->docSpacingCO->insertItem( _( "OneHalf" ) );
- dialog->docSpacingCO->insertItem( _( "Double" ) );
- dialog->docSpacingCO->insertItem( _( "Other" ) );
-
- dialog->docFontSizeCO->insertItem( _( "default" ) );
- dialog->docFontSizeCO->insertItem( _( "10" ) );
- dialog->docFontSizeCO->insertItem( _( "11" ) );
- dialog->docFontSizeCO->insertItem( _( "12" ) );
- for (n=0; tex_fonts[n][0]; ++n) {
- dialog->docFontsCO->insertItem( tex_fonts[n] );
- }
-
- dialog->docPagestyleCO->insertItem( _( "default" ) );
- dialog->docPagestyleCO->insertItem( _( "empty" ) );
- dialog->docPagestyleCO->insertItem( _( "plain" ) );
- dialog->docPagestyleCO->insertItem( _( "headings" ) );
- dialog->docPagestyleCO->insertItem( _( "fancy" ) );
-
- dialog->docSkipCO->insertItem( _( "Smallskip" ) );
- dialog->docSkipCO->insertItem( _( "Medskip" ) );
- dialog->docSkipCO->insertItem( _( "Bigskip" ) );
- dialog->docSkipCO->insertItem( _( "Length" ) );
-
- bc().addReadOnly (dialog->docIndentRB);
- bc().addReadOnly (dialog->docSkipRB);
-
- bc().addReadOnly (dialog->docPagestyleCO);
- bc().addReadOnly (dialog->docFontsCO);
- bc().addReadOnly (dialog->docFontsizeCO);
- bc().addReadOnly (dialog->docSidesOneRB);
- bc().addReadOnly (dialog->docSidesTwoRB);
- bc().addReadOnly (dialog->docColumnsOneRB);
- bc().addReadOnly (dialog->docColumnsTwoRB);
- bc().addReadOnly (dialog->docExtraED);
- bc().addReadOnly (dialog->docSkipED);
- bc().addReadOnly (dialog->docSkipCO);
- bc().addReadOnly (dialog->docSpacingCO);
- bc().addReadOnly (dialog->docSpacingED);
-
- // the document language page
- dialog->inputEncCO->insertItem( _( "default" ) );
- dialog->inputEncCO->insertItem( _( "auto" ) );
- dialog->inputEncCO->insertItem( _( "latin1" ) );
- dialog->inputEncCO->insertItem( _( "latin2" ) );
- dialog->inputEncCO->insertItem( _( "latin5" ) );
- dialog->inputEncCO->insertItem( _( "latin9" ) );
- dialog->inputEncCO->insertItem( _( "koi8-r" ) );
- dialog->inputEncCO->insertItem( _( "koi8-u" ) );
- dialog->inputEncCO->insertItem( _( "cp866" ) );
- dialog->inputEncCO->insertItem( _( "cp1251" ) );
- dialog->inputEncCO->insertItem( _( "iso88595" ) );
-
- for (Languages::const_iterator cit = languages.begin();
+ dialog->docSpacingCO->insertItem( _( "Single" ) );
+ dialog->docSpacingCO->insertItem( _( "OneHalf" ) );
+ dialog->docSpacingCO->insertItem( _( "Double" ) );
+ dialog->docSpacingCO->insertItem( _( "Other" ) );
+
+ dialog->docFontSizeCO->insertItem( _( "default" ) );
+ dialog->docFontSizeCO->insertItem( _( "10" ) );
+ dialog->docFontSizeCO->insertItem( _( "11" ) );
+ dialog->docFontSizeCO->insertItem( _( "12" ) );
+ for (n=0; tex_fonts[n][0]; ++n) {
+ dialog->docFontsCO->insertItem( tex_fonts[n] );
+ }
+
+ dialog->docPagestyleCO->insertItem( _( "default" ) );
+ dialog->docPagestyleCO->insertItem( _( "empty" ) );
+ dialog->docPagestyleCO->insertItem( _( "plain" ) );
+ dialog->docPagestyleCO->insertItem( _( "headings" ) );
+ dialog->docPagestyleCO->insertItem( _( "fancy" ) );
+
+ dialog->docSkipCO->insertItem( _( "Smallskip" ) );
+ dialog->docSkipCO->insertItem( _( "Medskip" ) );
+ dialog->docSkipCO->insertItem( _( "Bigskip" ) );
+ dialog->docSkipCO->insertItem( _( "Length" ) );
+
+ bc().addReadOnly (dialog->docIndentRB);
+ bc().addReadOnly (dialog->docSkipRB);
+
+ bc().addReadOnly (dialog->docPagestyleCO);
+ bc().addReadOnly (dialog->docFontsCO);
+ bc().addReadOnly (dialog->docFontsizeCO);
+ bc().addReadOnly (dialog->docSidesOneRB);
+ bc().addReadOnly (dialog->docSidesTwoRB);
+ bc().addReadOnly (dialog->docColumnsOneRB);
+ bc().addReadOnly (dialog->docColumnsTwoRB);
+ bc().addReadOnly (dialog->docExtraED);
+ bc().addReadOnly (dialog->docSkipED);
+ bc().addReadOnly (dialog->docSkipCO);
+ bc().addReadOnly (dialog->docSpacingCO);
+ bc().addReadOnly (dialog->docSpacingED);
+
+ // the document language page
+ dialog->inputEncCO->insertItem( _( "default" ) );
+ dialog->inputEncCO->insertItem( _( "auto" ) );
+ dialog->inputEncCO->insertItem( _( "latin1" ) );
+ dialog->inputEncCO->insertItem( _( "latin2" ) );
+ dialog->inputEncCO->insertItem( _( "latin5" ) );
+ dialog->inputEncCO->insertItem( _( "latin9" ) );
+ dialog->inputEncCO->insertItem( _( "koi8-r" ) );
+ dialog->inputEncCO->insertItem( _( "koi8-u" ) );
+ dialog->inputEncCO->insertItem( _( "cp866" ) );
+ dialog->inputEncCO->insertItem( _( "cp1251" ) );
+ dialog->inputEncCO->insertItem( _( "iso88595" ) );
+
+ for (Languages::const_iterator cit = languages.begin();
cit != languages.end(); ++cit) {
- dialog->languageCO->insertItem( (*cit).second.lang() );
- }
-
- dialog->quotesLanguageCO->insertItem( _( "``text''" ) );
- dialog->quotesLanguageCO->insertItem( _( "''text''" ) );
- dialog->quotesLanguageCO->insertItem( _( ",,text``" ) );
- dialog->quotesLanguageCO->insertItem( _( ",,text''" ) );
- dialog->quotesLanguageCO->insertItem( _( "«text»" ) );
- dialog->quotesLanguageCO->insertItem( _( "»text«" ) );
-
- bc().addReadOnly (dialog->inputEncCO);
-
- // the document options page
- dialog->secNumDepthSB->setRange( -2, 5 );
- dialog->tocDepthSB->setRange( -1, 5 );
- dialog->secNumDepthSB->setSteps( 1, 1 );
- dialog->tocDepthSB->setRange( 1, 1 );
- for (n=0; tex_graphics[n][0]; ++n) {
- dialog->postscriptDriverCO->insertItem( tex_graphics[n] );
- }
-
- bc().addReadOnly (dialog->secNumDepthSB);
- bc().addReadOnly (dialog->tocDepthSB);
- bc().addReadOnly (dialog->useAmsMathCB);
- bc().addReadOnly (dialog->floatPlacementED);
- bc().addReadOnly (dialog->postscriptDriverCO);
-
- // the document bullets page
- dialog->bulletSizeCO->insertItem( _( "default" ) );
- dialog->bulletSizeCO->insertItem( _( "tiny" ) );
- dialog->bulletSizeCO->insertItem( _( "script" ) );
- dialog->bulletSizeCO->insertItem( _( "footnote" ) );
- dialog->bulletSizeCO->insertItem( _( "small" ) );
- dialog->bulletSizeCO->insertItem( _( "normal" ) );
- dialog->bulletSizeCO->insertItem( _( "large" ) );
- dialog->bulletSizeCO->insertItem( _( "Large" ) );
- dialog->bulletSizeCO->insertItem( _( "LARGE" ) );
- dialog->bulletSizeCO->insertItem( _( "huge" ) );
- dialog->bulletSizeCO->insertItem( _( "Huge" ) );
-
- dialog->bulletSizeCO->setCurrentItem( 0 );
- dialog->bulletLatexED->setMaxLength( 80 );
-
- bc().addReadOnly (dialog->bulletPanelBG);
- bc().addReadOnly (dialog->bulletSizeCO);
- bc().addReadOnly (dialog->bulletLatexED);
+ dialog->languageCO->insertItem( (*cit).second.lang() );
+ }
+
+ dialog->quotesLanguageCO->insertItem( _( "``text''" ) );
+ dialog->quotesLanguageCO->insertItem( _( "''text''" ) );
+ dialog->quotesLanguageCO->insertItem( _( ",,text``" ) );
+ dialog->quotesLanguageCO->insertItem( _( ",,text''" ) );
+ dialog->quotesLanguageCO->insertItem( _( "«text»" ) );
+ dialog->quotesLanguageCO->insertItem( _( "»text«" ) );
+
+ bc().addReadOnly (dialog->inputEncCO);
+
+ // the document options page
+ dialog->secNumDepthSB->setRange( -2, 5 );
+ dialog->tocDepthSB->setRange( -1, 5 );
+ dialog->secNumDepthSB->setSteps( 1, 1 );
+ dialog->tocDepthSB->setRange( 1, 1 );
+ for (n=0; tex_graphics[n][0]; ++n) {
+ dialog->postscriptDriverCO->insertItem( tex_graphics[n] );
+ }
+
+ bc().addReadOnly (dialog->secNumDepthSB);
+ bc().addReadOnly (dialog->tocDepthSB);
+ bc().addReadOnly (dialog->useAmsMathCB);
+ bc().addReadOnly (dialog->floatPlacementED);
+ bc().addReadOnly (dialog->postscriptDriverCO);
+
+ // the document bullets page
+ dialog->bulletSizeCO->insertItem( _( "default" ) );
+ dialog->bulletSizeCO->insertItem( _( "tiny" ) );
+ dialog->bulletSizeCO->insertItem( _( "script" ) );
+ dialog->bulletSizeCO->insertItem( _( "footnote" ) );
+ dialog->bulletSizeCO->insertItem( _( "small" ) );
+ dialog->bulletSizeCO->insertItem( _( "normal" ) );
+ dialog->bulletSizeCO->insertItem( _( "large" ) );
+ dialog->bulletSizeCO->insertItem( _( "Large" ) );
+ dialog->bulletSizeCO->insertItem( _( "LARGE" ) );
+ dialog->bulletSizeCO->insertItem( _( "huge" ) );
+ dialog->bulletSizeCO->insertItem( _( "Huge" ) );
+
+ dialog->bulletSizeCO->setCurrentItem( 0 );
+ dialog->bulletLatexED->setMaxLength( 80 );
+
+ bc().addReadOnly (dialog->bulletPanelBG);
+ bc().addReadOnly (dialog->bulletSizeCO);
+ bc().addReadOnly (dialog->bulletLatexED);
}
void FormDocument::apply()
{
- if (!lv_->view()->available() || !dialog_.get())
- return;
-
- bool redo = class_apply();
- paper_apply();
- redo = language_apply() || redo;
- redo = options_apply() || redo;
- bullets_apply();
-
- if (redo) {
- lv_->view()->redoCurrentBuffer();
- }
- lv_->buffer()->markDirty();
- setMinibuffer(lv_, _("Document layout set"));
+ if (!lv_->view()->available() || !dialog_.get())
+ return;
+
+ bool redo = class_apply();
+ paper_apply();
+ redo = language_apply() || redo;
+ redo = options_apply() || redo;
+ bullets_apply();
+
+ if (redo) {
+ lv_->view()->redoCurrentBuffer();
+ }
+ lv_->buffer()->markDirty();
+ setMinibuffer(lv_, _("Document layout set"));
}
void FormDocument::cancel()
{
- // this avoids confusion when reopening
- BufferParams & param = lv_->buffer()->params;
- param.temp_bullets[0] = param.user_defined_bullets[0];
- param.temp_bullets[1] = param.user_defined_bullets[1];
- param.temp_bullets[2] = param.user_defined_bullets[2];
- param.temp_bullets[3] = param.user_defined_bullets[3];
- hide();
+ // this avoids confusion when reopening
+ BufferParams & param = lv_->buffer()->params;
+ param.temp_bullets[0] = param.user_defined_bullets[0];
+ param.temp_bullets[1] = param.user_defined_bullets[1];
+ param.temp_bullets[2] = param.user_defined_bullets[2];
+ param.temp_bullets[3] = param.user_defined_bullets[3];
+ hide();
}
void FormDocument::update()
{
- if (!dialog_.get())
- return;
+ if (!dialog_.get())
+ return;
- checkReadOnly();
+ checkReadOnly();
- BufferParams const & params = lv_->buffer()->params;
+ BufferParams const & params = lv_->buffer()->params;
- class_update(params);
- paper_update(params);
- language_update(params);
- options_update(params);
- bullets_update(params);
+ class_update(params);
+ paper_update(params);
+ language_update(params);
+ options_update(params);
+ bullets_update(params);
}
#ifdef K
bool FormDocument::input( FL_OBJECT * ob, long data )
{
- State cb = static_cast<State>( data );
-
- switch (cb) {
- case CHECKCHOICECLASS:
- CheckChoiceClass(ob, 0);
- break;
- case CHOICEBULLETSIZE:
- ChoiceBulletSize(ob, 0);
- break;
- case INPUTBULLETLATEX:
- InputBulletLaTeX(ob, 0);
- break;
- case BULLETDEPTH1:
- case BULLETDEPTH2:
- case BULLETDEPTH3:
- case BULLETDEPTH4:
- BulletDepth(ob, cb);
- break;
- case BULLETPANEL1:
- case BULLETPANEL2:
- case BULLETPANEL3:
- case BULLETPANEL4:
- case BULLETPANEL5:
- case BULLETPANEL6:
- BulletPanel(ob, cb);
- break;
- case BULLETBMTABLE:
- BulletBMTable(ob, 0);
- break;
- default:
- break;
- }
-
- switch (data) {
- case INPUT:
- case CHECKCHOICECLASS:
- case CHOICEBULLETSIZE:
- case INPUTBULLETLATEX:
- case BULLETBMTABLE:
- return CheckDocumentInput(ob, 0);
- default:
- break;
- }
-
- return true;
+ State cb = static_cast<State>( data );
+
+ switch (cb) {
+ case CHECKCHOICECLASS:
+ CheckChoiceClass(ob, 0);
+ break;
+ case CHOICEBULLETSIZE:
+ ChoiceBulletSize(ob, 0);
+ break;
+ case INPUTBULLETLATEX:
+ InputBulletLaTeX(ob, 0);
+ break;
+ case BULLETDEPTH1:
+ case BULLETDEPTH2:
+ case BULLETDEPTH3:
+ case BULLETDEPTH4:
+ BulletDepth(ob, cb);
+ break;
+ case BULLETPANEL1:
+ case BULLETPANEL2:
+ case BULLETPANEL3:
+ case BULLETPANEL4:
+ case BULLETPANEL5:
+ case BULLETPANEL6:
+ BulletPanel(ob, cb);
+ break;
+ case BULLETBMTABLE:
+ BulletBMTable(ob, 0);
+ break;
+ default:
+ break;
+ }
+
+ switch (data) {
+ case INPUT:
+ case CHECKCHOICECLASS:
+ case CHOICEBULLETSIZE:
+ case INPUTBULLETLATEX:
+ case BULLETBMTABLE:
+ return CheckDocumentInput(ob, 0);
+ default:
+ break;
+ }
+
+ return true;
}
#endif
+// FIXME: "K" ???
#ifdef K
void FormDocument::ComboInputCB(int, void * v, Combox * combox)
{
- FormDocument * pre = static_cast<FormDocument*>(v);
- if (combox == pre->combo_doc_class.get())
- pre->CheckChoiceClass(0, 0);
- pre->bc().valid(pre->CheckDocumentInput(0,0));
+ FormDocument * pre = static_cast<FormDocument*>(v);
+ if (combox == pre->combo_doc_class.get())
+ pre->CheckChoiceClass(0, 0);
+ pre->bc().valid(pre->CheckDocumentInput(0,0));
}
#endif
bool FormDocument::class_apply()
{
- bool redo = false;
- BufferParams ¶ms = lv_->buffer()->params;
-
- // If default skip is a "Length" but there's no text in the
- // input field, reset the kind to "Medskip", which is the default.
- if( ( dialog_->docSkipCO->currentItem() == 3 ) &&
- dialog_->docSkipED->text().isEmpty() )
- dialog_->docSkipCO->setCurrentItem( 1 );
-
- params.fonts = dialog_->docFontsCO->currentText();
- params.fontsize = dialog_->docFontSizeCO->currentText();
- params.pagestyle = dialog->docPagestyleCO->currentText();
-
- unsigned int const new_class = dialog_->docClassCO->currentItem();
-
- if (params.textclass != new_class) {
- // try to load new_class
- if (textclasslist.Load(new_class)) {
- // successfully loaded
- redo = true;
- setMinibuffer(lv_, _("Converting document to new document class..."));
- CutAndPaste cap;
- int ret = cap.SwitchLayoutsBetweenClasses(
- params.textclass, new_class,
- lv_->buffer()->paragraph);
- if (ret) {
- string s;
- if (ret==1) {
- s = _("One paragraph couldn't be converted");
+ bool redo = false;
+ BufferParams ¶ms = lv_->buffer()->params;
+
+ // If default skip is a "Length" but there's no text in the
+ // input field, reset the kind to "Medskip", which is the default.
+ if( ( dialog_->docSkipCO->currentItem() == 3 ) &&
+ dialog_->docSkipED->text().isEmpty() )
+ dialog_->docSkipCO->setCurrentItem( 1 );
+
+ params.fonts = dialog_->docFontsCO->currentText();
+ params.fontsize = dialog_->docFontSizeCO->currentText();
+ params.pagestyle = dialog->docPagestyleCO->currentText();
+
+ unsigned int const new_class = dialog_->docClassCO->currentItem();
+
+ if (params.textclass != new_class) {
+ // try to load new_class
+ if (textclasslist.Load(new_class)) {
+ // successfully loaded
+ redo = true;
+ setMinibuffer(lv_, _("Converting document to new document class..."));
+ CutAndPaste cap;
+ int ret = cap.SwitchLayoutsBetweenClasses(params.textclass, new_class,
+ lv_->buffer()->paragraph);
+ if (ret) {
+ string s;
+ if (ret==1) {
+ s = _("One paragraph couldn't be converted");
+ } else {
+ s += tostr(ret);
+ s += _(" paragraphs couldn't be converted");
+ }
+ WriteAlert(_("Conversion Errors!"),s,
+ _("into chosen document class"));
+ }
+
+ params.textclass = new_class;
} else {
- s += tostr(ret);
- s += _(" paragraphs couldn't be converted");
+ // problem changing class -- warn user and retain old style
+ WriteAlert(_("Conversion Errors!"),
+ _("Errors loading new document class."),
+ _("Reverting to original document class."));
+ dialog_->docClassCO->setCurrentItem( params.textclass );
}
- WriteAlert(_("Conversion Errors!"),s,
- _("into chosen document class"));
- }
-
- params.textclass = new_class;
- } else {
- // problem changing class -- warn user and retain old style
- WriteAlert(_("Conversion Errors!"),
- _("Errors loading new document class."),
- _("Reverting to original document class."));
- dialog_->docClassCO->setCurrentItem( params.textclass );
}
- }
- BufferParams::PARSEP tmpsep = params.paragraph_separation;
- if( dialog_->_docIndentRB->isChecked() )
- params.paragraph_separation = BufferParams::PARSEP_INDENT;
- else
- params.paragraph_separation = BufferParams::PARSEP_SKIP;
- if (tmpsep != params.paragraph_separation)
- redo = true;
-
- VSpace tmpdefskip = params.getDefSkip();
- switch( dialog_->docSkipCO->currentItem() ) {
- case 0:
- params.setDefSkip(VSpace(VSpace::SMALLSKIP));
- break;
- case 1:
- params.setDefSkip(VSpace(VSpace::MEDSKIP));
- break;
- case 2:
- params.setDefSkip(VSpace(VSpace::BIGSKIP));
- break;
- case 3:
- params.setDefSkip
- (VSpace(LyXGlueLength(dialog_->docSkipED->text())));
- break;
- // DocumentDefskipCB assures that this never happens
- default:
- params.setDefSkip(VSpace(VSpace::MEDSKIP));
- break;
- }
- if (!(tmpdefskip == params.getDefSkip()))
- redo = true;
-
- if( dialog_->docColumnsTwo->isChecked() )
- params.columns = 2;
- else
- params.columns = 1;
- if( dialog_->docSidesTwo->isChecked() )
- params.sides = LyXTextClass::TwoSides;
- else
- params.sides = LyXTextClass::OneSide;
-
- Spacing tmpSpacing = params.spacing;
- switch( dialog_->docSpacingCO->currentItem() ) {
- case 0:
- lyxerr[Debug::INFO] << "Spacing: SINGLE\n";
- params.spacing.set(Spacing::Single);
- break;
- case 1:
- lyxerr[Debug::INFO] << "Spacing: ONEHALF\n";
- params.spacing.set(Spacing::Onehalf);
- break;
- case 2:
- lyxerr[Debug::INFO] << "Spacing: DOUBLE\n";
- params.spacing.set(Spacing::Double);
- break;
- case 3:
- lyxerr[Debug::INFO] << "Spacing: OTHER\n";
- params.spacing.set(Spacing::Other,
- dialog_->docSpacingED->text() );
- break;
- }
- if (tmpSpacing != params.spacing)
- redo = true;
-
- params.options = docExtraED->text();
-
- return redo;
+ BufferParams::PARSEP tmpsep = params.paragraph_separation;
+ if( dialog_->_docIndentRB->isChecked() )
+ params.paragraph_separation = BufferParams::PARSEP_INDENT;
+ else
+ params.paragraph_separation = BufferParams::PARSEP_SKIP;
+ if (tmpsep != params.paragraph_separation)
+ redo = true;
+
+ VSpace tmpdefskip = params.getDefSkip();
+ switch( dialog_->docSkipCO->currentItem() ) {
+ case 0:
+ params.setDefSkip(VSpace(VSpace::SMALLSKIP));
+ break;
+ case 1:
+ params.setDefSkip(VSpace(VSpace::MEDSKIP));
+ break;
+ case 2:
+ params.setDefSkip(VSpace(VSpace::BIGSKIP));
+ break;
+ case 3:
+ params.setDefSkip
+ (VSpace(LyXGlueLength(dialog_->docSkipED->text())));
+ break;
+ // DocumentDefskipCB assures that this never happens
+ // ... so why is there code for it ?
+ default:
+ params.setDefSkip(VSpace(VSpace::MEDSKIP));
+ break;
+ }
+ if (!(tmpdefskip == params.getDefSkip()))
+ redo = true;
+
+ if( dialog_->docColumnsTwo->isChecked() )
+ params.columns = 2;
+ else
+ params.columns = 1;
+ if( dialog_->docSidesTwo->isChecked() )
+ params.sides = LyXTextClass::TwoSides;
+ else
+ params.sides = LyXTextClass::OneSide;
+
+ Spacing tmpSpacing = params.spacing;
+ switch( dialog_->docSpacingCO->currentItem() ) {
+ case 0:
+ lyxerr[Debug::INFO] << "Spacing: SINGLE\n";
+ params.spacing.set(Spacing::Single);
+ break;
+ case 1:
+ lyxerr[Debug::INFO] << "Spacing: ONEHALF\n";
+ params.spacing.set(Spacing::Onehalf);
+ break;
+ case 2:
+ lyxerr[Debug::INFO] << "Spacing: DOUBLE\n";
+ params.spacing.set(Spacing::Double);
+ break;
+ case 3:
+ lyxerr[Debug::INFO] << "Spacing: OTHER\n";
+ params.spacing.set(Spacing::Other,
+ dialog_->docSpacingED->text() );
+ break;
+ }
+ if (tmpSpacing != params.spacing)
+ redo = true;
+
+ params.options = docExtraED->text();
+
+ return redo;
}
void FormDocument::paper_apply()
{
- BufferParams & params = lv_->buffer()->params;
-
- params.papersize2 =
- static_cast<char>(dialog_->papersize2CO->currentItem());
- params.paperpackage =
- static_cast<char>(dialog_->paperPackageCO->currentItem() );
- params.use_geometry = dialog_->useGeometryCB->isChecked();
- if (dialog_->landscapeRB->isChecked() )
- params.orientation = BufferParams::ORIENTATION_LANDSCAPE;
- else
- params.orientation = BufferParams::ORIENTATION_PORTRAIT;
- params.paperwidth = dialog_->customWidthED->text();
- params.paperheight = dialog_->customHeightED->text();
- params.leftmargin = dialog_->leftMarginED->text();
- params.topmargin = dialog_->topMarginED->text();
- params.rightmargin = dialog_->rightMarginED->text();
- params.bottommargin = dialog_->bottomMarginED->text();
- params.headheight = dialog_->headHeightED->text();
- params.headsep = dialog_->headSepED->text();
- params.footskip = dialog_->footSkipED->text();
- lv_->buffer()->setPaperStuff();
+ BufferParams & params = lv_->buffer()->params;
+
+ params.papersize2 =
+ static_cast<char>(dialog_->papersize2CO->currentItem());
+ params.paperpackage =
+ static_cast<char>(dialog_->paperPackageCO->currentItem() );
+ params.use_geometry = dialog_->useGeometryCB->isChecked();
+ if (dialog_->landscapeRB->isChecked() )
+ params.orientation = BufferParams::ORIENTATION_LANDSCAPE;
+ else
+ params.orientation = BufferParams::ORIENTATION_PORTRAIT;
+ params.paperwidth = dialog_->customWidthED->text();
+ params.paperheight = dialog_->customHeightED->text();
+ params.leftmargin = dialog_->leftMarginED->text();
+ params.topmargin = dialog_->topMarginED->text();
+ params.rightmargin = dialog_->rightMarginED->text();
+ params.bottommargin = dialog_->bottomMarginED->text();
+ params.headheight = dialog_->headHeightED->text();
+ params.headsep = dialog_->headSepED->text();
+ params.footskip = dialog_->footSkipED->text();
+ lv_->buffer()->setPaperStuff();
}
bool FormDocument::language_apply()
{
- BufferParams & params = lv_->buffer()->params;
- InsetQuotes::quote_language lga = InsetQuotes::EnglishQ;
- bool redo = false;
-
- switch (dialog_->quotesLanguageCO->currentItem() ) {
- case 0:
- lga = InsetQuotes::EnglishQ;
- break;
- case 1:
- lga = InsetQuotes::SwedishQ;
- break;
- case 2:
- lga = InsetQuotes::GermanQ;
- break;
- case 3:
- lga = InsetQuotes::PolishQ;
- break;
- case 4:
- lga = InsetQuotes::FrenchQ;
- break;
- case 5:
- lga = InsetQuotes::DanishQ;
- break;
- }
- params.quotes_language = lga;
- if (dialog_->singleRB->isChecked() )
- params.quotes_times = InsetQuotes::SingleQ;
- else
- params.quotes_times = InsetQuotes::DoubleQ;
-
- Language const * old_language = params.language;
- Language const * new_language =
+ BufferParams & params = lv_->buffer()->params;
+ InsetQuotes::quote_language lga = InsetQuotes::EnglishQ;
+ bool redo = false;
+
+ switch (dialog_->quotesLanguageCO->currentItem() ) {
+ case 0:
+ lga = InsetQuotes::EnglishQ;
+ break;
+ case 1:
+ lga = InsetQuotes::SwedishQ;
+ break;
+ case 2:
+ lga = InsetQuotes::GermanQ;
+ break;
+ case 3:
+ lga = InsetQuotes::PolishQ;
+ break;
+ case 4:
+ lga = InsetQuotes::FrenchQ;
+ break;
+ case 5:
+ lga = InsetQuotes::DanishQ;
+ break;
+ }
+ params.quotes_language = lga;
+ if (dialog_->singleRB->isChecked() )
+ params.quotes_times = InsetQuotes::SingleQ;
+ else
+ params.quotes_times = InsetQuotes::DoubleQ;
+
+ Language const * old_language = params.language;
+ Language const * new_language =
languages.getLanguage(dialog_->languageCO->currentItem() );
- if (!new_language)
- new_language = default_language;
-
- if (old_language != new_language
- && old_language->RightToLeft() == new_language->RightToLeft()
- && !lv_->buffer()->isMultiLingual())
- lv_->buffer()->ChangeLanguage(old_language, new_language);
- if (old_language != new_language) {
- redo = true;
- }
- params.language = new_language;
- params.inputenc = dialog_->inputEncCO->currentText();
-
- return redo;
+ if (!new_language)
+ new_language = default_language;
+
+ if (old_language != new_language
+ && old_language->RightToLeft() == new_language->RightToLeft()
+ && !lv_->buffer()->isMultiLingual())
+ lv_->buffer()->ChangeLanguage(old_language, new_language);
+
+ if (old_language != new_language)
+ redo = true;
+
+ params.language = new_language;
+ params.inputenc = dialog_->inputEncCO->currentText();
+
+ return redo;
}
bool FormDocument::options_apply()
{
- BufferParams & params = lv_->buffer()->params;
- bool redo = false;
+ BufferParams & params = lv_->buffer()->params;
+ bool redo = false;
- params.graphicsDriver =
- dialog_->postscriptDriverCO->currentText();
- params.use_amsmath = dialog_->useAmsMathCB->isChecked();
+ params.graphicsDriver =
+ dialog_->postscriptDriverCO->currentText();
+ params.use_amsmath = dialog_->useAmsMathCB->isChecked();
- int tmpchar = int(dialog_->secNumDepth->value() );
- if (params.secnumdepth != tmpchar)
- redo = true;
- params.secnumdepth = tmpchar;
+ int tmpchar = int(dialog_->secNumDepth->value() );
+ if (params.secnumdepth != tmpchar)
+ redo = true;
+ params.secnumdepth = tmpchar;
- params.tocdepth = int(dialog_->tocDepth->value() );
+ params.tocdepth = int(dialog_->tocDepth->value() );
- params.float_placement =
- dialog_->floatPlacementED->text();
+ params.float_placement =
+ dialog_->floatPlacementED->text();
- return redo;
+ return redo;
}
void FormDocument::bullets_apply()
{
- /* update the bullet settings */
- BufferParams & param = lv_->buffer()->params;
-
- // a little bit of loop unrolling
- param.user_defined_bullets[0] = param.temp_bullets[0];
- param.user_defined_bullets[1] = param.temp_bullets[1];
- param.user_defined_bullets[2] = param.temp_bullets[2];
- param.user_defined_bullets[3] = param.temp_bullets[3];
+ /* update the bullet settings */
+ BufferParams & param = lv_->buffer()->params;
+
+ // a little bit of loop unrolling
+ param.user_defined_bullets[0] = param.temp_bullets[0];
+ param.user_defined_bullets[1] = param.temp_bullets[1];
+ param.user_defined_bullets[2] = param.temp_bullets[2];
+ param.user_defined_bullets[3] = param.temp_bullets[3];
}
void FormDocument::class_update(BufferParams const & params)
{
- if (!class_.get())
- return;
+ if (!class_.get())
+ return;
- LyXTextClass const & tclass = textclasslist.TextClass(params.textclass);
+ LyXTextClass const & tclass = textclasslist.TextClass(params.textclass);
- combo_doc_class->select_text(
+ combo_doc_class->select_text(
textclasslist.DescOfClass(params.textclass));
- Qt2Helper::setCurrentComboItem( dialog_->docFonts, params.fonts.c_str() );
- dialog_->docFontSizeCO->clear();
- dialog_->docFontSizeCO->insertItem( _( "default" ) );
- dialog_->docFontSizeCO->insertItem( tclass.opt_fontsize().c_str());
- dialog_->docFontSizeCO->setCurrentItem( tokenPos(tclass.opt_fontsize(), '|', params.fontsize)+1);
- dialog_->docPagestyleCO->clear();
- dialog_->docPagestyleCO->insertItem( _( "default" ) );
- dialog_->docPagestyleCO->insertItem( tclass.opt_pagestyle().c_str());
- dialog_->docPagestyleCO->setCurrentItem( tokenPos(tclass.opt_pagestyle(), '|', params.pagestyle)+1);
- dialog_->docIndentRB->setChecked( false );
- dialog_->docSkipRB->setChecked( false );
- if (params.paragraph_separation == BufferParams::PARSEP_INDENT)
- dialog_->docIndentRB->setChecked( true );
- else
- dialog_->docSkipRB->setChecked( true );
- switch (params.getDefSkip().kind()) {
- case VSpace::SMALLSKIP:
- dialog_->docSkipCO->setCurrentItem( 0 );
- break;
- case VSpace::MEDSKIP:
- dialog_->docSkipCO->setCurrentItem( 1 );
- break;
- case VSpace::BIGSKIP:
- dialog_->docSkipCO->setCurrentItem( 2 );
- break;
- case VSpace::LENGTH:
- dialog_->docSkipCO->setCurrentItem( 3 );
- dialog_->docSkipED->setText( params.getDefSkip().asLyXCommand().c_str());
- break;
- default:
- dialog_->docSkipCO->setCurrentItem( 1 );
- break;
- }
- dialog_->docSidesOneRB->setChecked( false );
- dialog_->docSidesTwoRB->setChecked( false );
- if (params.sides == LyXTextClass::TwoSides)
- dialog_->docSidesTwo->setChecked( true );
- else
- dialog_->docSidesOne->setChecked( true );
- dialog_->docColumnsOneRB->setChecked( false );
- dialog_->docColumnsTwoRB->setChecked( false );
- if (params.columns == 2)
- dialog_->docColumnsTwoRB->setChecked( true );
- else
- dialog_->docColumnsOneRB->setChecked( true );
- dialog_->docSpacingED->setText( "" );
- switch (params.spacing.getSpace()) {
- case Spacing::Default: // nothing bad should happen with this
- case Spacing::Single:
- // \singlespacing
- dialog_->docSpacingCO->setCurrentItem( 0 );
- break;
- case Spacing::Onehalf:
- // \onehalfspacing
- dialog_->docSpacingCO->setCurrentItem( 1 );
- break;
- case Spacing::Double:
- // \doublespacing
- dialog_->docSpacingCO->setCurrentItem( 2 );
- break;
- case Spacing::Other:
- {
- dialog_->docSpacingCO->setCurrentItem( 3 );
- QString sval;
- sval.sprintf("%g",params.spacing.getValue());
- dialog_->docSpacingED->setText( sval );
- break;
+ Qt2Helper::setCurrentComboItem( dialog_->docFonts, params.fonts.c_str() );
+ dialog_->docFontSizeCO->clear();
+ dialog_->docFontSizeCO->insertItem( _( "default" ) );
+ dialog_->docFontSizeCO->insertItem( tclass.opt_fontsize().c_str());
+ dialog_->docFontSizeCO->setCurrentItem( tokenPos(tclass.opt_fontsize(), '|', params.fontsize)+1);
+ dialog_->docPagestyleCO->clear();
+ dialog_->docPagestyleCO->insertItem( _( "default" ) );
+ dialog_->docPagestyleCO->insertItem( tclass.opt_pagestyle().c_str());
+ dialog_->docPagestyleCO->setCurrentItem( tokenPos(tclass.opt_pagestyle(), '|', params.pagestyle)+1);
+ dialog_->docIndentRB->setChecked( false );
+ dialog_->docSkipRB->setChecked( false );
+ if (params.paragraph_separation == BufferParams::PARSEP_INDENT)
+ dialog_->docIndentRB->setChecked( true );
+ else
+ dialog_->docSkipRB->setChecked( true );
+ switch (params.getDefSkip().kind()) {
+ case VSpace::SMALLSKIP:
+ dialog_->docSkipCO->setCurrentItem( 0 );
+ break;
+ case VSpace::MEDSKIP:
+ dialog_->docSkipCO->setCurrentItem( 1 );
+ break;
+ case VSpace::BIGSKIP:
+ dialog_->docSkipCO->setCurrentItem( 2 );
+ break;
+ case VSpace::LENGTH:
+ dialog_->docSkipCO->setCurrentItem( 3 );
+ dialog_->docSkipED->setText( params.getDefSkip().asLyXCommand().c_str());
+ break;
+ default:
+ dialog_->docSkipCO->setCurrentItem( 1 );
+ break;
+ }
+ dialog_->docSidesOneRB->setChecked( false );
+ dialog_->docSidesTwoRB->setChecked( false );
+ if (params.sides == LyXTextClass::TwoSides)
+ dialog_->docSidesTwo->setChecked( true );
+ else
+ dialog_->docSidesOne->setChecked( true );
+ dialog_->docColumnsOneRB->setChecked( false );
+ dialog_->docColumnsTwoRB->setChecked( false );
+ if (params.columns == 2)
+ dialog_->docColumnsTwoRB->setChecked( true );
+ else
+ dialog_->docColumnsOneRB->setChecked( true );
+ dialog_->docSpacingED->setText( "" );
+ switch (params.spacing.getSpace()) {
+ case Spacing::Default: // nothing bad should happen with this
+ case Spacing::Single:
+ // \singlespacing
+ dialog_->docSpacingCO->setCurrentItem( 0 );
+ break;
+ case Spacing::Onehalf:
+ // \onehalfspacing
+ dialog_->docSpacingCO->setCurrentItem( 1 );
+ break;
+ case Spacing::Double:
+ // \doublespacing
+ dialog_->docSpacingCO->setCurrentItem( 2 );
+ break;
+ case Spacing::Other:
+ {
+ dialog_->docSpacingCO->setCurrentItem( 3 );
+ QString sval;
+ sval.sprintf("%g",params.spacing.getValue());
+ dialog_->docSpacingED->setText( sval );
+ break;
+ }
}
- }
- if (!params.options.empty())
- dialog_->docExtraED->setText(, params.options.c_str());
- else
- dialog_->docExtraED->setText( "" );
+ if (!params.options.empty())
+ dialog_->docExtraED->setText(, params.options.c_str());
+ else
+ dialog_->docExtraED->setText( "" );
}
void FormDocument::language_update(BufferParams const & params)
{
- if (!language_.get())
- return;
-
- Qt2Helper::setCurrentItemText( dialog_->languageCO, params.language->lang() );
- Qt2Helper::setCurrentItemText( dialog_->inputEncCO, params.inputenc.c_str() );
- dialog_->quotesLanguageCO->setCurrentItem( params.quotes_language );
- dialog_->singleRB->setChecked( false );
- dialog_->doubleRB->setChecked( false );
- if (params.quotes_times == InsetQuotes::SingleQ)
- dialog_->singleRB->setChecked( true );
- else
- dialog_->doubleRB->setChecked( true );
+ if (!language_.get())
+ return;
+
+ Qt2Helper::setCurrentItemText( dialog_->languageCO, params.language->lang() );
+ Qt2Helper::setCurrentItemText( dialog_->inputEncCO, params.inputenc.c_str() );
+ dialog_->quotesLanguageCO->setCurrentItem( params.quotes_language );
+ dialog_->singleRB->setChecked( false );
+ dialog_->doubleRB->setChecked( false );
+ if (params.quotes_times == InsetQuotes::SingleQ)
+ dialog_->singleRB->setChecked( true );
+ else
+ dialog_->doubleRB->setChecked( true );
}
void FormDocument::options_update(BufferParams const & params)
{
- if (!options_.get())
- return;
+ if (!options_.get())
+ return;
- Qt2Helper::setCurrentItemText( dialog_->postscriptDriverCO,
+ Qt2Helper::setCurrentItemText( dialog_->postscriptDriverCO,
params.graphicsDriver.c_str());
- dialog_->useAmsMathCB->setChecked( params.use_amsmath );
- dialog_->secNumDepthSB->setValue( params.secnumdepth );
- dialog_->setTocDepthSB->setValue( params.tocdepth );
- if (!params.float_placement.empty())
- dialog_->floatPlacementED->setText( params.float_placement.c_str());
- else
- dialog_->floatPlacementED->setText( "" );
+ dialog_->useAmsMathCB->setChecked( params.use_amsmath );
+ dialog_->secNumDepthSB->setValue( params.secnumdepth );
+ dialog_->setTocDepthSB->setValue( params.tocdepth );
+ if (!params.float_placement.empty())
+ dialog_->floatPlacementED->setText( params.float_placement.c_str());
+ else
+ dialog_->floatPlacementED->setText( "" );
}
void FormDocument::paper_update(BufferParams const & params)
{
- if (!paper_.get())
- return;
-
- dialog_->papersize2CO->setCurrentItem( params.papersize2 );
- dialog_->paperPackageCO->setCurrentItem( params.paperpackage );
- dialog_->useGeometryCB->setChecked( params.use_geometry );
- dialog_->portraitRB->setChecked( false );
- dialog_->landscapeRB->setChecked( false );
- if (params.orientation == BufferParams::ORIENTATION_LANDSCAPE)
- dialog_->landscapeRB->setChecked( true );
- else
- dialog_->portraitRB->setChecked( true );
- dialog_->customWidthED->setText( params.paperwidth.c_str());
- dialog_->customHeightED->setText( params.paperheight.c_str());
- dialog_->leftMarginED->setText( params.leftmargin.c_str());
- dialog_->topMarginED->setText( params.topmargin.c_str());
- dialog_->rightMarginED->setText( params.rightmargin.c_str());
- dialog_->bottomMarginED->setText( params.bottommargin.c_str());
- dialog_->headHeightED->setText( params.headheight.c_str());
- dialog_->headSepED->setText( params.headsep.c_str());
- dialog_->footSkipED->setText( params.footskip.c_str());
- dialog_->papersize2CO->setFocus();
+ if (!paper_.get())
+ return;
+
+ dialog_->papersize2CO->setCurrentItem( params.papersize2 );
+ dialog_->paperPackageCO->setCurrentItem( params.paperpackage );
+ dialog_->useGeometryCB->setChecked( params.use_geometry );
+ dialog_->portraitRB->setChecked( false );
+ dialog_->landscapeRB->setChecked( false );
+ if (params.orientation == BufferParams::ORIENTATION_LANDSCAPE)
+ dialog_->landscapeRB->setChecked( true );
+ else
+ dialog_->portraitRB->setChecked( true );
+ dialog_->customWidthED->setText( params.paperwidth.c_str());
+ dialog_->customHeightED->setText( params.paperheight.c_str());
+ dialog_->leftMarginED->setText( params.leftmargin.c_str());
+ dialog_->topMarginED->setText( params.topmargin.c_str());
+ dialog_->rightMarginED->setText( params.rightmargin.c_str());
+ dialog_->bottomMarginED->setText( params.bottommargin.c_str());
+ dialog_->headHeightED->setText( params.headheight.c_str());
+ dialog_->headSepED->setText( params.headsep.c_str());
+ dialog_->footSkipED->setText( params.footskip.c_str());
+ dialog_->papersize2CO->setFocus();
}
void FormDocument::bullets_update(BufferParams const & params)
{
- bool const isLinuxDoc = lv_->buffer()->isLinuxDoc();
- setEnabled(fbullet, !isLinuxDoc);
+ bool const isLinuxDoc = lv_->buffer()->isLinuxDoc();
+ setEnabled(fbullet, !isLinuxDoc);
- if (isLinuxDoc) return;
+ if (isLinuxDoc) return;
- dialog_->bulletDepth1RB->setChecked( true );
- dialog_->bulletLatexED->setText( params.user_defined_bullets[0].getText().c_str());
- dialog_->bulletSizeCO->setCurrentItem( params.user_defined_bullets[0].getSize() + 1);
+ dialog_->bulletDepth1RB->setChecked( true );
+ dialog_->bulletLatexED->setText( params.user_defined_bullets[0].getText().c_str());
+ dialog_->bulletSizeCO->setCurrentItem( params.user_defined_bullets[0].getSize() + 1);
}
void FormDocument::checkReadOnly()
{
- if (bc().readOnly(lv_->buffer()->isReadonly())) {
- dialog_->docClassCO->setEnabled( false );
- dialog_->languageCO->setEnabled( false );
- dialog_->warningLA->setText( _("Document is read-only."
- " No changes to layout permitted."));
- dialog_->warningLA->show();
- } else {
- dialog_->docClassCO->setEnabled( true );
- dialog_->languageCO->setEnabled( true );
- dialog_->warningLA->hide();
- }
+ if (bc().readOnly(lv_->buffer()->isReadonly())) {
+ dialog_->docClassCO->setEnabled( false );
+ dialog_->languageCO->setEnabled( false );
+ dialog_->warningLA->setText( _("Document is read-only."
+ " No changes to layout permitted."));
+ dialog_->warningLA->show();
+ } else {
+ dialog_->docClassCO->setEnabled( true );
+ dialog_->languageCO->setEnabled( true );
+ dialog_->warningLA->hide();
+ }
}
void FormDocument::checkMarginValues()
{
- bool const not_empty =
- !dialog_->topMarginED->text().isEmpty() ||
- !dialog_->bottomMarginED->text().isEmpty() ||
- !dialog_->leftMarginED->text().isEmpty() ||
- !dialog_->rightMarginED->text().isEmpty() ||
- !dialog_->headHeightED->text().isEmpty() ||
- !dialog_->headSepED->text().isEmpty() ||
- !dialog_->footSkipED->text().isEmpty() ||
- !dialog_->customWidthED->text().isEmpty() ||
- !dialog_->customHeightED->text().isEmpty();
- if (not_empty)
- dialog_->useGeometryCB->setChecked( true );
+ bool const not_empty =
+ !dialog_->topMarginED->text().isEmpty() ||
+ !dialog_->bottomMarginED->text().isEmpty() ||
+ !dialog_->leftMarginED->text().isEmpty() ||
+ !dialog_->rightMarginED->text().isEmpty() ||
+ !dialog_->headHeightED->text().isEmpty() ||
+ !dialog_->headSepED->text().isEmpty() ||
+ !dialog_->footSkipED->text().isEmpty() ||
+ !dialog_->customWidthED->text().isEmpty() ||
+ !dialog_->customHeightED->text().isEmpty();
+ if (not_empty)
+ dialog_->useGeometryCB->setChecked( true );
}
#ifdef K
bool FormDocument::CheckDocumentInput(FL_OBJECT * ob, long)
{
- string str;
- int val;
- bool ok = true;
- char const * input;
-
- checkMarginValues();
- if (ob == paper_->choice_papersize2) {
- val = fl_get_choice(paper_->choice_papersize2)-1;
- if (val == BufferParams::VM_PAPER_DEFAULT) {
- fl_set_button(paper_->push_use_geometry, 0);
- checkMarginValues();
- } else {
- if ((val != BufferParams::VM_PAPER_USLETTER) &&
- (val != BufferParams::VM_PAPER_USLEGAL) &&
- (val != BufferParams::VM_PAPER_USEXECUTIVE) &&
- (val != BufferParams::VM_PAPER_A4) &&
- (val != BufferParams::VM_PAPER_A5) &&
- (val != BufferParams::VM_PAPER_B5)) {
- fl_set_button(paper_->push_use_geometry, 1);
- }
- fl_set_choice(paper_->choice_paperpackage,
- BufferParams::PACKAGE_NONE + 1);
- }
- } else if (ob == paper_->choice_paperpackage) {
- val = fl_get_choice(paper_->choice_paperpackage)-1;
- if (val != BufferParams::PACKAGE_NONE) {
- fl_set_choice(paper_->choice_papersize2,
- BufferParams::VM_PAPER_DEFAULT + 1);
- fl_set_button(paper_->push_use_geometry, 0);
- }
- } else if (ob == class_->input_doc_spacing) {
- input = fl_get_input(class_->input_doc_spacing);
- if (!*input) {
- fl_set_choice (class_->choice_doc_spacing, 1);
- } else {
- fl_set_choice(class_->choice_doc_spacing, 4);
+ string str;
+ int val;
+ bool ok = true;
+ char const * input;
+
+ checkMarginValues();
+ if (ob == paper_->choice_papersize2) {
+ val = fl_get_choice(paper_->choice_papersize2)-1;
+ if (val == BufferParams::VM_PAPER_DEFAULT) {
+ fl_set_button(paper_->push_use_geometry, 0);
+ checkMarginValues();
+ } else {
+ if ((val != BufferParams::VM_PAPER_USLETTER) &&
+ (val != BufferParams::VM_PAPER_USLEGAL) &&
+ (val != BufferParams::VM_PAPER_USEXECUTIVE) &&
+ (val != BufferParams::VM_PAPER_A4) &&
+ (val != BufferParams::VM_PAPER_A5) &&
+ (val != BufferParams::VM_PAPER_B5)) {
+ fl_set_button(paper_->push_use_geometry, 1);
+ }
+ fl_set_choice(paper_->choice_paperpackage,
+ BufferParams::PACKAGE_NONE + 1);
+ }
+ } else if (ob == paper_->choice_paperpackage) {
+ val = fl_get_choice(paper_->choice_paperpackage)-1;
+ if (val != BufferParams::PACKAGE_NONE) {
+ fl_set_choice(paper_->choice_papersize2,
+ BufferParams::VM_PAPER_DEFAULT + 1);
+ fl_set_button(paper_->push_use_geometry, 0);
+ }
+ } else if (ob == class_->input_doc_spacing) {
+ input = fl_get_input(class_->input_doc_spacing);
+ if (!*input) {
+ fl_set_choice (class_->choice_doc_spacing, 1);
+ } else {
+ fl_set_choice(class_->choice_doc_spacing, 4);
+ }
}
- }
- // this has to be all out of if/elseif because it has to deactivate
- // the document buttons and so the whole stuff has to be tested again.
- str = fl_get_input(paper_->input_custom_width);
- ok = ok && (str.empty() || isValidLength(str));
- str = fl_get_input(paper_->input_custom_height);
- ok = ok && (str.empty() || isValidLength(str));
- str = fl_get_input(paper_->input_left_margin);
- ok = ok && (str.empty() || isValidLength(str));
- str = fl_get_input(paper_->input_right_margin);
- ok = ok && (str.empty() || isValidLength(str));
- str = fl_get_input(paper_->input_top_margin);
- ok = ok && (str.empty() || isValidLength(str));
- str = fl_get_input(paper_->input_bottom_margin);
- ok = ok && (str.empty() || isValidLength(str));
- str = fl_get_input(paper_->input_head_height);
- ok = ok && (str.empty() || isValidLength(str));
- str = fl_get_input(paper_->input_head_sep);
- ok = ok && (str.empty() || isValidLength(str));
- str = fl_get_input(paper_->input_foot_skip);
- ok = ok && (str.empty() || isValidLength(str));
- // "Synchronize" the choice and the input field, so that it
- // is impossible to commit senseless data.
- input = fl_get_input (class_->input_doc_skip);
- if (ob == class_->input_doc_skip) {
- if (!*input) {
- fl_set_choice (class_->choice_doc_skip, 2);
- } else if (isValidGlueLength (input)) {
- fl_set_choice (class_->choice_doc_skip, 4);
+ // this has to be all out of if/elseif because it has to deactivate
+ // the document buttons and so the whole stuff has to be tested again.
+ str = fl_get_input(paper_->input_custom_width);
+ ok = ok && (str.empty() || isValidLength(str));
+ str = fl_get_input(paper_->input_custom_height);
+ ok = ok && (str.empty() || isValidLength(str));
+ str = fl_get_input(paper_->input_left_margin);
+ ok = ok && (str.empty() || isValidLength(str));
+ str = fl_get_input(paper_->input_right_margin);
+ ok = ok && (str.empty() || isValidLength(str));
+ str = fl_get_input(paper_->input_top_margin);
+ ok = ok && (str.empty() || isValidLength(str));
+ str = fl_get_input(paper_->input_bottom_margin);
+ ok = ok && (str.empty() || isValidLength(str));
+ str = fl_get_input(paper_->input_head_height);
+ ok = ok && (str.empty() || isValidLength(str));
+ str = fl_get_input(paper_->input_head_sep);
+ ok = ok && (str.empty() || isValidLength(str));
+ str = fl_get_input(paper_->input_foot_skip);
+ ok = ok && (str.empty() || isValidLength(str));
+ // "Synchronize" the choice and the input field, so that it
+ // is impossible to commit senseless data.
+ input = fl_get_input (class_->input_doc_skip);
+ if (ob == class_->input_doc_skip) {
+ if (!*input) {
+ fl_set_choice (class_->choice_doc_skip, 2);
+ } else if (isValidGlueLength (input)) {
+ fl_set_choice (class_->choice_doc_skip, 4);
+ } else {
+ fl_set_choice(class_->choice_doc_skip, 4);
+ ok = false;
+ }
} else {
- fl_set_choice(class_->choice_doc_skip, 4);
- ok = false;
+ if (*input && !isValidGlueLength(input))
+ ok = false;
}
- } else {
- if (*input && !isValidGlueLength(input))
- ok = false;
- }
- if ((fl_get_choice(class_->choice_doc_skip) == 4) && !*input)
- ok = false;
- else if (fl_get_choice(class_->choice_doc_skip) != 4)
- fl_set_input (class_->input_doc_skip, "");
-
- input = fl_get_input(class_->input_doc_spacing);
- if ((fl_get_choice(class_->choice_doc_spacing) == 4) && !*input)
- ok = false;
- else if (fl_get_choice(class_->choice_doc_spacing) != 4)
- fl_set_input (class_->input_doc_spacing, "");
- return ok;
+ if ((fl_get_choice(class_->choice_doc_skip) == 4) && !*input)
+ ok = false;
+ else if (fl_get_choice(class_->choice_doc_skip) != 4)
+ fl_set_input (class_->input_doc_skip, "");
+
+ input = fl_get_input(class_->input_doc_spacing);
+ if ((fl_get_choice(class_->choice_doc_spacing) == 4) && !*input)
+ ok = false;
+ else if (fl_get_choice(class_->choice_doc_spacing) != 4)
+ fl_set_input (class_->input_doc_spacing, "");
+ return ok;
}
void FormDocument::ChoiceBulletSize(FL_OBJECT * ob, long /*data*/ )
{
- BufferParams & param = lv_->buffer()->params;
+ BufferParams & param = lv_->buffer()->params;
- // convert from 1-6 range to -1-4
- param.temp_bullets[current_bullet_depth].setSize(fl_get_choice(ob) - 2);
- fl_set_input(bullets_->input_bullet_latex,
+ // convert from 1-6 range to -1-4
+ param.temp_bullets[current_bullet_depth].setSize(fl_get_choice(ob) - 2);
+ fl_set_input(bullets_->input_bullet_latex,
param.temp_bullets[current_bullet_depth].getText().c_str());
}
void FormDocument::InputBulletLaTeX(FL_OBJECT *, long)
{
- BufferParams & param = lv_->buffer()->params;
+ BufferParams & param = lv_->buffer()->params;
- param.temp_bullets[current_bullet_depth].
+ param.temp_bullets[current_bullet_depth].
setText(fl_get_input(bullets_->input_bullet_latex));
}
void FormDocument::BulletDepth(FL_OBJECT * ob, State cb)
{
- /* Should I do the following: */
- /* 1. change to the panel that the current bullet belongs in */
- /* 2. show that bullet as selected */
- /* 3. change the size setting to the size of the bullet in Q.*/
- /* 4. display the latex equivalent in the latex box */
- /* */
- /* I'm inclined to just go with 3 and 4 at the moment and */
- /* maybe try to support the others later */
- BufferParams & param = lv_->buffer()->params;
-
- int data = 0;
- if (cb == BULLETDEPTH1 )
- data = 0;
- else if (cb == BULLETDEPTH2 )
- data = 1;
- else if (cb == BULLETDEPTH3 )
- data = 2;
- else if (cb == BULLETDEPTH4 )
- data = 3;
-
- switch (fl_get_button_numb(ob)) {
- case 3:
- // right mouse button resets to default
- param.temp_bullets[data] = ITEMIZE_DEFAULTS[data];
- default:
- current_bullet_depth = data;
- fl_set_input(bullets_->input_bullet_latex,
- param.temp_bullets[data].getText().c_str());
- fl_set_choice(bullets_->choice_bullet_size,
- param.temp_bullets[data].getSize() + 2);
- }
+ /* Should I do the following:
+ * 1. change to the panel that the current bullet belongs in
+ * 2. show that bullet as selected
+ * 3. change the size setting to the size of the bullet in Q.
+ * 4. display the latex equivalent in the latex box
+ *
+ * I'm inclined to just go with 3 and 4 at the moment and
+ * maybe try to support the others later
+ */
+ BufferParams & param = lv_->buffer()->params;
+
+ int data = 0;
+ if (cb == BULLETDEPTH1 )
+ data = 0;
+ else if (cb == BULLETDEPTH2 )
+ data = 1;
+ else if (cb == BULLETDEPTH3 )
+ data = 2;
+ else if (cb == BULLETDEPTH4 )
+ data = 3;
+
+ switch (fl_get_button_numb(ob)) {
+ case 3:
+ // right mouse button resets to default
+ param.temp_bullets[data] = ITEMIZE_DEFAULTS[data];
+ default:
+ current_bullet_depth = data;
+ fl_set_input(bullets_->input_bullet_latex,
+ param.temp_bullets[data].getText().c_str());
+ fl_set_choice(bullets_->choice_bullet_size,
+ param.temp_bullets[data].getSize() + 2);
+ }
}
void FormDocument::BulletPanel(FL_OBJECT * /*ob*/, State cb)
{
- /* Here we have to change the background pixmap to that selected */
- /* by the user. (eg. standard.xpm, psnfss1.xpm etc...) */
-
- int data = 0;
- if (cb == BULLETPANEL1 )
- data = 0;
- else if (cb == BULLETPANEL2 )
- data = 1;
- else if (cb == BULLETPANEL3 )
- data = 2;
- else if (cb == BULLETPANEL4 )
- data = 3;
- else if (cb == BULLETPANEL5 )
- data = 4;
- else if (cb == BULLETPANEL6 )
- data = 5;
-
- if (data != current_bullet_panel) {
- fl_freeze_form(bullets_->form);
- current_bullet_panel = data;
-
- /* free the current pixmap */
- fl_free_bmtable_pixmap(bullets_->bmtable_bullet_panel);
- string new_panel;
- switch (cb) {
- /* display the new one */
- case BULLETPANEL1 :
- new_panel = "standard";
- break;
- case BULLETPANEL2 :
- new_panel = "amssymb";
- break;
- case BULLETPANEL3 :
- new_panel = "psnfss1";
- break;
- case BULLETPANEL4 :
- new_panel = "psnfss2";
- break;
- case BULLETPANEL5 :
- new_panel = "psnfss3";
- break;
- case BULLETPANEL6 :
- new_panel = "psnfss4";
- break;
- default :
- /* something very wrong happened */
- // play it safe for now but should be an exception
- current_bullet_panel = 0; // standard panel
- new_panel = "standard";
- break;
+ /* Here we have to change the background pixmap to that selected */
+ /* by the user. (eg. standard.xpm, psnfss1.xpm etc...) */
+
+ int data = 0;
+ if (cb == BULLETPANEL1 )
+ data = 0;
+ else if (cb == BULLETPANEL2 )
+ data = 1;
+ else if (cb == BULLETPANEL3 )
+ data = 2;
+ else if (cb == BULLETPANEL4 )
+ data = 3;
+ else if (cb == BULLETPANEL5 )
+ data = 4;
+ else if (cb == BULLETPANEL6 )
+ data = 5;
+
+ if (data != current_bullet_panel) {
+ fl_freeze_form(bullets_->form);
+ current_bullet_panel = data;
+
+ /* free the current pixmap */
+ fl_free_bmtable_pixmap(bullets_->bmtable_bullet_panel);
+ string new_panel;
+ switch (cb) {
+ /* display the new one */
+ case BULLETPANEL1 :
+ new_panel = "standard";
+ break;
+ case BULLETPANEL2 :
+ new_panel = "amssymb";
+ break;
+ case BULLETPANEL3 :
+ new_panel = "psnfss1";
+ break;
+ case BULLETPANEL4 :
+ new_panel = "psnfss2";
+ break;
+ case BULLETPANEL5 :
+ new_panel = "psnfss3";
+ break;
+ case BULLETPANEL6 :
+ new_panel = "psnfss4";
+ break;
+ default :
+ /* something very wrong happened */
+ // play it safe for now but should be an exception
+ current_bullet_panel = 0; // standard panel
+ new_panel = "standard";
+ break;
+ }
+ new_panel += ".xpm";
+ fl_set_bmtable_pixmap_file(bullets_->bmtable_bullet_panel, 6, 6,
+ LibFileSearch("images", new_panel).c_str());
+ fl_redraw_object(bullets_->bmtable_bullet_panel);
+ fl_unfreeze_form(bullets_->form);
}
- new_panel += ".xpm";
- fl_set_bmtable_pixmap_file(bullets_->bmtable_bullet_panel, 6, 6,
- LibFileSearch("images", new_panel).c_str());
- fl_redraw_object(bullets_->bmtable_bullet_panel);
- fl_unfreeze_form(bullets_->form);
- }
}
void FormDocument::BulletBMTable(FL_OBJECT * ob, long /*data*/ )
{
- /* handle the user input by setting the current bullet depth's pixmap */
- /* to that extracted from the current chosen position of the BMTable */
- /* Don't forget to free the button's old pixmap first. */
-
- BufferParams & param = lv_->buffer()->params;
- int bmtable_button = fl_get_bmtable(ob);
-
- /* try to keep the button held down till another is pushed */
- /* fl_set_bmtable(ob, 1, bmtable_button); */
- param.temp_bullets[current_bullet_depth].setFont(current_bullet_panel);
- param.temp_bullets[current_bullet_depth].setCharacter(bmtable_button);
- fl_set_input(bullets_->input_bullet_latex,
+ /* handle the user input by setting the current bullet depth's pixmap */
+ /* to that extracted from the current chosen position of the BMTable */
+ /* Don't forget to free the button's old pixmap first. */
+
+ BufferParams & param = lv_->buffer()->params;
+ int bmtable_button = fl_get_bmtable(ob);
+
+ /* try to keep the button held down till another is pushed */
+ /* fl_set_bmtable(ob, 1, bmtable_button); */
+ param.temp_bullets[current_bullet_depth].setFont(current_bullet_panel);
+ param.temp_bullets[current_bullet_depth].setCharacter(bmtable_button);
+ fl_set_input(bullets_->input_bullet_latex,
param.temp_bullets[current_bullet_depth].getText().c_str());
}
void FormDocument::CheckChoiceClass(FL_OBJECT * ob, long)
{
- if (!ob)
- ob = class_->choice_doc_class;
-
- ProhibitInput(lv_->view());
-
- unsigned int tc = combo_doc_class->get() - 1;
- if (textclasslist.Load(tc)) {
- // we use a copy of the bufferparams because we do not
- // want to modify them yet.
- BufferParams params = lv_->buffer()->params;
-
- if (params.textclass != tc
- && AskQuestion(_("Should I set some parameters to"),
- _("the defaults of this document class?"))) {
- params.textclass = tc;
- params.useClassDefaults();
- UpdateLayoutDocument(params);
+ if (!ob)
+ ob = class_->choice_doc_class;
+
+ ProhibitInput(lv_->view());
+
+ unsigned int tc = combo_doc_class->get() - 1;
+ if (textclasslist.Load(tc)) {
+ // we use a copy of the bufferparams because we do not
+ // want to modify them yet.
+ BufferParams params = lv_->buffer()->params;
+
+ if (params.textclass != tc
+ && AskQuestion(_("Should I set some parameters to"),
+ _("the defaults of this document class?"))) {
+ params.textclass = tc;
+ params.useClassDefaults();
+ UpdateLayoutDocument(params);
+ }
+ } else {
+ // unable to load new style
+ WriteAlert(_("Conversion Errors!"),
+ _("Unable to switch to new document class."),
+ _("Reverting to original document class."));
+ combo_doc_class->select(int(lv_->buffer()->params.textclass) + 1);
}
- } else {
- // unable to load new style
- WriteAlert(_("Conversion Errors!"),
- _("Unable to switch to new document class."),
- _("Reverting to original document class."));
- combo_doc_class->select(int(lv_->buffer()->params.textclass) + 1);
- }
- AllowInput(lv_->view());
+ AllowInput(lv_->view());
}
#endif
void FormDocument::UpdateLayoutDocument(BufferParams const & params)
{
- if (!dialog_.get())
- return;
-
- checkReadOnly();
- class_update(params);
- paper_update(params);
- language_update(params);
- options_update(params);
- bullets_update(params);
+ if (!dialog_.get())
+ return;
+
+ checkReadOnly();
+ class_update(params);
+ paper_update(params);
+ language_update(params);
+ options_update(params);
+ bullets_update(params);
}
@author Kalle Dalheimer
*/
class FormDocument
- : public Qt2CB<ControlDocument, Qt2DB<FormDocumentDialogImpl> >
+ : public Qt2CB<ControlDocument, Qt2DB<FormDocumentDialogImpl> >
{
public:
FormDocument(LyXView *, Dialogs *);
Dialogs * d_;
/// Hide connection.
- SigC::Connection h_;
+ SigC::Connection h_;
/// readonly file or not
bool readonly;
FormSearch::FormSearch(LyXView *v, Dialogs *d)
: dialog_(0), lv_(v), d_(d), h_(0), u_(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->showSearch.connect(SigC::slot(this, &FormSearch::show));
- // perhaps in the future we'd like a
- // "search again" button/keybinding
-// d->searchAgain.connect(slot(this, &FormSearch::FindNext));
+ // 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->showSearch.connect(SigC::slot(this, &FormSearch::show));
+ // perhaps in the future we'd like a
+ // "search again" button/keybinding
+ // d->searchAgain.connect(slot(this, &FormSearch::FindNext));
}
FormSearch::~FormSearch()
{
- delete dialog_;
+ delete dialog_;
}
void FormSearch::show()
{
- if (!dialog_) {
- dialog_ = new SearchDlgImpl(this, 0, _("Find and Replace"), false);
- }
+ if (!dialog_) {
+ dialog_ = new SearchDlgImpl(this, 0, _("Find and Replace"), false);
+ }
- if (!dialog_->isVisible()) {
- h_ = d_->hideBufferDependent.connect(SigC::slot(this, &FormSearch::hide));
- u_ = d_->updateBufferDependent.connect(SigC::slot(this, &FormSearch::update));
- }
-
- dialog_->raise();
- dialog_->setActiveWindow();
- update();
- dialog_->show();
+ if (!dialog_->isVisible()) {
+ h_ = d_->hideBufferDependent.connect(SigC::slot(this, &FormSearch::hide));
+ u_ = d_->updateBufferDependent.connect(SigC::slot(this, &FormSearch::update));
+ }
+
+ dialog_->raise();
+ dialog_->setActiveWindow();
+ update();
+ dialog_->show();
}
void FormSearch::find(string const & searchstr, bool const & casesensitive,
- bool const & matchword, bool const & searchback)
+ bool const & matchword, bool const & searchback)
{
- bool found = LyXFind(lv_->view(), searchstr, casesensitive, matchword,
+ bool found = LyXFind(lv_->view(), searchstr, casesensitive, matchword,
searchback);
-
- if (!found)
- setMinibuffer(lv_, _("String not found!"));
-
+
+ if (!found)
+ setMinibuffer(lv_, _("String not found!"));
+
}
void FormSearch::replace(string const & searchstr, string const & replacestr,
bool const & casesensitive, bool const & matchword,
bool const & searchback, bool const & replaceall)
{
- int replace_count = LyXReplace(lv_->view(), searchstr, replacestr,
+ int replace_count = LyXReplace(lv_->view(), searchstr, replacestr,
casesensitive, matchword, searchback,
replaceall);
- if (replace_count == 0) {
- setMinibuffer(lv_, _("String not found!"));
- } else {
- if (replace_count == 1) {
- setMinibuffer(lv_, _("String has been replaced."));
- } else {
- string str = tostr(replace_count);
- str += _(" strings have been replaced.");
- setMinibuffer(lv_, str.c_str());
- }
- }
+ if (replace_count == 0) {
+ setMinibuffer(lv_, _("String not found!"));
+ } else {
+ if (replace_count == 1) {
+ setMinibuffer(lv_, _("String has been replaced."));
+ } else {
+ string str = tostr(replace_count);
+ str += _(" strings have been replaced.");
+ setMinibuffer(lv_, str.c_str());
+ }
+ }
}
void FormSearch::close()
{
- h_.disconnect();
- u_.disconnect();
+ h_.disconnect();
+ u_.disconnect();
}
void FormSearch::hide()
{
- dialog_->hide();
- close();
+ dialog_->hide();
+ close();
}
void FormSearch::update(bool)
{
- if (!lv_->view()->available())
- return;
+ if (!lv_->view()->available())
+ return;
- dialog_->setReadOnly(lv_->buffer()->isReadonly());
+ dialog_->setReadOnly(lv_->buffer()->isReadonly());
}
class FormSearch : public DialogBase {
public:
- ///
- FormSearch(LyXView *, Dialogs *);
- ///
- ~FormSearch();
-
- /// Close connections.
- void close();
- /// find stuff (we need access to lv_).
- void find(string const &, bool const &, bool const &, bool const &);
- /// replace stuff (we need access to lv_).
- void replace(string const &, string const &,
+ ///
+ FormSearch(LyXView *, Dialogs *);
+ ///
+ ~FormSearch();
+
+ /// Close connections.
+ void close();
+ /// find stuff (we need access to lv_).
+ void find(string const &, bool const &, bool const &, bool const &);
+ /// replace stuff (we need access to lv_).
+ void replace(string const &, string const &,
bool const &, bool const &, bool const &, bool const &);
-
-
+
+
private:
- /// Show the dialog.
- void show();
- /// Hide the dialog.
- void hide();
- /// Update the dialog.
- void update(bool switched = false);
+ /// Show the dialog.
+ void show();
+ /// Hide the dialog.
+ void hide();
+ /// Update the dialog.
+ void update(bool switched = false);
- /// Real GUI implementation.
- SearchDlgImpl * dialog_;
+ /// Real GUI implementation.
+ SearchDlgImpl * dialog_;
- /// the LyXView we belong to.
- LyXView * lv_;
+ /// the LyXView we belong to.
+ LyXView * lv_;
- /** Which Dialogs do we belong to?
- * Used so we can get at the signals we have to connect to.
- */
- Dialogs * d_;
+ /** Which Dialogs do we belong to?
+ * Used so we can get at the signals we have to connect to.
+ */
+ Dialogs * d_;
- /// Hide connection.
- SigC::Connection h_;
+ /// Hide connection.
+ SigC::Connection h_;
- /// Update connection.
- SigC::Connection u_;
-
+ /// Update connection.
+ SigC::Connection u_;
+
};
#endif
FormSplash::~FormSplash()
{
- c_.disconnect();
- delete dialog_;
+ c_.disconnect();
+ delete dialog_;
}
void FormSplash::hide()
{
- dialog_->hide();
+ dialog_->hide();
}
void FormSplash::show()
{
- if (!lyxrc.show_banner)
- return;
+ if (!lyxrc.show_banner)
+ return;
- if (!dialog_)
- dialog_ = new FormSplashBase( 0, "LyX");
+ if (!dialog_)
+ dialog_ = new FormSplashBase( 0, "LyX");
- // show banner
- dialog_->show();
+ // show banner
+ dialog_->show();
}
*/
class FormSplash : public DialogBase {
- public:
+public:
FormSplash(LyXView *, Dialogs *);
~FormSplash();
/// hide the dialog
void hide();
- private:
+private:
/// show the dialog
void show();
FormTabularCreate::~FormTabularCreate()
{
- delete dialog_;
+ delete dialog_;
}
void FormTabularCreate::apply(int rows, int cols)
{
- if (!lv_->view()->available())
- return;
+ if (!lv_->view()->available())
+ return;
- string tmp = tostr(rows) + " " + tostr(cols);
- lv_->getLyXFunc()->Dispatch(LFUN_INSET_TABULAR, tmp);
+ string tmp = tostr(rows) + " " + tostr(cols);
+ lv_->getLyXFunc()->Dispatch(LFUN_INSET_TABULAR, tmp);
}
void FormTabularCreate::show()
{
- if (!dialog_)
- dialog_ = new TabularCreateDlgImpl(this, 0, _("LyX: Insert Table"));
+ if (!dialog_)
+ dialog_ = new TabularCreateDlgImpl(this, 0, _("LyX: Insert Table"));
- if (!dialog_->isVisible()) {
- h_ = d_->hideBufferDependent.connect(slot(this, &FormTabularCreate::hide));
- }
+ if (!dialog_->isVisible()) {
+ h_ = d_->hideBufferDependent.connect(slot(this, &FormTabularCreate::hide));
+ }
- dialog_->raise();
- dialog_->setActiveWindow();
+ dialog_->raise();
+ dialog_->setActiveWindow();
- update();
- dialog_->show();
+ update();
+ dialog_->show();
}
void FormTabularCreate::close()
{
- h_.disconnect();
+ h_.disconnect();
}
void FormTabularCreate::hide()
{
- dialog_->hide();
- close();
+ dialog_->hide();
+ close();
}
/* This file is part of
* ======================================================
*
- * LyX, The Document Processor
+ * LyX, The Document Processor
*
- * Copyright 2000 The LyX Team.
+ * Copyright 2000 The LyX Team.
*
* ======================================================
*
{}
-
void Qt2Base::show()
{
- if (!form()) {
- build();
- }
-
- update(); // make sure its up-to-date
-
- if (form()->isVisible()) {
- form()->raise();
- } else {
- form()->setCaption( title_ );
- form()->show();
- }
+ if (!form()) {
+ build();
+ }
+
+ update(); // make sure its up-to-date
+
+ if (form()->isVisible()) {
+ form()->raise();
+ } else {
+ form()->setCaption( title_ );
+ form()->show();
+ }
}
void Qt2Base::hide()
{
- if (form() && form()->isVisible() )
- form()->hide();
+ if (form() && form()->isVisible() )
+ form()->hide();
}
ButtonPolicy::SMInput Qt2Base::input(QWidget*, long)
{
- return ButtonPolicy::SMI_VALID;
+ return ButtonPolicy::SMI_VALID;
}
void Qt2Base::slotWMHide()
{
- CancelButton();
+ CancelButton();
}
void Qt2Base::slotApply()
{
- ApplyButton();
+ ApplyButton();
}
void Qt2Base::slotOK()
{
- OKButton();
+ OKButton();
}
void Qt2Base::slotCancel()
{
- CancelButton();
+ CancelButton();
}
void Qt2Base::slotRestore()
{
- RestoreButton();
+ RestoreButton();
}
/* This file is part of
* ======================================================
*
- * LyX, The Document Processor
+ * LyX, The Document Processor
*
- * Copyright 2000 The LyX Team.
+ * Copyright 2000 The LyX Team.
*
* ======================================================
*
class QDialog;
+#include <config.h>
+
#include <qfont.h>
#include <qobject.h>
*/
class Qt2Base : public QObject, public ViewBC<qt2BC>
{
- Q_OBJECT
+ Q_OBJECT
public:
///
Qt2Base(ControlButtons &, const QString &);
void show();
protected slots:
- // dialog closed from WM
- void slotWMHide();
+ // dialog closed from WM
+ void slotWMHide();
- // Apply button clicked
- void slotApply();
+ // Apply button clicked
+ void slotApply();
- // OK button clicked
- void slotOK();
+ // OK button clicked
+ void slotOK();
- // Cancel button clicked
- void slotCancel();
+ // Cancel button clicked
+ void slotCancel();
- // Restore button clicked
- void slotRestore();
+ // Restore button clicked
+ void slotRestore();
private:
/// Pointer to the actual instantiation of xform's form
virtual QDialog* form() const = 0;
/** Filter the inputs on callback from xforms
- Return true if inputs are valid. */
+ Return true if inputs are valid. */
virtual ButtonPolicy::SMInput input(QWidget*, long);
private:
template <class Dialog>
QDialog* Qt2DB<Dialog>::form() const
{
- return dialog_.get();
+ return dialog_.get();
}
#include <qgroupbox.h>
CharDlgImpl::CharDlgImpl(FormCharacter* form, QWidget * parent, const char* name, bool modal, WFlags fl )
- : CharDlg( parent, name, modal, fl ), form_(form)
+ : CharDlg( parent, name, modal, fl ), form_(form)
{
- setCaption(name);
+ setCaption(name);
}
CharDlgImpl::~CharDlgImpl()
LyXFont CharDlgImpl::getChar()
{
- LyXFont font(LyXFont::ALL_IGNORE);
-
- int pos = family->currentItem();
- switch (pos) {
- case 0: font.setFamily(LyXFont::IGNORE_FAMILY); break;
- case 1: font.setFamily(LyXFont::INHERIT_FAMILY); break;
- case 2: font.setFamily(LyXFont::ROMAN_FAMILY); break;
- case 3: font.setFamily(LyXFont::SANS_FAMILY); break;
- case 4: font.setFamily(LyXFont::TYPEWRITER_FAMILY); break;
- }
-
- pos = series->currentItem();
- switch (pos) {
- case 0: font.setSeries(LyXFont::IGNORE_SERIES); break;
- case 1: font.setSeries(LyXFont::INHERIT_SERIES); break;
- case 2: font.setSeries(LyXFont::MEDIUM_SERIES); break;
- case 3: font.setSeries(LyXFont::BOLD_SERIES); break;
- }
-
- pos = shape->currentItem();
- switch (pos) {
- case 0: font.setShape(LyXFont::IGNORE_SHAPE); break;
- case 1: font.setShape(LyXFont::INHERIT_SHAPE); break;
- case 2: font.setShape(LyXFont::UP_SHAPE); break;
- case 3: font.setShape(LyXFont::ITALIC_SHAPE); break;
- case 4: font.setShape(LyXFont::SLANTED_SHAPE); break;
- case 5: font.setShape(LyXFont::SMALLCAPS_SHAPE); break;
- }
-
- pos = size->currentItem();
- switch (pos) {
- case 0: font.setSize(LyXFont::IGNORE_SIZE); break;
- case 1: font.setSize(LyXFont::INHERIT_SIZE); break;
- case 2: font.setSize(LyXFont::SIZE_TINY); break;
- case 3: font.setSize(LyXFont::SIZE_SCRIPT); break;
- case 4: font.setSize(LyXFont::SIZE_FOOTNOTE); break;
- case 5: font.setSize(LyXFont::SIZE_SMALL); break;
- case 6: font.setSize(LyXFont::SIZE_NORMAL); break;
- case 7: font.setSize(LyXFont::SIZE_LARGE); break;
- case 8: font.setSize(LyXFont::SIZE_LARGER); break;
- case 9: font.setSize(LyXFont::SIZE_LARGEST); break;
- case 10: font.setSize(LyXFont::SIZE_HUGE); break;
- case 11: font.setSize(LyXFont::SIZE_HUGER); break;
- case 12: font.setSize(LyXFont::INCREASE_SIZE); break;
- case 13: font.setSize(LyXFont::DECREASE_SIZE); break;
- }
-
- pos = misc->currentItem();
- switch (pos) {
- case 0: font.setEmph(LyXFont::IGNORE);
- font.setUnderbar(LyXFont::IGNORE);
- font.setNoun(LyXFont::IGNORE);
- font.setLatex(LyXFont::IGNORE);
- break;
- case 1: font.setEmph(LyXFont::INHERIT);
- font.setUnderbar(LyXFont::INHERIT);
- font.setNoun(LyXFont::INHERIT);
- font.setLatex(LyXFont::INHERIT);
- break;
- case 2: font.setEmph(LyXFont::TOGGLE); break;
- case 3: font.setUnderbar(LyXFont::TOGGLE); break;
- case 4: font.setNoun(LyXFont::TOGGLE); break;
- case 5: font.setLatex(LyXFont::TOGGLE); break;
- }
-
- pos = color->currentItem();
- switch (pos) {
- case 0: font.setColor(LColor::ignore); break;
- case 1: font.setColor(LColor::inherit); break;
- case 2: font.setColor(LColor::none); break;
- case 3: font.setColor(LColor::black); break;
- case 4: font.setColor(LColor::white); break;
- case 5: font.setColor(LColor::red); break;
- case 6: font.setColor(LColor::green); break;
- case 7: font.setColor(LColor::blue); break;
- case 8: font.setColor(LColor::cyan); break;
- case 9: font.setColor(LColor::magenta); break;
- case 10: font.setColor(LColor::yellow); break;
- }
-
- pos = lang->currentItem();
- if (pos==0) {
- font.setLanguage(ignore_language);
- } else if (pos!=1) {
- const char * language = lang->currentText();
- font.setLanguage(languages.getLanguage(language));
- };
+ LyXFont font(LyXFont::ALL_IGNORE);
+
+ int pos = family->currentItem();
+ switch (pos) {
+ case 0: font.setFamily(LyXFont::IGNORE_FAMILY); break;
+ case 1: font.setFamily(LyXFont::INHERIT_FAMILY); break;
+ case 2: font.setFamily(LyXFont::ROMAN_FAMILY); break;
+ case 3: font.setFamily(LyXFont::SANS_FAMILY); break;
+ case 4: font.setFamily(LyXFont::TYPEWRITER_FAMILY); break;
+ }
+
+ pos = series->currentItem();
+ switch (pos) {
+ case 0: font.setSeries(LyXFont::IGNORE_SERIES); break;
+ case 1: font.setSeries(LyXFont::INHERIT_SERIES); break;
+ case 2: font.setSeries(LyXFont::MEDIUM_SERIES); break;
+ case 3: font.setSeries(LyXFont::BOLD_SERIES); break;
+ }
+
+ pos = shape->currentItem();
+ switch (pos) {
+ case 0: font.setShape(LyXFont::IGNORE_SHAPE); break;
+ case 1: font.setShape(LyXFont::INHERIT_SHAPE); break;
+ case 2: font.setShape(LyXFont::UP_SHAPE); break;
+ case 3: font.setShape(LyXFont::ITALIC_SHAPE); break;
+ case 4: font.setShape(LyXFont::SLANTED_SHAPE); break;
+ case 5: font.setShape(LyXFont::SMALLCAPS_SHAPE); break;
+ }
+
+ pos = size->currentItem();
+ switch (pos) {
+ case 0: font.setSize(LyXFont::IGNORE_SIZE); break;
+ case 1: font.setSize(LyXFont::INHERIT_SIZE); break;
+ case 2: font.setSize(LyXFont::SIZE_TINY); break;
+ case 3: font.setSize(LyXFont::SIZE_SCRIPT); break;
+ case 4: font.setSize(LyXFont::SIZE_FOOTNOTE); break;
+ case 5: font.setSize(LyXFont::SIZE_SMALL); break;
+ case 6: font.setSize(LyXFont::SIZE_NORMAL); break;
+ case 7: font.setSize(LyXFont::SIZE_LARGE); break;
+ case 8: font.setSize(LyXFont::SIZE_LARGER); break;
+ case 9: font.setSize(LyXFont::SIZE_LARGEST); break;
+ case 10: font.setSize(LyXFont::SIZE_HUGE); break;
+ case 11: font.setSize(LyXFont::SIZE_HUGER); break;
+ case 12: font.setSize(LyXFont::INCREASE_SIZE); break;
+ case 13: font.setSize(LyXFont::DECREASE_SIZE); break;
+ }
+
+ pos = misc->currentItem();
+ switch (pos) {
+ case 0: font.setEmph(LyXFont::IGNORE);
+ font.setUnderbar(LyXFont::IGNORE);
+ font.setNoun(LyXFont::IGNORE);
+ font.setLatex(LyXFont::IGNORE);
+ break;
+ case 1: font.setEmph(LyXFont::INHERIT);
+ font.setUnderbar(LyXFont::INHERIT);
+ font.setNoun(LyXFont::INHERIT);
+ font.setLatex(LyXFont::INHERIT);
+ break;
+ case 2: font.setEmph(LyXFont::TOGGLE); break;
+ case 3: font.setUnderbar(LyXFont::TOGGLE); break;
+ case 4: font.setNoun(LyXFont::TOGGLE); break;
+ case 5: font.setLatex(LyXFont::TOGGLE); break;
+ }
+
+ pos = color->currentItem();
+ switch (pos) {
+ case 0: font.setColor(LColor::ignore); break;
+ case 1: font.setColor(LColor::inherit); break;
+ case 2: font.setColor(LColor::none); break;
+ case 3: font.setColor(LColor::black); break;
+ case 4: font.setColor(LColor::white); break;
+ case 5: font.setColor(LColor::red); break;
+ case 6: font.setColor(LColor::green); break;
+ case 7: font.setColor(LColor::blue); break;
+ case 8: font.setColor(LColor::cyan); break;
+ case 9: font.setColor(LColor::magenta); break;
+ case 10: font.setColor(LColor::yellow); break;
+ }
+
+ pos = lang->currentItem();
+ if (pos==0) {
+ font.setLanguage(ignore_language);
+ } else if (pos!=1) {
+ string language(lang->currentText());
+ font.setLanguage(languages.getLanguage(language));
+ };
- return font;
+ return font;
}
void CharDlgImpl::closeEvent(QCloseEvent * e)
{
- form_->close();
- e->accept();
+ form_->close();
+ e->accept();
}
void CharDlgImpl::setReadOnly(bool readonly)
{
- sizeGB->setEnabled(!readonly);
- charGB->setEnabled(!readonly);
- miscGB->setEnabled(!readonly);
- okPB->setEnabled(!readonly);
- applyPB->setEnabled(!readonly);
+ sizeGB->setEnabled(!readonly);
+ charGB->setEnabled(!readonly);
+ miscGB->setEnabled(!readonly);
+ okPB->setEnabled(!readonly);
+ applyPB->setEnabled(!readonly);
}
#ifndef CHARDLGIMPL_H
#define CHARDLGIMPL_H
+#include <config.h>
+
#include "chardlg.h"
#include "FormCharacter.h"
#include <qevent.h>
class CharDlgImpl : public CharDlg
{
- Q_OBJECT
+ Q_OBJECT
+public:
+ CharDlgImpl(FormCharacter * form, QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 );
+
+ ~CharDlgImpl();
+
+ LyXFont getChar();
+
+ int langItem() {
+ return lang->currentItem();
+ };
+
+ bool toggleAll() {
+ return toggleall->isChecked();
+ };
+
+ void setReadOnly(bool);
+
+protected:
+ void closeEvent(QCloseEvent * e);
- public:
-
- CharDlgImpl(FormCharacter * form, QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 );
-
- ~CharDlgImpl();
-
- LyXFont getChar();
-
- int langItem() {
- return lang->currentItem();
- };
-
- bool toggleAll() {
- return toggleall->isChecked();
- };
-
- void setReadOnly(bool);
-
- protected:
-
- void closeEvent(QCloseEvent * e);
+private:
+ FormCharacter * form_;
+
-
- private:
-
- FormCharacter * form_;
-
-
- protected slots:
-
- void apply_adaptor() {
- form_->apply();
- }
-
- void cancel_adaptor() {
- form_->close();
- hide();
- }
-
- void close_adaptor() {
- form_->apply();
- form_->close();
- hide();
- }
+protected slots:
+
+ void apply_adaptor() {
+ form_->apply();
+ }
+
+ void cancel_adaptor() {
+ form_->close();
+ hide();
+ }
+
+ void close_adaptor() {
+ form_->apply();
+ form_->close();
+ hide();
+ }
};
-/*
- * emptytable.C
- * (C) 2000 LyX Team
- * John Levon, moz@compsoc.man.ac.uk
+/**
+ * \file emptytable.C
+ * Copyright 2001 the LyX Team
+ * Read the file COPYING
+ *
+ * \author John Levon
*/
-/***************************************************************************
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- ***************************************************************************/
-
#include "emptytable.h"
/**
-/*
- * emptytable.h
- * (C) 2000 LyX Team
- * John Levon, moz@compsoc.man.ac.uk
+/**
+ * \file emptytable.h
+ * Copyright 2001 the LyX Team
+ * Read the file COPYING
+ *
+ * \author John Levon
*/
-/***************************************************************************
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- ***************************************************************************/
-
#ifndef EMPTYTABLE_H
#define EMPTYTABLE_H
#include <qpainter.h>
#include <qtableview.h>
-#include "boost/utility.hpp"
-
/**
* A simple widget for a quick "preview" in TabularCreateDialog.
* The user can drag on the widget to change the table dimensions.
*/
class EmptyTable : public QTableView {
- Q_OBJECT
+ Q_OBJECT
public:
EmptyTable(QWidget * parent = 0, const char * name = 0);
using std::endl;
ParagraphDlgImpl::ParagraphDlgImpl(FormParagraph *form, QWidget* parent, const char* name, bool modal, WFlags fl )
- : ParagraphDlg( parent, name, modal, fl ), form_(form)
+ : ParagraphDlg( parent, name, modal, fl ), form_(form)
{
- setCaption(name);
+ setCaption(name);
}
+
ParagraphDlgImpl::~ParagraphDlgImpl()
{
- // no need to delete child widgets, Qt does it all for us
}
+
void ParagraphDlgImpl::setReadOnly(bool readonly)
{
- TabsParagraph->setEnabled(!readonly);
- okPB->setEnabled(!readonly);
- applyPB->setEnabled(!readonly);
- defaultsPB->setEnabled(!readonly);
- cancelPB->setText(readonly ? _("&Close") : _("&Cancel"));
+ TabsParagraph->setEnabled(!readonly);
+ okPB->setEnabled(!readonly);
+ applyPB->setEnabled(!readonly);
+ defaultsPB->setEnabled(!readonly);
+ cancelPB->setText(readonly ? _("&Close") : _("&Cancel"));
}
+
void ParagraphDlgImpl::setLabelWidth(const char *text)
{
- // FIXME: should be cleverer here
- if (!strcmp(_("Senseless with this layout!"),text)) {
- listOptions->setEnabled(false);
- labelWidth->setText("");
- } else {
- listOptions->setEnabled(true);
- labelWidth->setText(text);
- }
+ // FIXME: should be cleverer here
+ if (!strcmp(_("Senseless with this layout!"),text)) {
+ listOptions->setEnabled(false);
+ labelWidth->setText("");
+ } else {
+ listOptions->setEnabled(true);
+ labelWidth->setText(text);
+ }
}
+
void ParagraphDlgImpl::setAlign(int type)
{
- int item=0;
- switch (type) {
- case LYX_ALIGN_BLOCK : item=0; break;
- case LYX_ALIGN_LEFT : item=1; break;
- case LYX_ALIGN_RIGHT : item=2; break;
- case LYX_ALIGN_CENTER : item=3; break;
- default:
- item=0;
- }
- alignment->setCurrentItem(item);
+ int item=0;
+ switch (type) {
+ case LYX_ALIGN_BLOCK : item=0; break;
+ case LYX_ALIGN_LEFT : item=1; break;
+ case LYX_ALIGN_RIGHT : item=2; break;
+ case LYX_ALIGN_CENTER : item=3; break;
+ default:
+ item=0;
+ }
+ alignment->setCurrentItem(item);
}
+
void ParagraphDlgImpl::setChecks(bool labove, bool lbelow, bool pabove, bool pbelow, bool noindent)
{
- lineAbove->setChecked(labove);
- lineBelow->setChecked(lbelow);
- pagebreakAbove->setChecked(pabove);
- pagebreakBelow->setChecked(pbelow);
- noIndent->setChecked(noindent);
+ lineAbove->setChecked(labove);
+ lineBelow->setChecked(lbelow);
+ pagebreakAbove->setChecked(pabove);
+ pagebreakBelow->setChecked(pbelow);
+ noIndent->setChecked(noindent);
}
+
void ParagraphDlgImpl::setSpace(VSpace::vspace_kind kindabove, VSpace::vspace_kind kindbelow, bool keepabove, bool keepbelow)
{
- int item=0;
-
- switch (kindabove) {
- case VSpace::NONE: item = 0; break;
- case VSpace::DEFSKIP: item = 1; break;
- case VSpace::SMALLSKIP: item = 2; break;
- case VSpace::MEDSKIP: item = 3; break;
- case VSpace::BIGSKIP: item = 4; break;
- case VSpace::VFILL: item = 5; break;
- case VSpace::LENGTH: item = 6; break;
- }
- spacingAbove->setCurrentItem(item);
-
- switch (kindbelow) {
- case VSpace::NONE: item = 0; break;
- case VSpace::DEFSKIP: item = 1; break;
- case VSpace::SMALLSKIP: item = 2; break;
- case VSpace::MEDSKIP: item = 3; break;
- case VSpace::BIGSKIP: item = 4; break;
- case VSpace::VFILL: item = 5; break;
- case VSpace::LENGTH: item = 6; break;
- }
- spacingBelow->setCurrentItem(item);
-
- spacingAboveValue->setEnabled(kindabove == VSpace::LENGTH);
- spacingAbovePlus->setEnabled(kindabove == VSpace::LENGTH);
- spacingAboveMinus->setEnabled(kindabove == VSpace::LENGTH);
- spacingBelowValue->setEnabled(kindbelow == VSpace::LENGTH);
- spacingBelowPlus->setEnabled(kindbelow == VSpace::LENGTH);
- spacingBelowMinus->setEnabled(kindbelow == VSpace::LENGTH);
-
- spacingAboveKeep->setChecked(keepabove);
- spacingBelowKeep->setChecked(keepbelow);
+ int item=0;
+
+ switch (kindabove) {
+ case VSpace::NONE: item = 0; break;
+ case VSpace::DEFSKIP: item = 1; break;
+ case VSpace::SMALLSKIP: item = 2; break;
+ case VSpace::MEDSKIP: item = 3; break;
+ case VSpace::BIGSKIP: item = 4; break;
+ case VSpace::VFILL: item = 5; break;
+ case VSpace::LENGTH: item = 6; break;
+ }
+ spacingAbove->setCurrentItem(item);
+
+ switch (kindbelow) {
+ case VSpace::NONE: item = 0; break;
+ case VSpace::DEFSKIP: item = 1; break;
+ case VSpace::SMALLSKIP: item = 2; break;
+ case VSpace::MEDSKIP: item = 3; break;
+ case VSpace::BIGSKIP: item = 4; break;
+ case VSpace::VFILL: item = 5; break;
+ case VSpace::LENGTH: item = 6; break;
+ }
+ spacingBelow->setCurrentItem(item);
+
+ spacingAboveValue->setEnabled(kindabove == VSpace::LENGTH);
+ spacingAbovePlus->setEnabled(kindabove == VSpace::LENGTH);
+ spacingAboveMinus->setEnabled(kindabove == VSpace::LENGTH);
+ spacingBelowValue->setEnabled(kindbelow == VSpace::LENGTH);
+ spacingBelowPlus->setEnabled(kindbelow == VSpace::LENGTH);
+ spacingBelowMinus->setEnabled(kindbelow == VSpace::LENGTH);
+
+ spacingAboveKeep->setChecked(keepabove);
+ spacingBelowKeep->setChecked(keepbelow);
}
+
void ParagraphDlgImpl::setAboveLength(float val, float plus, float minus,
LyXLength::UNIT vunit, LyXLength::UNIT punit, LyXLength::UNIT munit)
{
- if (vunit==LyXLength::UNIT_NONE) {
- spacingAboveValue->setText("");
- spacingAbovePlus->setText("");
- spacingAboveMinus->setText("");
- } else {
- spacingAboveValue->setText(tostr(val).c_str());
- spacingAbovePlus->setText(tostr(plus).c_str());
- spacingAboveMinus->setText(tostr(minus).c_str());
- }
-
- spacingAboveValueUnit->setCurrentItem(getItem(vunit));
- spacingAbovePlusUnit->setCurrentItem(getItem(punit));
- spacingAboveMinusUnit->setCurrentItem(getItem(munit));
+ if (vunit==LyXLength::UNIT_NONE) {
+ spacingAboveValue->setText("");
+ spacingAbovePlus->setText("");
+ spacingAboveMinus->setText("");
+ } else {
+ spacingAboveValue->setText(tostr(val).c_str());
+ spacingAbovePlus->setText(tostr(plus).c_str());
+ spacingAboveMinus->setText(tostr(minus).c_str());
+ }
+
+ spacingAboveValueUnit->setCurrentItem(getItem(vunit));
+ spacingAbovePlusUnit->setCurrentItem(getItem(punit));
+ spacingAboveMinusUnit->setCurrentItem(getItem(munit));
}
+
void ParagraphDlgImpl::setBelowLength(float val, float plus, float minus,
LyXLength::UNIT vunit, LyXLength::UNIT punit, LyXLength::UNIT munit)
{
- if (vunit==LyXLength::UNIT_NONE) {
- spacingBelowValue->setText("");
- spacingBelowPlus->setText("");
- spacingBelowMinus->setText("");
- } else {
- spacingBelowValue->setText(tostr(val).c_str());
- spacingBelowPlus->setText(tostr(plus).c_str());
- spacingBelowMinus->setText(tostr(minus).c_str());
- }
-
- spacingBelowValueUnit->setCurrentItem(getItem(vunit));
- spacingBelowPlusUnit->setCurrentItem(getItem(punit));
- spacingBelowMinusUnit->setCurrentItem(getItem(munit));
+ if (vunit==LyXLength::UNIT_NONE) {
+ spacingBelowValue->setText("");
+ spacingBelowPlus->setText("");
+ spacingBelowMinus->setText("");
+ } else {
+ spacingBelowValue->setText(tostr(val).c_str());
+ spacingBelowPlus->setText(tostr(plus).c_str());
+ spacingBelowMinus->setText(tostr(minus).c_str());
+ }
+
+ spacingBelowValueUnit->setCurrentItem(getItem(vunit));
+ spacingBelowPlusUnit->setCurrentItem(getItem(punit));
+ spacingBelowMinusUnit->setCurrentItem(getItem(munit));
}
void ParagraphDlgImpl::setExtra(float widthval, LyXLength::UNIT units, const string percent, int align,
bool hfill, bool startminipage, LyXParagraph::PEXTRA_TYPE type)
{
- if (type!=LyXParagraph::PEXTRA_NONE) {
- lyxerr[Debug::GUI] << "percent : $" << percent << "$ widthval " << widthval << " unit " << long(units) << endl;
- if (percent != "") {
- extraWidth->setText(percent.c_str());
- extraUnit->setCurrentItem(11);
- } else {
- extraWidth->setText(tostr(widthval).c_str());
- extraUnit->setCurrentItem(getItem(units));
- }
- } else
- extraWidth->setText("");
-
- switch (type) {
- case LyXParagraph::PEXTRA_NONE:
- extraType->setCurrentItem(0);
- break;
- case LyXParagraph::PEXTRA_MINIPAGE:
- extraType->setCurrentItem(1);
- enable_extraOptions(1);
- enable_minipageOptions(1);
- break;
- case LyXParagraph::PEXTRA_FLOATFLT:
- extraType->setCurrentItem(2);
- enable_extraOptions(2);
- break;
- case LyXParagraph::PEXTRA_INDENT:
- extraType->setCurrentItem(3);
- enable_extraOptions(3);
- break;
- }
-
- switch (align) {
- case LyXParagraph::MINIPAGE_ALIGN_TOP:
- minipageValign->setCurrentItem(0);
- break;
- case LyXParagraph::MINIPAGE_ALIGN_MIDDLE:
- minipageValign->setCurrentItem(1);
- break;
- case LyXParagraph::MINIPAGE_ALIGN_BOTTOM:
- minipageValign->setCurrentItem(2);
- break;
- }
-
- minipageHfill->setChecked(hfill);
- minipageStart->setChecked(startminipage);
-
+ if (type!=LyXParagraph::PEXTRA_NONE) {
+ lyxerr[Debug::GUI] << "percent : $" << percent << "$ widthval " << widthval << " unit " << long(units) << endl;
+ if (percent != "") {
+ extraWidth->setText(percent.c_str());
+ extraUnit->setCurrentItem(11);
+ } else {
+ extraWidth->setText(tostr(widthval).c_str());
+ extraUnit->setCurrentItem(getItem(units));
+ }
+ } else
+ extraWidth->setText("");
+
+ switch (type) {
+ case LyXParagraph::PEXTRA_NONE:
+ extraType->setCurrentItem(0);
+ break;
+ case LyXParagraph::PEXTRA_MINIPAGE:
+ extraType->setCurrentItem(1);
+ enable_extraOptions(1);
+ enable_minipageOptions(1);
+ break;
+ case LyXParagraph::PEXTRA_FLOATFLT:
+ extraType->setCurrentItem(2);
+ enable_extraOptions(2);
+ break;
+ case LyXParagraph::PEXTRA_INDENT:
+ extraType->setCurrentItem(3);
+ enable_extraOptions(3);
+ break;
+ }
+
+ switch (align) {
+ case LyXParagraph::MINIPAGE_ALIGN_TOP:
+ minipageValign->setCurrentItem(0);
+ break;
+ case LyXParagraph::MINIPAGE_ALIGN_MIDDLE:
+ minipageValign->setCurrentItem(1);
+ break;
+ case LyXParagraph::MINIPAGE_ALIGN_BOTTOM:
+ minipageValign->setCurrentItem(2);
+ break;
+ }
+
+ minipageHfill->setChecked(hfill);
+ minipageStart->setChecked(startminipage);
}
LyXGlueLength ParagraphDlgImpl::getAboveLength() const
{
- LyXGlueLength len(
- spacingAboveValue->text().toFloat(),
- getLyXLength( spacingAboveValueUnit->currentItem() ),
- spacingAbovePlus->text().toFloat(),
- getLyXLength( spacingAbovePlusUnit->currentItem() ),
- spacingAboveMinus->text().toFloat(),
- getLyXLength( spacingAboveMinusUnit->currentItem() )
- );
- return len;
+ LyXGlueLength len(
+ spacingAboveValue->text().toFloat(),
+ getLyXLength( spacingAboveValueUnit->currentItem() ),
+ spacingAbovePlus->text().toFloat(),
+ getLyXLength( spacingAbovePlusUnit->currentItem() ),
+ spacingAboveMinus->text().toFloat(),
+ getLyXLength( spacingAboveMinusUnit->currentItem() )
+ );
+ return len;
}
+
LyXGlueLength ParagraphDlgImpl::getBelowLength() const
{
- LyXGlueLength len(
- spacingBelowValue->text().toFloat(),
- getLyXLength( spacingBelowValueUnit->currentItem() ),
- spacingBelowPlus->text().toFloat(),
- getLyXLength( spacingBelowPlusUnit->currentItem() ),
- spacingBelowMinus->text().toFloat(),
- getLyXLength( spacingBelowMinusUnit->currentItem() )
+ LyXGlueLength len(
+ spacingBelowValue->text().toFloat(),
+ getLyXLength( spacingBelowValueUnit->currentItem() ),
+ spacingBelowPlus->text().toFloat(),
+ getLyXLength( spacingBelowPlusUnit->currentItem() ),
+ spacingBelowMinus->text().toFloat(),
+ getLyXLength( spacingBelowMinusUnit->currentItem() )
);
- return len;
+ return len;
}
+
LyXLength ParagraphDlgImpl::getExtraWidth() const
{
- if (extraUnit->currentItem()!=11) {
- LyXLength len(
- (extraWidth->text()).toDouble(),
- getLyXLength(extraUnit->currentItem())
- );
- return len;
- } else {
- LyXLength len(0.0, LyXLength::UNIT_NONE);
- return len;
- }
-}
-
+ if (extraUnit->currentItem()!=11) {
+ LyXLength len(
+ (extraWidth->text()).toDouble(),
+ getLyXLength(extraUnit->currentItem())
+ );
+ return len;
+ } else {
+ LyXLength len(0.0, LyXLength::UNIT_NONE);
+ return len;
+ }
+}
+
+
string ParagraphDlgImpl::getExtraWidthPercent() const
{
- double val = (extraWidth->text()).toDouble();
- if (val > 100.0)
- val = 100.0;
- if (val < 0.0)
- val = 0.0;
- return tostr(val);
+ double val = (extraWidth->text()).toDouble();
+ if (val > 100.0)
+ val = 100.0;
+ if (val < 0.0)
+ val = 0.0;
+ return tostr(val);
}
-const char* ParagraphDlgImpl::getLabelWidth() const {
- return labelWidth->text();
+const char * ParagraphDlgImpl::getLabelWidth() const {
+ return labelWidth->text();
}
-
+
+
LyXAlignment ParagraphDlgImpl::getAlign() const {
- switch (alignment->currentItem()) {
- case 0: return LYX_ALIGN_BLOCK;
- case 1: return LYX_ALIGN_LEFT;
- case 2: return LYX_ALIGN_RIGHT;
- case 3: return LYX_ALIGN_CENTER;
- default: return LYX_ALIGN_CENTER;
- }
-}
-
-
+ switch (alignment->currentItem()) {
+ case 0: return LYX_ALIGN_BLOCK;
+ case 1: return LYX_ALIGN_LEFT;
+ case 2: return LYX_ALIGN_RIGHT;
+ case 3: return LYX_ALIGN_CENTER;
+ default: return LYX_ALIGN_CENTER;
+ }
+}
+
+
bool ParagraphDlgImpl::getAboveKeep() const {
- return spacingAboveKeep->isChecked();
+ return spacingAboveKeep->isChecked();
}
-
+
+
bool ParagraphDlgImpl::getBelowKeep() const {
- return spacingBelowKeep->isChecked();
+ return spacingBelowKeep->isChecked();
}
-
+
+
bool ParagraphDlgImpl::getLineAbove() const {
- return lineAbove->isChecked();
+ return lineAbove->isChecked();
}
-
+
+
bool ParagraphDlgImpl::getLineBelow() const {
- return lineBelow->isChecked();
+ return lineBelow->isChecked();
}
-
+
+
bool ParagraphDlgImpl::getPagebreakAbove() const {
- return pagebreakAbove->isChecked();
+ return pagebreakAbove->isChecked();
}
-
+
+
bool ParagraphDlgImpl::getPagebreakBelow() const {
- return pagebreakBelow->isChecked();
+ return pagebreakBelow->isChecked();
}
-
+
+
bool ParagraphDlgImpl::getNoIndent() const {
- return noIndent->isChecked();
+ return noIndent->isChecked();
}
-
+
+
VSpace::vspace_kind ParagraphDlgImpl::getSpaceAboveKind() const {
- return getSpaceKind(spacingAbove->currentItem());
+ return getSpaceKind(spacingAbove->currentItem());
}
-
+
+
VSpace::vspace_kind ParagraphDlgImpl::getSpaceBelowKind() const {
- return getSpaceKind(spacingBelow->currentItem());
+ return getSpaceKind(spacingBelow->currentItem());
}
LyXParagraph::PEXTRA_TYPE ParagraphDlgImpl::getExtraType() const {
- switch (extraType->currentItem()) {
- case 0: return LyXParagraph::PEXTRA_NONE;
- case 1: return LyXParagraph::PEXTRA_MINIPAGE;
- case 2: return LyXParagraph::PEXTRA_FLOATFLT;
- case 3: return LyXParagraph::PEXTRA_INDENT;
- }
- return LyXParagraph::PEXTRA_NONE;
-}
-
+ switch (extraType->currentItem()) {
+ case 0: return LyXParagraph::PEXTRA_NONE;
+ case 1: return LyXParagraph::PEXTRA_MINIPAGE;
+ case 2: return LyXParagraph::PEXTRA_FLOATFLT;
+ case 3: return LyXParagraph::PEXTRA_INDENT;
+ }
+ return LyXParagraph::PEXTRA_NONE;
+}
+
+
LyXParagraph::MINIPAGE_ALIGNMENT ParagraphDlgImpl::getExtraAlign() const {
- switch (minipageValign->currentItem()) {
- case 0: return LyXParagraph::MINIPAGE_ALIGN_TOP;
- case 1: return LyXParagraph::MINIPAGE_ALIGN_MIDDLE;
- case 2: return LyXParagraph::MINIPAGE_ALIGN_BOTTOM;
- default: return LyXParagraph::MINIPAGE_ALIGN_BOTTOM;
- }
-}
-
+ switch (minipageValign->currentItem()) {
+ case 0: return LyXParagraph::MINIPAGE_ALIGN_TOP;
+ case 1: return LyXParagraph::MINIPAGE_ALIGN_MIDDLE;
+ case 2: return LyXParagraph::MINIPAGE_ALIGN_BOTTOM;
+ default: return LyXParagraph::MINIPAGE_ALIGN_BOTTOM;
+ }
+}
+
+
bool ParagraphDlgImpl::getHfillBetween() const {
- return minipageHfill->isChecked();
+ return minipageHfill->isChecked();
}
+
bool ParagraphDlgImpl::getStartNewMinipage() const {
- return minipageStart->isChecked();
+ return minipageStart->isChecked();
}
VSpace::vspace_kind ParagraphDlgImpl::getSpaceKind(int val) const {
- switch (val) {
- case 0: return VSpace::NONE;
- case 1: return VSpace::DEFSKIP;
- case 2: return VSpace::SMALLSKIP;
- case 3: return VSpace::MEDSKIP;
- case 4: return VSpace::BIGSKIP;
- case 5: return VSpace::VFILL;
- case 6: return VSpace::LENGTH;
- default:
- lyxerr[Debug::GUI] << "Unknown kind combo entry " << val << std::endl;
- }
- return VSpace::NONE;
+ switch (val) {
+ case 0: return VSpace::NONE;
+ case 1: return VSpace::DEFSKIP;
+ case 2: return VSpace::SMALLSKIP;
+ case 3: return VSpace::MEDSKIP;
+ case 4: return VSpace::BIGSKIP;
+ case 5: return VSpace::VFILL;
+ case 6: return VSpace::LENGTH;
+ default:
+ lyxerr[Debug::GUI] << "Unknown kind combo entry " << val << std::endl;
+ }
+ return VSpace::NONE;
}
+
LyXLength::UNIT ParagraphDlgImpl::getLyXLength(int val) const {
- switch (val) {
- case 0: return LyXLength::CM;
- case 1: return LyXLength::IN;
- case 2: return LyXLength::PT;
- case 3: return LyXLength::MM;
- case 4: return LyXLength::PC;
- case 5: return LyXLength::EX;
- case 6: return LyXLength::EM;
- case 7: return LyXLength::SP;
- case 8: return LyXLength::BP;
- case 9: return LyXLength::DD;
- case 10: return LyXLength::CC;
- default:
- lyxerr[Debug::GUI] << "Unknown kind combo entry " << val << std::endl;
- }
- return LyXLength::UNIT_NONE;
-}
-
+ switch (val) {
+ case 0: return LyXLength::CM;
+ case 1: return LyXLength::IN;
+ case 2: return LyXLength::PT;
+ case 3: return LyXLength::MM;
+ case 4: return LyXLength::PC;
+ case 5: return LyXLength::EX;
+ case 6: return LyXLength::EM;
+ case 7: return LyXLength::SP;
+ case 8: return LyXLength::BP;
+ case 9: return LyXLength::DD;
+ case 10: return LyXLength::CC;
+ default:
+ lyxerr[Debug::GUI] << "Unknown kind combo entry " << val << std::endl;
+ }
+ return LyXLength::UNIT_NONE;
+}
+
+
int ParagraphDlgImpl::getItem(LyXLength::UNIT unit) const {
- int item=0;
- switch (unit) {
- case LyXLength::CM: item = 0; break;
- case LyXLength::IN: item = 1; break;
- case LyXLength::PT: item = 2; break;
- case LyXLength::MM: item = 3; break;
- case LyXLength::PC: item = 4; break;
- case LyXLength::EX: item = 5; break;
- case LyXLength::EM: item = 6; break;
- case LyXLength::SP: item = 7; break;
- case LyXLength::BP: item = 8; break;
- case LyXLength::DD: item = 9; break;
- case LyXLength::CC: item = 10; break;
- case LyXLength::MU: item = 0; break;
- case LyXLength::UNIT_NONE: item = 0; break;
- default:
- lyxerr[Debug::GUI] << "Unknown unit " << long(unit) << endl;
- }
- return item;
+ int item=0;
+ switch (unit) {
+ case LyXLength::CM: item = 0; break;
+ case LyXLength::IN: item = 1; break;
+ case LyXLength::PT: item = 2; break;
+ case LyXLength::MM: item = 3; break;
+ case LyXLength::PC: item = 4; break;
+ case LyXLength::EX: item = 5; break;
+ case LyXLength::EM: item = 6; break;
+ case LyXLength::SP: item = 7; break;
+ case LyXLength::BP: item = 8; break;
+ case LyXLength::DD: item = 9; break;
+ case LyXLength::CC: item = 10; break;
+ case LyXLength::MU: item = 0; break;
+ case LyXLength::UNIT_NONE: item = 0; break;
+ default:
+ lyxerr[Debug::GUI] << "Unknown unit " << long(unit) << endl;
+ }
+ return item;
}
+
void ParagraphDlgImpl::enable_extraOptions(int item)
{
- bool enable = (item!=0);
- extraWidth->setEnabled(enable);
- extraWidthL->setEnabled(enable);
- extraUnit->setEnabled(enable);
- extraUnitL->setEnabled(enable);
+ bool enable = (item!=0);
+ extraWidth->setEnabled(enable);
+ extraWidthL->setEnabled(enable);
+ extraUnit->setEnabled(enable);
+ extraUnitL->setEnabled(enable);
}
+
void ParagraphDlgImpl::enable_minipageOptions(int item)
{
- minipageOptions->setEnabled( item==1 );
+ minipageOptions->setEnabled( item==1 );
}
+
void ParagraphDlgImpl::enable_spacingAbove(int item)
{
- bool enable = (item==6);
- spacingAboveValue->setEnabled(enable);
- spacingAbovePlus->setEnabled(enable);
- spacingAboveMinus->setEnabled(enable);
- spacingAboveValueUnit->setEnabled(enable);
- spacingAbovePlusUnit->setEnabled(enable);
- spacingAboveMinusUnit->setEnabled(enable);
- spacingAboveUnitsL->setEnabled(enable);
- bool enablel = ( (item==6) || (item!=6 && spacingBelow->currentItem()==6) );
- spacingValueL->setEnabled(enablel);
- spacingPlusL->setEnabled(enablel);
- spacingMinusL->setEnabled(enablel);
+ bool enable = (item==6);
+ spacingAboveValue->setEnabled(enable);
+ spacingAbovePlus->setEnabled(enable);
+ spacingAboveMinus->setEnabled(enable);
+ spacingAboveValueUnit->setEnabled(enable);
+ spacingAbovePlusUnit->setEnabled(enable);
+ spacingAboveMinusUnit->setEnabled(enable);
+ spacingAboveUnitsL->setEnabled(enable);
+ bool enablel = ( (item==6) || (item!=6 && spacingBelow->currentItem()==6) );
+ spacingValueL->setEnabled(enablel);
+ spacingPlusL->setEnabled(enablel);
+ spacingMinusL->setEnabled(enablel);
}
+
void ParagraphDlgImpl::enable_spacingBelow(int item)
{
- bool enable = (item==6);
- spacingBelowValue->setEnabled(enable);
- spacingBelowPlus->setEnabled(enable);
- spacingBelowMinus->setEnabled(enable);
- spacingBelowValueUnit->setEnabled(enable);
- spacingBelowPlusUnit->setEnabled(enable);
- spacingBelowMinusUnit->setEnabled(enable);
- spacingBelowUnitsL->setEnabled(enable);
- bool enablel = ( (item==6) || (item!=6 && spacingAbove->currentItem()==6) );
- spacingValueL->setEnabled(enablel);
- spacingPlusL->setEnabled(enablel);
- spacingMinusL->setEnabled(enablel);
+ bool enable = (item==6);
+ spacingBelowValue->setEnabled(enable);
+ spacingBelowPlus->setEnabled(enable);
+ spacingBelowMinus->setEnabled(enable);
+ spacingBelowValueUnit->setEnabled(enable);
+ spacingBelowPlusUnit->setEnabled(enable);
+ spacingBelowMinusUnit->setEnabled(enable);
+ spacingBelowUnitsL->setEnabled(enable);
+ bool enablel = ( (item==6) || (item!=6 && spacingAbove->currentItem()==6) );
+ spacingValueL->setEnabled(enablel);
+ spacingPlusL->setEnabled(enablel);
+ spacingMinusL->setEnabled(enablel);
}
+
void ParagraphDlgImpl::closeEvent(QCloseEvent * e)
{
- form_->close();
- e->accept();
+ form_->close();
+ e->accept();
}
+
void ParagraphDlgImpl::apply_adaptor()
{
- form_->apply();
+ form_->apply();
}
+
void ParagraphDlgImpl::cancel_adaptor()
{
- form_->close();
- hide();
+ form_->close();
+ hide();
}
+
void ParagraphDlgImpl::ok_adaptor()
{
- apply_adaptor();
- form_->close();
- hide();
+ apply_adaptor();
+ form_->close();
+ hide();
}
+
void ParagraphDlgImpl::restore_adaptor()
{
- form_->update();
+ form_->update();
}
-
#ifndef PARAGRAPHDLGIMPL_H
#define PARAGRAPHDLGIMPL_H
+#include <config.h>
+
#include "paragraphdlg.h"
#include "vspace.h"
#include "lyxparagraph.h"
class ParagraphDlgImpl : public ParagraphDlg
{
- Q_OBJECT
-
- public:
-
- ParagraphDlgImpl(FormParagraph *form, QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 );
- ~ParagraphDlgImpl();
-
- void setReadOnly(bool);
- void setLabelWidth(const char *);
- void setAlign(int);
- void setChecks(bool, bool, bool, bool, bool);
- void setSpace(VSpace::vspace_kind, VSpace::vspace_kind, bool, bool);
- void setAboveLength(float, float, float, LyXGlueLength::UNIT, LyXGlueLength::UNIT, LyXGlueLength::UNIT);
- void setBelowLength(float, float, float, LyXGlueLength::UNIT, LyXGlueLength::UNIT, LyXGlueLength::UNIT);
- void setExtra(float, LyXGlueLength::UNIT, const string, int, bool, bool, LyXParagraph::PEXTRA_TYPE);
- LyXGlueLength getAboveLength() const;
- LyXGlueLength getBelowLength() const;
- LyXLength getExtraWidth() const;
- string getExtraWidthPercent() const;
- const char * getLabelWidth() const;
- LyXAlignment getAlign() const;
- bool getAboveKeep() const;
- bool getBelowKeep() const;
- bool getLineAbove() const;
- bool getLineBelow() const;
- bool getPagebreakAbove() const;
- bool getPagebreakBelow() const;
- bool getNoIndent() const;
- VSpace::vspace_kind getSpaceAboveKind() const;
- VSpace::vspace_kind getSpaceBelowKind() const;
- LyXParagraph::PEXTRA_TYPE getExtraType() const;
- LyXParagraph::MINIPAGE_ALIGNMENT getExtraAlign() const;
- bool getHfillBetween() const;
- bool getStartNewMinipage() const;
-
-
- protected:
-
- void closeEvent (QCloseEvent * e);
-
-
- private:
-
- FormParagraph * form_;
- VSpace::vspace_kind getSpaceKind(int val) const;
- LyXLength::UNIT getLyXLength(int val) const;
- int getItem(LyXLength::UNIT unit) const;
-
-
- protected slots:
-
- void apply_adaptor();
- void cancel_adaptor();
- void enable_extraOptions(int);
- void enable_minipageOptions(int);
- void enable_spacingAbove(int);
- void enable_spacingBelow(int);
- void ok_adaptor();
- void restore_adaptor();
-
+ Q_OBJECT
+
+public:
+
+ ParagraphDlgImpl(FormParagraph *form, QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 );
+ ~ParagraphDlgImpl();
+
+ void setReadOnly(bool);
+ void setLabelWidth(const char *);
+ void setAlign(int);
+ void setChecks(bool, bool, bool, bool, bool);
+ void setSpace(VSpace::vspace_kind, VSpace::vspace_kind, bool, bool);
+ void setAboveLength(float, float, float, LyXGlueLength::UNIT, LyXGlueLength::UNIT, LyXGlueLength::UNIT);
+ void setBelowLength(float, float, float, LyXGlueLength::UNIT, LyXGlueLength::UNIT, LyXGlueLength::UNIT);
+ void setExtra(float, LyXGlueLength::UNIT, const string, int, bool, bool, LyXParagraph::PEXTRA_TYPE);
+ LyXGlueLength getAboveLength() const;
+ LyXGlueLength getBelowLength() const;
+ LyXLength getExtraWidth() const;
+ string getExtraWidthPercent() const;
+ // FIXME: return a std::string !
+ const char * getLabelWidth() const;
+ LyXAlignment getAlign() const;
+ bool getAboveKeep() const;
+ bool getBelowKeep() const;
+ bool getLineAbove() const;
+ bool getLineBelow() const;
+ bool getPagebreakAbove() const;
+ bool getPagebreakBelow() const;
+ bool getNoIndent() const;
+ VSpace::vspace_kind getSpaceAboveKind() const;
+ VSpace::vspace_kind getSpaceBelowKind() const;
+ LyXParagraph::PEXTRA_TYPE getExtraType() const;
+ LyXParagraph::MINIPAGE_ALIGNMENT getExtraAlign() const;
+ bool getHfillBetween() const;
+ bool getStartNewMinipage() const;
+
+
+protected:
+
+ void closeEvent (QCloseEvent * e);
+
+private:
+
+ FormParagraph * form_;
+ VSpace::vspace_kind getSpaceKind(int val) const;
+ LyXLength::UNIT getLyXLength(int val) const;
+ int getItem(LyXLength::UNIT unit) const;
+
+
+protected slots:
+
+ void apply_adaptor();
+ void cancel_adaptor();
+ void enable_extraOptions(int);
+ void enable_minipageOptions(int);
+ void enable_spacingAbove(int);
+ void enable_spacingBelow(int);
+ void ok_adaptor();
+ void restore_adaptor();
};
#endif // PARAGRAPHDLGIMPL_H
PrintDlgImpl::PrintDlgImpl( FormPrint *f, QWidget* parent, const char* name, bool modal, WFlags fl )
- : PrintDlg( parent, name, modal, fl ), form_(f)
+ : PrintDlg( parent, name, modal, fl ), form_(f)
{
- setCaption(name);
+ setCaption(name);
}
+
PrintDlgImpl::~PrintDlgImpl()
{
- // no need to delete child widgets, Qt does it all for us
+ // no need to delete child widgets, Qt does it all for us
}
+
const char * PrintDlgImpl::getFrom() {
- return fromPage->text();
+ return fromPage->text();
}
+
const char * PrintDlgImpl::getTo() {
- return toPage->text();
+ return toPage->text();
}
+
PrinterParams::Target PrintDlgImpl::getTarget() {
- if (toPrinter->isChecked())
- return PrinterParams::PRINTER;
- else
- return PrinterParams::FILE;
+ if (toPrinter->isChecked())
+ return PrinterParams::PRINTER;
+ else
+ return PrinterParams::FILE;
}
const char * PrintDlgImpl::getPrinter() {
- return printerName->text();
+ return printerName->text();
}
const char * PrintDlgImpl::getFile() {
- return fileName->text();
+ return fileName->text();
}
PrinterParams::WhichPages PrintDlgImpl::getWhichPages() {
- if (oddPages->isChecked())
- return PrinterParams::ODD;
- else if (evenPages->isChecked())
- return PrinterParams::EVEN;
- else
- return PrinterParams::ALL;
+ if (oddPages->isChecked())
+ return PrinterParams::ODD;
+ else if (evenPages->isChecked())
+ return PrinterParams::EVEN;
+ else
+ return PrinterParams::ALL;
}
bool PrintDlgImpl::getReverse() {
- return reverse->isChecked();
+ return reverse->isChecked();
}
bool PrintDlgImpl::getSort() {
- return collate->isChecked();
+ return collate->isChecked();
}
const char * PrintDlgImpl::getCount() {
- return copies->text();
+ return copies->text();
}
void PrintDlgImpl::setTarget(PrinterParams::Target t) {
- toPrinter->setChecked(t==PrinterParams::PRINTER);
- toFile->setChecked(t!=PrinterParams::PRINTER);
+ toPrinter->setChecked(t==PrinterParams::PRINTER);
+ toFile->setChecked(t!=PrinterParams::PRINTER);
}
void PrintDlgImpl::setPrinter(const char * name) {
- printerName->setText(name);
+ printerName->setText(name);
}
void PrintDlgImpl::setFile(const char * name) {
- fileName->setText(name);
+ fileName->setText(name);
}
void PrintDlgImpl::setWhichPages(PrinterParams::WhichPages wp) {
- switch (wp) {
- case PrinterParams::ALL:
- allPages->setChecked(true);
- break;
- case PrinterParams::EVEN:
- evenPages->setChecked(true);
- break;
- case PrinterParams::ODD:
- oddPages->setChecked(true);
- break;
- }
+ switch (wp) {
+ case PrinterParams::ALL:
+ allPages->setChecked(true);
+ break;
+ case PrinterParams::EVEN:
+ evenPages->setChecked(true);
+ break;
+ case PrinterParams::ODD:
+ oddPages->setChecked(true);
+ break;
+ }
}
+
void PrintDlgImpl::setReverse(bool on) {
- reverse->setChecked(on);
+ reverse->setChecked(on);
}
+
void PrintDlgImpl::setSort(bool on) {
- collate->setChecked(on);
+ collate->setChecked(on);
}
+
void PrintDlgImpl::setCount(int num) {
- copies->setValue(num);
- collate->setEnabled(num > 1);
+ copies->setValue(num);
+ collate->setEnabled(num > 1);
}
+
void PrintDlgImpl::setFrom(const char * text) {
- fromPage->setText(text);
+ fromPage->setText(text);
}
+
void PrintDlgImpl::setTo(const char * text) {
- toPage->setText(text);
+ toPage->setText(text);
}
+
void PrintDlgImpl::browse_file()
{
- QString d( OnlyPath(tostr(fileName->text())).c_str() );
- QString s( QFileDialog::getOpenFileName( d, "PostScript Files (*.ps)", this ) );
- if (!s.isNull())
- fileName->setText(s);
+ QString d( OnlyPath(tostr(fileName->text())).c_str() );
+ QString s( QFileDialog::getOpenFileName( d, "PostScript Files (*.ps)", this ) );
+ if (!s.isNull())
+ fileName->setText(s);
}
+
void PrintDlgImpl::print()
{
- form_->print();
- form_->close();
- hide();
+ form_->print();
+ form_->close();
+ hide();
}
+
void PrintDlgImpl::cancel_adaptor()
{
- form_->close();
- hide();
+ form_->close();
+ hide();
}
+
void PrintDlgImpl::set_collate(int copies)
{
collate->setEnabled(copies > 1);
}
-
#ifndef PRINTDLGIMPL_H
#define PRINTDLGIMPL_H
+
+#include <config.h>
+
#include "printdlg.h"
#include "lyxrc.h"
#include "PrinterParams.h"
class PrintDlgImpl : public PrintDlg
{
- Q_OBJECT
-
- public:
- PrintDlgImpl( FormPrint *f, QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 );
- ~PrintDlgImpl();
-
- const char *getFrom();
- const char *getTo();
- const char *getPrinter();
- const char *getFile();
- const char *getCount();
- PrinterParams::Target getTarget();
- PrinterParams::WhichPages getWhichPages();
- bool getReverse();
- bool getSort();
- void setFrom(const char *);
- void setTo(const char *);
- void setPrinter(const char *);
- void setFile(const char *);
- void setCount(int);
- void setTarget(PrinterParams::Target);
- void setWhichPages(PrinterParams::WhichPages);
- void setReverse(bool);
- void setSort(bool);
-
-
- protected slots:
- void cancel_adaptor();
- void browse_file();
- void print();
- void set_collate(int);
-
- private:
- FormPrint * form_;
+ Q_OBJECT
+
+public:
+ PrintDlgImpl( FormPrint *f, QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 );
+ ~PrintDlgImpl();
+
+ // FIXME: these should return std::string !
+ const char * getFrom();
+ const char * getTo();
+ const char * getPrinter();
+ const char * getFile();
+ const char * getCount();
+ PrinterParams::Target getTarget();
+ PrinterParams::WhichPages getWhichPages();
+ bool getReverse();
+ bool getSort();
+ void setFrom(const char *);
+ void setTo(const char *);
+ void setPrinter(const char *);
+ void setFile(const char *);
+ void setCount(int);
+ void setTarget(PrinterParams::Target);
+ void setWhichPages(PrinterParams::WhichPages);
+ void setReverse(bool);
+ void setSort(bool);
+
+
+protected slots:
+ void cancel_adaptor();
+ void browse_file();
+ void print();
+ void set_collate(int);
+
+private:
+ FormPrint * form_;
};
SearchDlgImpl::SearchDlgImpl(FormSearch* form, QWidget* parent, const char* name, bool modal, WFlags fl )
- : SearchDlg( parent, name, modal, fl ), form_(form)
+ : SearchDlg( parent, name, modal, fl ), form_(form)
{
- setCaption(name);
+ setCaption(name);
}
+
SearchDlgImpl::~SearchDlgImpl()
{
}
+
void SearchDlgImpl::closeEvent(QCloseEvent * e)
{
- form_->close();
- e->accept();
+ form_->close();
+ e->accept();
}
+
void SearchDlgImpl::setReadOnly(bool readonly)
{
- replace->setEnabled(!readonly);
- replaceLabel->setEnabled(!readonly);
- replacePB->setEnabled(!readonly);
- replaceAllPB->setEnabled(!readonly);
+ replace->setEnabled(!readonly);
+ replaceLabel->setEnabled(!readonly);
+ replacePB->setEnabled(!readonly);
+ replaceAllPB->setEnabled(!readonly);
}
+
void SearchDlgImpl::Find()
{
- form_->find(tostr(find->currentText()).c_str(),
- caseSensitive->isChecked(),
- matchWord->isChecked(),
- !searchBack->isChecked());
+ form_->find(tostr(find->currentText()).c_str(),
+ caseSensitive->isChecked(),
+ matchWord->isChecked(),
+ !searchBack->isChecked());
}
-void SearchDlgImpl::Replace(bool replaceall = false)
+
+void SearchDlgImpl::Replace(bool replaceall)
{
- form_->replace(tostr(find->currentText()).c_str(),
+ form_->replace(tostr(find->currentText()).c_str(),
tostr(replace->currentText()).c_str(),
caseSensitive->isChecked(),
matchWord->isChecked(),
!searchBack->isChecked(),
replaceall);
}
-
-
#ifndef SEARCHDLGIMPL_H
#define SEARCHDLGIMPL_H
+#include <config.h>
+
#include "searchdlg.h"
#include "FormSearch.h"
class SearchDlgImpl : public SearchDlg
{
- Q_OBJECT
-
-
- public:
-
- SearchDlgImpl(FormSearch * form, QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 );
-
- ~SearchDlgImpl();
-
- void setReadOnly(bool);
-
- void Replace(bool);
+ Q_OBJECT
+
+public:
+ SearchDlgImpl(FormSearch * form, QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 );
+
+ ~SearchDlgImpl();
+
+ void setReadOnly(bool);
+
+ void Replace(bool replaceall = false);
- protected:
-
- void closeEvent(QCloseEvent * e);
-
- private:
-
- FormSearch * form_;
-
- protected slots:
-
- void Find();
-
- void Replace() {
- Replace(false);
- };
-
- void ReplaceAll() {
- Replace(true);
- };
-
- void cancel_adaptor() {
- form_->close();
- hide();
- }
+protected:
+
+ void closeEvent(QCloseEvent * e);
+
+private:
+
+ FormSearch * form_;
+
+protected slots:
+
+ void Find();
+
+ void Replace() {
+ Replace(false);
+ };
+
+ void ReplaceAll() {
+ Replace(true);
+ };
+
+ void cancel_adaptor() {
+ form_->close();
+ hide();
+ }
};
#include "qtooltip.h"
TabularCreateDlgImpl::TabularCreateDlgImpl(FormTabularCreate* form, QWidget* parent, const char* name, bool modal, WFlags fl )
- : InsertTabularDlg( parent, name, modal, fl ), form_(form)
+ : InsertTabularDlg( parent, name, modal, fl ), form_(form)
{
- setCaption(name);
- table->setMinimumSize(100,100);
- rows->setValue(5);
- columns->setValue(5);
- QToolTip::add(table, _("Drag with left mouse button to resize"));
+ setCaption(name);
+ table->setMinimumSize(100,100);
+ rows->setValue(5);
+ columns->setValue(5);
+ QToolTip::add(table, _("Drag with left mouse button to resize"));
}
TabularCreateDlgImpl::~TabularCreateDlgImpl()
{
- // no need to delete child widgets, Qt does it all for us
+ // no need to delete child widgets, Qt does it all for us
}
void TabularCreateDlgImpl::insert_tabular()
{
- form_->apply((rows->text()).toInt(), (columns->text()).toInt());
- form_->close();
- hide();
+ form_->apply((rows->text()).toInt(), (columns->text()).toInt());
+ form_->close();
+ hide();
}
void TabularCreateDlgImpl::cancel_adaptor()
{
- form_->close();
- hide();
+ form_->close();
+ hide();
}
void TabularCreateDlgImpl::colsChanged(int nr_cols)
{
- if (nr_cols != (columns->text()).toInt())
- columns->setValue(nr_cols);
+ if (nr_cols != (columns->text()).toInt())
+ columns->setValue(nr_cols);
}
void TabularCreateDlgImpl::rowsChanged(int nr_rows)
{
- if (nr_rows != (rows->text()).toInt())
- rows->setValue(nr_rows);
+ if (nr_rows != (rows->text()).toInt())
+ rows->setValue(nr_rows);
}
-
class TabularCreateDlgImpl : public InsertTabularDlg
{
- Q_OBJECT
+ Q_OBJECT
public:
- TabularCreateDlgImpl(FormTabularCreate *form, QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 );
- ~TabularCreateDlgImpl();
+ TabularCreateDlgImpl(FormTabularCreate *form, QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 );
+ ~TabularCreateDlgImpl();
protected slots:
- void insert_tabular();
- void cancel_adaptor();
- virtual void colsChanged(int);
- virtual void rowsChanged(int);
+ void insert_tabular();
+ void cancel_adaptor();
+ virtual void colsChanged(int);
+ virtual void rowsChanged(int);
private:
- FormTabularCreate * form_;
+ FormTabularCreate * form_;
};
#endif // TABULARCREATEDLGIMPL_H
}
+#else // ENABLE_NLS
+
+void locale_init()
+{
+}
+
+void gettext_init(string const &)
+{
+}
#endif
char const * _(char const *);
///
string const _(string const &);
-///
-void locale_init();
-///
-void gettext_init(string const & localedir);
-#else
+#else // ENABLE_NLS
+
///
# define _(str) (str)
///
# define S_(str) (str)
-///
-# define locale_init()
-///
-# define gettext_init(localedir)
#endif
# define N_(str) (str) // for detecting static strings
+///
+void locale_init();
+///
+void gettext_init(string const & localedir);
+
#endif
+2001-06-02 John Levon <moz@compsoc.man.ac.uk>
+
+ * insettheorem.C:
+ * insetminipage.C:
+ * insetlist.C:
+ * insetfootlike.C:
+ * insetfloat.C:
+ * insetert.C:
+ * insetcollapsable.C:
+ * insetcaption.C: LColor tidy
+
2001-06-01 Lars Gullik Bjønnes <larsbj@birdstep.com>
* figinset.C: fix typo
2001-05-16 Ruurd Reitsma <r.a.reitsma@wbmt.tudelft.nl>
- * figinset.C
+ * figinset.C:
* insetbib.C: fix path for OS/2 & Win32
2001-05-10 Lars Gullik Bjønnes <larsbj@birdstep.com>
{
SetAutoBreakRows(true);
SetDrawFrame(0, InsetText::LOCKED);
- SetFrameColor(0, LColor::footnoteframe);
+ SetFrameColor(0, LColor::captionframe);
}
autocollapse = true;
inset.SetAutoBreakRows(true);
inset.SetDrawFrame(0, InsetText::ALWAYS);
- inset.SetFrameColor(0, LColor::footnoteframe);
+ inset.SetFrameColor(0, LColor::collapsableframe);
button_length = button_top_y = button_bottom_y = 0;
setInsetName("Collapsable");
widthCollapsed = oldWidth = 0;
return inset.getLabelList();
}
+
bool InsetCollapsable::nodraw() const
{
return inset.nodraw();
}
+
int InsetCollapsable::scroll(bool recursive) const
{
int sx = UpdatableInset::scroll(false);
labelfont = LyXFont(LyXFont::ALL_SANE);
labelfont.decSize();
labelfont.decSize();
- labelfont.setColor(LColor::ert);
+ labelfont.setColor(LColor::latex);
setAutoCollapse(false);
setInsetName("ERT");
}
LyXFont font(LyXFont::ALL_SANE);
font.decSize();
font.decSize();
- font.setColor(LColor::footnote);
+ font.setColor(LColor::collapsable);
setLabelFont(font);
setAutoCollapse(false);
floatType_ = type;
LyXFont font(LyXFont::ALL_SANE);
font.decSize();
font.decSize();
- font.setColor(LColor::footnote);
+ font.setColor(LColor::collapsable);
setLabelFont(font);
setAutoCollapse(false);
}
LyXFont font(LyXFont::ALL_SANE);
font.decSize();
font.decSize();
- font.setColor(LColor::footnote);
+ font.setColor(LColor::collapsable);
setLabelFont(font);
setAutoCollapse(false);
setInsetName("List");
LyXFont font(LyXFont::ALL_SANE);
font.decSize();
font.decSize();
- font.setColor(LColor::footnote);
+ font.setColor(LColor::collapsable);
setLabelFont(font);
setAutoCollapse(false);
setInsetName("Minipage");
LyXFont font(LyXFont::ALL_SANE);
font.decSize();
font.decSize();
- font.setColor(LColor::footnote);
+ font.setColor(LColor::collapsable);
setLabelFont(font);
setAutoCollapse(false);
setInsetName("Theorem");