From c5a0750890f2f05f31dda0f4ac0de36a7f6e93df Mon Sep 17 00:00:00 2001 From: Kalle Dalheimer Date: Mon, 26 Mar 2001 19:34:45 +0000 Subject: [PATCH] Applied Angus patch to compile on DEC C++ and to avoid name clashes git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@1830 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/qt2/Dialogs.C | 11 +- src/frontends/qt2/FileDialog_private.C | 12 +- src/frontends/qt2/FormBase.C | 120 -------------------- src/frontends/qt2/FormCharacter.C | 11 +- src/frontends/qt2/FormCitation.C | 20 ++-- src/frontends/qt2/FormCitation.h | 4 +- src/frontends/qt2/FormCitationDialogImpl.C | 53 +++++---- src/frontends/qt2/FormCopyright.C | 2 +- src/frontends/qt2/FormCopyright.h | 4 +- src/frontends/qt2/FormParagraph.C | 1 + src/frontends/qt2/FormSplash.C | 6 +- src/frontends/qt2/FormTabularCreate.C | 14 ++- src/frontends/qt2/Makefile.am | 11 +- src/frontends/qt2/Qt2Base.C | 110 ++++++++++++++++++ src/frontends/qt2/{FormBase.h => Qt2Base.h} | 28 ++--- src/frontends/qt2/chardlgimpl.h | 4 +- src/frontends/qt2/searchdlg.C | 7 +- src/frontends/qt2/searchdlg.h | 2 +- src/frontends/qt2/searchdlg.ui | 11 +- src/frontends/qt2/searchdlgimpl.C | 6 +- 20 files changed, 220 insertions(+), 217 deletions(-) delete mode 100644 src/frontends/qt2/FormBase.C create mode 100644 src/frontends/qt2/Qt2Base.C rename src/frontends/qt2/{FormBase.h => Qt2Base.h} (79%) diff --git a/src/frontends/qt2/Dialogs.C b/src/frontends/qt2/Dialogs.C index 72e71ea02d..89b1d410f2 100644 --- a/src/frontends/qt2/Dialogs.C +++ b/src/frontends/qt2/Dialogs.C @@ -20,21 +20,22 @@ #include "FormCopyrightDialogImpl.h" #undef emit +#include "../xforms/FormCredits.h" +#include "../xforms/FormError.h" +#include "../xforms/FormGraphics.h" +#include "../xforms/FormPreferences.h" +#include "../xforms/FormTabular.h" + #include "FormCharacter.h" #include "FormCitation.h" -#include "FormCredits.h" #include "FormCopyright.h" //#include "FormDocument.h" -#include "FormError.h" -#include "FormGraphics.h" //#include "FormIndex.h" #include "FormParagraph.h" -#include "FormPreferences.h" #include "FormPrint.h" //#include "FormRef.h" #include "FormSearch.h" #include "FormSplash.h" -#include "FormTabular.h" #include "FormTabularCreate.h" //#include "FormToc.h" //#include "FormUrl.h" diff --git a/src/frontends/qt2/FileDialog_private.C b/src/frontends/qt2/FileDialog_private.C index e63d770c88..3d7e4f6f14 100644 --- a/src/frontends/qt2/FileDialog_private.C +++ b/src/frontends/qt2/FileDialog_private.C @@ -9,13 +9,13 @@ #include #include "LString.h" - -#include + +#include #include - + #include "QtLyXView.h" #include "debug.h" - + #include "FileDialog_private.h" LyXFileDialog::LyXFileDialog(LyXView * lv, kb_action a, string const & p, string const & m, string const & t) @@ -28,8 +28,8 @@ LyXFileDialog::LyXFileDialog(LyXView * lv, kb_action a, string const & p, string void LyXFileDialog::done(int what) { - lyxerr[Debug::GUI] << "Done FileDialog, value " << what << endl; - + lyxerr[Debug::GUI] << "Done FileDialog, value " << what << std::endl; + if (action_ == LFUN_SELECT_FILE_SYNC) { QDialog::done(what); return; diff --git a/src/frontends/qt2/FormBase.C b/src/frontends/qt2/FormBase.C deleted file mode 100644 index cb2d5cf3ae..0000000000 --- a/src/frontends/qt2/FormBase.C +++ /dev/null @@ -1,120 +0,0 @@ -// -*- C++ -*- -/* This file is part of - * ====================================================== - * - * LyX, The Document Processor - * - * Copyright 2000 The LyX Team. - * - * ====================================================== - * - * \author Angus Leeming - */ - -#include - -#ifdef __GNUG__ -#pragma implementation -#endif - -#include -#undef emit - -#include "Dialogs.h" -#include "FormBase.h" -#include "qt2BC.h" -#include "support/LAssert.h" - -#include - - -FormBase::FormBase(ControlBase & c, string const & t) - : ViewBC(c), title_(t) -{} - - - -void FormBase::show() -{ - fprintf( stderr, "FormBase::show() 1\n" ); - if (!form()) { - fprintf( stderr, "FormBase::show() 2\n" ); - build(); - fprintf( stderr, "FormBase::show() 3\n" ); - } - fprintf( stderr, "FormBase::show() 4\n" ); - - update(); // make sure its up-to-date - fprintf( stderr, "FormBase::show() 5\n" ); - - if (form()->isVisible()) { - fprintf( stderr, "FormBase::show() 6\n" ); - form()->raise(); - fprintf( stderr, "FormBase::show() 7\n" ); - } else { - fprintf( stderr, "FormBase::show() 8\n" ); - form()->setCaption( title_.c_str() ); - fprintf( stderr, "FormBase::show() 9\n" ); - form()->show(); - fprintf( stderr, "FormBase::show() 10\n" ); - } -} - - -void FormBase::hide() -{ - if (form() && form()->isVisible() ) - form()->hide(); -} - - -// PENDING(kalle) Handle this with QValidator? -// void FormBase::InputCB(FL_OBJECT * ob, long data) -// { -// bc().input(input(ob, data)); -// } - - -ButtonPolicy::SMInput FormBase::input(QWidget*, long) -{ - return ButtonPolicy::SMI_VALID; -} - - - -void FormBase::slotWMHide() -{ - CancelButton(); -} - - - -void FormBase::slotApply() -{ - ApplyButton(); -} - - -void FormBase::slotOK() -{ - OKButton(); -} - - -void FormBase::slotCancel() -{ - CancelButton(); -} - - -void FormBase::slotRestore() -{ - RestoreButton(); -} - - -// PENDING(kalle) How to handle this? -// extern "C" void C_FormBaseInputCB(FL_OBJECT * ob, long d) -// { -// GetForm(ob)->InputCB(ob, d); -// } diff --git a/src/frontends/qt2/FormCharacter.C b/src/frontends/qt2/FormCharacter.C index 2119d7fafe..05262d2a75 100644 --- a/src/frontends/qt2/FormCharacter.C +++ b/src/frontends/qt2/FormCharacter.C @@ -19,6 +19,7 @@ #include "language.h" #include "support/lstrings.h" +using SigC::slot; using Liason::setMinibuffer; FormCharacter::FormCharacter(LyXView *v, Dialogs *d) @@ -43,9 +44,9 @@ void FormCharacter::apply() { if (!lv_->view()->available() || !dialog_) return; - + LyXFont font = dialog_->getChar(); - + if (dialog_->langItem()==1) font.setLanguage(lv_->buffer()->params.language); @@ -71,7 +72,7 @@ void FormCharacter::show() h_ = d_->hideBufferDependent.connect(slot(this, &FormCharacter::hide)); u_ = d_->updateBufferDependent.connect(slot(this, &FormCharacter::update)); } - + dialog_->raise(); dialog_->setActiveWindow(); update(); @@ -92,9 +93,9 @@ void FormCharacter::hide() void FormCharacter::update(bool) { - + if (!lv_->view()->available()) return; - + dialog_->setReadOnly(lv_->buffer()->isReadonly()); } diff --git a/src/frontends/qt2/FormCitation.C b/src/frontends/qt2/FormCitation.C index 4ee7fdc03b..632e8452c6 100644 --- a/src/frontends/qt2/FormCitation.C +++ b/src/frontends/qt2/FormCitation.C @@ -35,9 +35,11 @@ #include #include +using SigC::slot; using std::vector; using std::pair; using std::find; +using std::sort; FormCitation::FormCitation(LyXView *v, Dialogs *d) : dialog_(0), lv_(v), d_(d), inset_(0), ih_(0) @@ -58,11 +60,11 @@ FormCitation::~FormCitation() void FormCitation::showCitation(InsetCommand * inset) { if (inset == 0) return; // maybe we should Assert this? - + // If connected to another inset, disconnect from it. if (inset_) ih_.disconnect(); - + inset_ = inset; params = inset->params(); ih_ = inset->hideDialog.connect(slot(this, &FormCitation::hide)); @@ -72,11 +74,11 @@ void FormCitation::showCitation(InsetCommand * inset) void FormCitation::createCitation(string const & arg) { - if (inset_) { + if (inset_) { ih_.disconnect(); inset_ = 0; } - + params.setFromString(arg); show(); } @@ -96,7 +98,7 @@ void FormCitation::show() dialog_ = new FormCitationDialogImpl(this, 0, _("LyX: Citation Reference"), false); dialog_->show(); - + update(); } @@ -117,7 +119,7 @@ void FormCitation::update() blist.clear(); updateBrowser(dialog_->bibliographyKeysLB, bibkeys); - + // Ditto for the keys cited in this inset citekeys.clear(); string tmp, keys(params.getContents()); @@ -161,7 +163,7 @@ void FormCitation::setCiteButtons(State status) const bool const activate = (status == ON); bool const activate_up = (activate && sel != 1); bool const activate_down = (activate && sel != maxline); - + dialog_->stopPB->setEnabled(activate); dialog_->upPB->setEnabled(activate_up); dialog_->downPB->setEnabled(activate_down); @@ -180,7 +182,7 @@ void FormCitation::apply() params.setContents(contents); params.setOptions( dialog_->textAfterED->text().latin1() ); - + if (inset_ != 0) { // Only update if contents have changed if (params != inset_->params()) { @@ -190,7 +192,7 @@ void FormCitation::apply() } else { lv_->getLyXFunc()->Dispatch(LFUN_CITATION_INSERT, params.getAsString()); - } + } } diff --git a/src/frontends/qt2/FormCitation.h b/src/frontends/qt2/FormCitation.h index 583b31eeec..cfb562c234 100644 --- a/src/frontends/qt2/FormCitation.h +++ b/src/frontends/qt2/FormCitation.h @@ -60,11 +60,11 @@ private: /// create a Citation inset void createCitation(string const &); /// edit a Citation inset - void showCitation(InsetCommand * const); + void showCitation(InsetCommand* ); /// update a listbox void updateBrowser( QListBox* listbox, - vector const & keys) const; + std::vector const & keys) const; /// Real GUI implementation. FormCitationDialog * dialog_; diff --git a/src/frontends/qt2/FormCitationDialogImpl.C b/src/frontends/qt2/FormCitationDialogImpl.C index 7e0c674cb0..2f3f6142d3 100644 --- a/src/frontends/qt2/FormCitationDialogImpl.C +++ b/src/frontends/qt2/FormCitationDialogImpl.C @@ -1,5 +1,5 @@ /** - * $Id: FormCitationDialogImpl.C,v 1.1 2001/03/16 17:20:06 kalle Exp $ + * $Id: FormCitationDialogImpl.C,v 1.2 2001/03/26 19:34:45 kalle Exp $ */ #include "FormCitationDialogImpl.h" @@ -14,7 +14,10 @@ #include "LyXView.h" #include "buffer.h" -// PENDING(kalle) Wire text before and citaiton style +using std::vector; +using std::find; + +// PENDING(kalle) Wire text before and citation style /* * Constructs a FormCitationDialogImpl which is a child of 'parent', with the @@ -43,8 +46,8 @@ FormCitationDialogImpl::~FormCitationDialogImpl() void FormCitationDialogImpl::slotBibSelected( int sel ) { insetKeysLB->clearSelection(); - - if( sel < 0 || sel > form_->bibkeys.size()-1) + + if( sel < 0 || sel > form_->bibkeys.size()-1) return; // Put into browser_info the additional info associated with @@ -70,13 +73,13 @@ void FormCitationDialogImpl::slotBibSelected( int sel ) form_->setCiteButtons(FormCitation::OFF); } } - + } void FormCitationDialogImpl::slotInsetSelected( int sel ) { - if (sel < 0 || sel > form_->citekeys.size() -1 ) + if (sel < 0 || sel > form_->citekeys.size() -1 ) return; if (!form_->lv_->buffer()->isReadonly()) { @@ -87,11 +90,11 @@ void FormCitationDialogImpl::slotInsetSelected( int sel ) // Highlight the selected browser_cite key in browser_bib vector::iterator it = ::find(form_->bibkeys.begin(), form_->bibkeys.end(), form_->citekeys[sel]); - + if (it != form_->bibkeys.end()) { int n = static_cast(it - form_->bibkeys.begin()); bibliographyKeysLB->setSelected( n, true ); - + // Put into browser_info the additional info associated with // the selected browser_cite key infoML->clear(); @@ -104,19 +107,19 @@ void FormCitationDialogImpl::slotAddClicked() { qDebug( "FormCitationDialogImpl::slotAddClicked()" ); int sel = bibliographyKeysLB->currentItem(); - if (sel < 0 || sel > form_->bibkeys.size() -1 ) + if (sel < 0 || sel > form_->bibkeys.size() -1 ) return; qDebug( "sel = %d" ); qDebug( "bibkeys.size() = %d", form_->bibkeys.size() ); - + // Add the selected browser_bib key to browser_cite insetKeysLB->insertItem( form_->bibkeys[sel].c_str()); form_->citekeys.push_back(form_->bibkeys[sel]); int n = static_cast(form_->citekeys.size()); insetKeysLB->setSelected( n, true ); - + form_->setBibButtons(FormCitation::OFF); form_->setCiteButtons(FormCitation::ON); } @@ -125,13 +128,13 @@ void FormCitationDialogImpl::slotAddClicked() void FormCitationDialogImpl::slotDelClicked() { int sel = insetKeysLB->currentItem(); - if (sel < 0 || sel > form_->citekeys.size()-1) + if (sel < 0 || sel > form_->citekeys.size()-1) return; - + // Remove the selected key from browser_cite insetKeysLB->removeItem( sel ); form_->citekeys.erase(form_->citekeys.begin() + sel); - + form_->setBibButtons(FormCitation::ON); form_->setCiteButtons(FormCitation::OFF); } @@ -140,16 +143,16 @@ void FormCitationDialogImpl::slotDelClicked() void FormCitationDialogImpl::slotUpClicked() { int sel = insetKeysLB->currentItem(); - if (sel < 1 || sel > form_->citekeys.size()-1) + if (sel < 1 || sel > form_->citekeys.size()-1) return; - + // Move the selected key up one line vector::iterator it = form_->citekeys.begin() + sel; string tmp = *it; - + insetKeysLB->removeItem( sel ); form_->citekeys.erase(it); - + insetKeysLB->insertItem( tmp.c_str(), sel-1 ); insetKeysLB->setSelected( sel-1, true ); form_->citekeys.insert(it-1, tmp); @@ -160,13 +163,13 @@ void FormCitationDialogImpl::slotUpClicked() void FormCitationDialogImpl::slotDownClicked() { int sel = insetKeysLB->currentItem(); - if (sel < 0 || sel > form_->citekeys.size()-2) + if (sel < 0 || sel > form_->citekeys.size()-2) return; - + // Move the selected key down one line vector::iterator it = form_->citekeys.begin() + sel; string tmp = *it; - + insetKeysLB->removeItem( sel ); form_->citekeys.erase(it); @@ -177,13 +180,13 @@ void FormCitationDialogImpl::slotDownClicked() } -void FormCitationDialogImpl::apply_adaptor() +void FormCitationDialogImpl::apply_adaptor() { form_->apply(); -} - +} -void FormCitationDialogImpl::close_adaptor() + +void FormCitationDialogImpl::close_adaptor() { form_->close(); hide(); diff --git a/src/frontends/qt2/FormCopyright.C b/src/frontends/qt2/FormCopyright.C index a76a7deb0d..67473e5afa 100644 --- a/src/frontends/qt2/FormCopyright.C +++ b/src/frontends/qt2/FormCopyright.C @@ -26,7 +26,7 @@ #include "ControlCopyright.h" #include "FormCopyright.h" -typedef FormCB > base_class; +typedef Qt2CB > base_class; FormCopyright::FormCopyright( ControlCopyright& c ) : base_class( c, _( "Copyright and Warranty" ) ) diff --git a/src/frontends/qt2/FormCopyright.h b/src/frontends/qt2/FormCopyright.h index 1c8348d7aa..cf89fafce7 100644 --- a/src/frontends/qt2/FormCopyright.h +++ b/src/frontends/qt2/FormCopyright.h @@ -18,7 +18,7 @@ #ifndef FORMCOPYRIGHT_H #define FORMCOPYRIGHT_H -#include "FormBase.h" +#include "Qt2Base.h" #include "boost/utility.hpp" class Dialogs; @@ -30,7 +30,7 @@ class ControlCopyright; @author Kalle Dalheimer */ class FormCopyright - : public FormCB > + : public Qt2CB > { public: FormCopyright( ControlCopyright& ); diff --git a/src/frontends/qt2/FormParagraph.C b/src/frontends/qt2/FormParagraph.C index 2af1642633..ecb65b8bcc 100644 --- a/src/frontends/qt2/FormParagraph.C +++ b/src/frontends/qt2/FormParagraph.C @@ -19,6 +19,7 @@ #include "lyxtext.h" #include "debug.h" +using SigC::slot; using Liason::setMinibuffer; using std::endl; diff --git a/src/frontends/qt2/FormSplash.C b/src/frontends/qt2/FormSplash.C index cba4f39f9b..99f4f44fa5 100644 --- a/src/frontends/qt2/FormSplash.C +++ b/src/frontends/qt2/FormSplash.C @@ -20,7 +20,7 @@ FormSplash::FormSplash(LyXView *, Dialogs * d) : dialog_(0), d_(d) { - c_ = d->showSplash.connect(slot(this, &FormSplash::show)); + c_ = d->showSplash.connect(SigC::slot(this, &FormSplash::show)); } @@ -39,10 +39,10 @@ void FormSplash::show() { if (!lyxrc.show_banner) return; - + if (!dialog_) dialog_ = new FormSplashBase( 0, "LyX"); - + // show banner dialog_->show(); } diff --git a/src/frontends/qt2/FormTabularCreate.C b/src/frontends/qt2/FormTabularCreate.C index 553f9b0517..82693a6d65 100644 --- a/src/frontends/qt2/FormTabularCreate.C +++ b/src/frontends/qt2/FormTabularCreate.C @@ -2,7 +2,7 @@ * \file FormTabularCreate.C * Copyright 2001 LyX Team * see the file COPYING - * + * * \author John Levon, moz@compsoc.man.ac.uk */ @@ -14,9 +14,11 @@ #include "gettext.h" #include "QtLyXView.h" #include "BufferView.h" -#include "insets/insettabular.h" +#include "insets/insettabular.h" #include "support/lstrings.h" +using SigC::slot; + FormTabularCreate::FormTabularCreate(LyXView *v, Dialogs *d) : dialog_(0), lv_(v), d_(d), h_(0) { @@ -35,7 +37,7 @@ void FormTabularCreate::apply(int rows, int cols) { if (!lv_->view()->available()) return; - + string tmp = tostr(rows) + " " + tostr(cols); lv_->getLyXFunc()->Dispatch(LFUN_INSET_TABULAR, tmp); } @@ -44,14 +46,14 @@ void FormTabularCreate::show() { if (!dialog_) dialog_ = new TabularCreateDlgImpl(this, 0, _("LyX: Insert Table")); - + if (!dialog_->isVisible()) { h_ = d_->hideBufferDependent.connect(slot(this, &FormTabularCreate::hide)); } - + dialog_->raise(); dialog_->setActiveWindow(); - + update(); dialog_->show(); } diff --git a/src/frontends/qt2/Makefile.am b/src/frontends/qt2/Makefile.am index 399ccd86e8..3fa353c314 100644 --- a/src/frontends/qt2/Makefile.am +++ b/src/frontends/qt2/Makefile.am @@ -5,14 +5,13 @@ noinst_LTLIBRARIES = libqt2.la BOOST_INCLUDES = -I$(top_srcdir)/boost INCLUDES = -I${top_srcdir}/src/ -I${top_srcdir}/src/frontends/ \ ${SIGC_CFLAGS} ${FRONTEND_INCLUDES} $(BOOST_INCLUDES) \ - -I${top_srcdir}/src/frontends/xforms \ -I$(top_srcdir)/src/frontends/controllers -CXXFLAGS += -DQT_CLEAN_NAMESPACE -fno-rtti -fno-exceptions +DEFINES += -DQT_CLEAN_NAMESPACE # moc generated files BUILTSOURCES = \ moc_FileDialog_private.C \ - moc_FormBase.C \ + moc_Qt2Base.C \ moc_FormCitationDialog.C \ moc_FormCitationDialogImpl.C \ moc_FormCopyrightDialog.C \ @@ -100,8 +99,8 @@ libqt2_la_SOURCES = \ chardlgimpl.h \ FileDialog.C \ FileDialog_private.C \ - FormBase.C \ - FormBase.h \ + Qt2Base.C \ + Qt2Base.h \ FormCitation.C \ FormCitation.h \ FormCitationDialog.C \ @@ -161,7 +160,7 @@ dist-hook: done ; \ done -moc_FormBase.C: FormBase.h +moc_Qt2Base.C: Qt2Base.h $(MOC) -o $@ $< FormCitation.C: FormCitationDialog.h diff --git a/src/frontends/qt2/Qt2Base.C b/src/frontends/qt2/Qt2Base.C new file mode 100644 index 0000000000..9b53697936 --- /dev/null +++ b/src/frontends/qt2/Qt2Base.C @@ -0,0 +1,110 @@ +// -*- C++ -*- +/* This file is part of + * ====================================================== + * + * LyX, The Document Processor + * + * Copyright 2000 The LyX Team. + * + * ====================================================== + * + * \author Angus Leeming + */ + +#include + +#ifdef __GNUG__ +#pragma implementation +#endif + +#include +#undef emit + +#include "Dialogs.h" +#include "Qt2Base.h" +#include "qt2BC.h" +#include "support/LAssert.h" + +#include + + +Qt2Base::Qt2Base(ControlBase & c, string const & t) + : ViewBC(c), title_(t) +{} + + + +void Qt2Base::show() +{ + if (!form()) { + build(); + } + + update(); // make sure its up-to-date + + if (form()->isVisible()) { + form()->raise(); + } else { + form()->setCaption( title_.c_str() ); + form()->show(); + } +} + + +void Qt2Base::hide() +{ + if (form() && form()->isVisible() ) + form()->hide(); +} + + +// PENDING(kalle) Handle this with QValidator? +// void Qt2Base::InputCB(FL_OBJECT * ob, long data) +// { +// bc().input(input(ob, data)); +// } + + +ButtonPolicy::SMInput Qt2Base::input(QWidget*, long) +{ + return ButtonPolicy::SMI_VALID; +} + + + +void Qt2Base::slotWMHide() +{ + CancelButton(); +} + + + +void Qt2Base::slotApply() +{ + ApplyButton(); +} + + +void Qt2Base::slotOK() +{ + OKButton(); +} + + +void Qt2Base::slotCancel() +{ + CancelButton(); +} + + +void Qt2Base::slotRestore() +{ + RestoreButton(); +} + + +// PENDING(kalle) How to handle this? +// extern "C" void C_Qt2BaseInputCB(FL_OBJECT * ob, long d) +// { +// GetForm(ob)->InputCB(ob, d); +// } diff --git a/src/frontends/qt2/FormBase.h b/src/frontends/qt2/Qt2Base.h similarity index 79% rename from src/frontends/qt2/FormBase.h rename to src/frontends/qt2/Qt2Base.h index c48c03e0c3..e711bb6765 100644 --- a/src/frontends/qt2/FormBase.h +++ b/src/frontends/qt2/Qt2Base.h @@ -11,8 +11,8 @@ * \author Angus Leeming */ -#ifndef FORMBASE_H -#define FORMBASE_H +#ifndef QT2BASE_H +#define QT2BASE_H #include @@ -33,14 +33,14 @@ class qt2BC; /** This class is an Qt2 GUI base class. */ -class FormBase : public QObject, public ViewBC +class Qt2Base : public QObject, public ViewBC { Q_OBJECT public: /// - FormBase(ControlBase &, string const &); + Qt2Base(ControlBase &, string const &); /// - virtual ~FormBase() {} + virtual ~Qt2Base() {} protected: /// Build the dialog @@ -80,11 +80,11 @@ private: template -class FormDB: public FormBase +class Qt2DB: public Qt2Base { protected: /// - FormDB(ControlBase &, string const &); + Qt2DB(ControlBase &, string const &); /// Pointer to the actual instantiation of the Qt dialog virtual QDialog* form() const; /// Real GUI implementation. @@ -93,37 +93,37 @@ protected: template -FormDB::FormDB(ControlBase & c, string const & t) - : FormBase(c, t) +Qt2DB::Qt2DB(ControlBase & c, string const & t) + : Qt2Base(c, t) {} template -QDialog* FormDB::form() const +QDialog* Qt2DB::form() const { return dialog_.get(); } template -class FormCB: public Base +class Qt2CB: public Base { protected: /// - FormCB(ControlBase &, string const &); + Qt2CB(ControlBase &, string const &); /// The parent controller Controller & controller() const; }; template -FormCB::FormCB(ControlBase & c, string const & t) +Qt2CB::Qt2CB(ControlBase & c, string const & t) : Base(c, t) {} template -Controller & FormCB::controller() const +Controller & Qt2CB::controller() const { return static_cast(controller_); //return dynamic_cast(controller_); diff --git a/src/frontends/qt2/chardlgimpl.h b/src/frontends/qt2/chardlgimpl.h index c6894dc4af..67169f0eb3 100644 --- a/src/frontends/qt2/chardlgimpl.h +++ b/src/frontends/qt2/chardlgimpl.h @@ -32,11 +32,11 @@ class CharDlgImpl : public CharDlg LyXFont getChar(); int langItem() { - lang->currentItem(); + return lang->currentItem(); }; bool toggleAll() { - toggleall->isChecked(); + return toggleall->isChecked(); }; void setReadOnly(bool); diff --git a/src/frontends/qt2/searchdlg.C b/src/frontends/qt2/searchdlg.C index 11d8221b03..ac2ac088ef 100644 --- a/src/frontends/qt2/searchdlg.C +++ b/src/frontends/qt2/searchdlg.C @@ -1,13 +1,14 @@ /**************************************************************************** ** Form implementation generated from reading ui file 'searchdlg.ui' ** -** Created: Sun Mar 4 21:52:22 2001 +** Created: Mon Mar 26 21:50:02 2001 ** by: The User Interface Compiler (uic) ** ** WARNING! All changes made in this file will be lost! ****************************************************************************/ #include "searchdlg.h" +#include #include #include #include @@ -29,7 +30,7 @@ SearchDlg::SearchDlg( QWidget* parent, const char* name, bool modal, WFlags fl { if ( !name ) setName( "SearchDlg" ); - resize( 379, 168 ); + resize( 388, 168 ); setCaption( tr( "Form1" ) ); setSizeGripEnabled( TRUE ); SearchDlgLayout = new QGridLayout( this ); @@ -43,9 +44,9 @@ SearchDlg::SearchDlg( QWidget* parent, const char* name, bool modal, WFlags fl find = new QComboBox( FALSE, this, "find" ); find->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, find->sizePolicy().hasHeightForWidth() ) ); + find->setFocusPolicy( QComboBox::StrongFocus ); find->setEditable( TRUE ); find->setDuplicatesEnabled( TRUE ); - find->setFocusPolicy( QComboBox::StrongFocus ); SearchDlgLayout->addMultiCellWidget( find, 0, 0, 1, 2 ); diff --git a/src/frontends/qt2/searchdlg.h b/src/frontends/qt2/searchdlg.h index b0df71a720..82a50a0e8d 100644 --- a/src/frontends/qt2/searchdlg.h +++ b/src/frontends/qt2/searchdlg.h @@ -1,7 +1,7 @@ /**************************************************************************** ** Form interface generated from reading ui file 'searchdlg.ui' ** -** Created: Sun Mar 4 21:52:20 2001 +** Created: Mon Mar 26 21:48:19 2001 ** by: The User Interface Compiler (uic) ** ** WARNING! All changes made in this file will be lost! diff --git a/src/frontends/qt2/searchdlg.ui b/src/frontends/qt2/searchdlg.ui index 12d5f3480a..37f43a6b11 100644 --- a/src/frontends/qt2/searchdlg.ui +++ b/src/frontends/qt2/searchdlg.ui @@ -1,5 +1,6 @@ SearchDlg +config.h QDialog @@ -11,7 +12,7 @@ 0 0 - 379 + 388 168 @@ -62,6 +63,10 @@ 0 + + focusPolicy + StrongFocus + editable true @@ -70,10 +75,6 @@ duplicatesEnabled true - - focusPolicy - StrongFocus - QLabel diff --git a/src/frontends/qt2/searchdlgimpl.C b/src/frontends/qt2/searchdlgimpl.C index 3bd75d2aab..5e48e2fda6 100644 --- a/src/frontends/qt2/searchdlgimpl.C +++ b/src/frontends/qt2/searchdlgimpl.C @@ -1,11 +1,13 @@ -/** +/** * \file searchdlgimpl.h * Copyright 2001 The LyX Team. * See the file COPYING. - * + * * \author Edwin Leuven */ +#include + #include "searchdlgimpl.h" #include