<x>0</x>
<y>0</y>
<width>369</width>
- <height>497</height>
+ <height>525</height>
</rect>
</property>
<property stdset="1">
<name>spacing</name>
<number>6</number>
</property>
+ <widget>
+ <class>QLineEdit</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>searchED</cstring>
+ </property>
+ </widget>
<widget>
<class>QLayoutWidget</class>
<property stdset="1">
<name>name</name>
- <cstring>Layout35</cstring>
+ <cstring>Layout37</cstring>
</property>
<hbox>
<property stdset="1">
<number>6</number>
</property>
<widget>
- <class>QLineEdit</class>
+ <class>QCheckBox</class>
<property stdset="1">
<name>name</name>
- <cstring>searchED</cstring>
+ <cstring>searchTypeCB</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>Regular E&xpression</string>
</property>
</widget>
+ <spacer>
+ <property>
+ <name>name</name>
+ <cstring>Spacer2_2</cstring>
+ </property>
+ <property stdset="1">
+ <name>orientation</name>
+ <enum>Horizontal</enum>
+ </property>
+ <property stdset="1">
+ <name>sizeType</name>
+ <enum>Expanding</enum>
+ </property>
+ <property>
+ <name>sizeHint</name>
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
<widget>
<class>QPushButton</class>
<property stdset="1">
<class>QLayoutWidget</class>
<property stdset="1">
<name>name</name>
- <cstring>Layout36</cstring>
+ <cstring>Layout38</cstring>
</property>
<hbox>
<property stdset="1">
<number>6</number>
</property>
<widget>
- <class>QPushButton</class>
+ <class>QCheckBox</class>
<property stdset="1">
<name>name</name>
- <cstring>searchTypePB</cstring>
+ <cstring>searchCaseCB</cstring>
</property>
<property stdset="1">
<name>text</name>
- <string>Simple</string>
- </property>
- <property stdset="1">
- <name>toggleButton</name>
- <bool>true</bool>
- </property>
- <property stdset="1">
- <name>toggleButton</name>
- <bool>true</bool>
+ <string>&Case sensitive</string>
</property>
</widget>
<spacer>
<property>
<name>name</name>
- <cstring>Spacer2_2</cstring>
+ <cstring>Spacer3_2</cstring>
</property>
<property stdset="1">
<name>orientation</name>
<receiver>FormCitationDialog</receiver>
<slot>slotRestoreClicked()</slot>
</connection>
- <connection>
- <sender>searchTypePB</sender>
- <signal>toggled(bool)</signal>
- <receiver>FormCitationDialog</receiver>
- <slot>slotSearchTypeSelected(bool)</slot>
- </connection>
<connection>
<sender>previousPB</sender>
<signal>clicked()</signal>
/**
- * $Id: FormCitationDialogImpl.C,v 1.4 2001/03/29 21:17:17 kalle Exp $
+ * $Id: FormCitationDialogImpl.C,v 1.5 2001/03/31 08:39:24 kalle Exp $
*/
#include "FormCitationDialogImpl.h"
#include "controllers/biblio.h"
#include "controllers/ControlCitation.h"
+#include <qcheckbox.h>
#include <qlineedit.h>
#include <qlistbox.h>
#include <qmultilineedit.h>
void FormCitationDialogImpl::slotBibSelected( int sel )
{
biblio::InfoMap const & theMap = form_->controller().bibkeysInfo();
-
+
citeLB->clearSelection();
-
+
if (sel < 0 || sel >= (int)form_->bibkeys.size()) {
form_->bc().input( ButtonPolicy::SMI_NOOP );
return;
}
-
+
// Put into browser_info the additional info associated with
// the selected browser_bib key
infoML->clear();
-
+
infoML->setText( biblio::getInfo( theMap,
form_->bibkeys[sel-1] ).c_str() );
// Highlight the selected browser_bib key in browser_cite if
// present
vector<string>::const_iterator cit =
- std::find(form_->citekeys.begin(), form_->citekeys.end(),
+ std::find(form_->citekeys.begin(), form_->citekeys.end(),
form_->bibkeys[sel]);
-
+
if (cit != form_->citekeys.end()) {
int const n = int(cit - form_->citekeys.begin());
citeLB->setSelected( n, true );
citeLB->setTopItem( n );
}
-
+
if (!form_->controller().isReadonly()) {
if (cit != form_->citekeys.end()) {
form_->setBibButtons(FormCitation::OFF);
form_->bc().input( ButtonPolicy::SMI_NOOP );
return;
}
-
+
if (!form_->controller().isReadonly()) {
form_->setBibButtons(FormCitation::OFF);
form_->setCiteButtons(FormCitation::ON);
}
-
+
// Highlight the selected browser_cite key in browser_bib
vector<string>::const_iterator cit =
std::find(form_->bibkeys.begin(), form_->bibkeys.end(), form_->citekeys[sel]);
-
+
if (cit != form_->bibkeys.end()) {
int const n = int(cit - form_->bibkeys.begin());
bibLB->setSelected( n, true );
bibLB->setTopItem( n );
-
+
// Put into browser_info the additional info associated
// with the selected browser_cite key
infoML->clear();
form_->bc().input( ButtonPolicy::SMI_NOOP );
return;
}
-
+
// Add the selected browser_bib key to browser_cite
citeLB->insertItem( form_->bibkeys[sel].c_str() );
form_->citekeys.push_back( form_->bibkeys[sel] );
int const n = int(form_->citekeys.size());
citeLB->setSelected( n-1, true );
-
+
form_->setBibButtons(FormCitation::OFF);
form_->setCiteButtons(FormCitation::ON);
form_->bc().input( ButtonPolicy::SMI_NOOP );
return;
}
-
+
// Remove the selected key from browser_cite
citeLB->removeItem( sel );
form_->citekeys.erase(form_->citekeys.begin() + sel );
-
+
form_->setBibButtons(FormCitation::ON);
form_->setCiteButtons(FormCitation::OFF);
form_->bc().input( ButtonPolicy::SMI_NOOP );
return;
}
-
+
// Move the selected key up one line
vector<string>::iterator it = form_->citekeys.begin() + sel;
string const tmp = *it;
-
+
citeLB->removeItem( sel );
form_->citekeys.erase(it);
-
+
citeLB->insertItem( tmp.c_str(), sel-1 );
citeLB->setSelected( sel-1, true );
form_->citekeys.insert(it-1, tmp);
form_->bc().input( ButtonPolicy::SMI_NOOP );
return;
}
-
+
// Move the selected key down one line
vector<string>::iterator it = form_->citekeys.begin() + sel;
string const tmp = *it;
-
+
citeLB->removeItem( sel );
form_->citekeys.erase(it);
-
+
citeLB->insertItem( tmp.c_str(), sel+1 );
citeLB->setSelected( sel+1, true );
form_->citekeys.insert(it+1, tmp);
form_->setCiteButtons(FormCitation::ON);
-
- form_->bc().input( ButtonPolicy::SMI_VALID );
-}
-
-void FormCitationDialogImpl::slotSearchTypeToggled( bool toggle )
-{
- if( toggle )
- searchTypePB->setText( _( "Regex" ) );
- else
- searchTypePB->setText( _( "Simple" ) );
-
- form_->bc().input( ButtonPolicy::SMI_NOOP );
+ form_->bc().input( ButtonPolicy::SMI_VALID );
}
void FormCitationDialogImpl::slotPreviousClicked()
{
doPreviousNext( false );
-}
+}
void FormCitationDialogImpl::slotNextClicked()
{
doPreviousNext( true );
-}
+}
void FormCitationDialogImpl::doPreviousNext( bool next )
{
biblio::InfoMap const & theMap = form_->controller().bibkeysInfo();
string const str = searchED->text().latin1();
-
+
biblio::Direction const dir =
next ?
biblio::FORWARD : biblio::BACKWARD;
-
+
biblio::Search const type =
- searchTypePB->isOn() ?
+ searchTypeCB->isChecked() ?
biblio::REGEX : biblio::SIMPLE;
-
+
vector<string>::const_iterator start = form_->bibkeys.begin();
int const sel = bibLB->currentItem();
if (sel >= 0 && sel <= int(form_->bibkeys.size()-1))
start += sel;
-
+
// Find the NEXT instance...
if (dir == biblio::FORWARD)
start += 1;
else
start -= 1;
-
+
+ bool const caseSensitive = searchCaseCB->isChecked();
+
vector<string>::const_iterator const cit =
biblio::searchKeys(theMap, form_->bibkeys, str,
- start, type, dir);
-
+ start, type, dir, caseSensitive );
+
if (cit == form_->bibkeys.end()) {
form_->bc().input( ButtonPolicy::SMI_NOOP );
return;
}
-
+
int const found = int(cit - form_->bibkeys.begin());
if (found == sel) {
form_->bc().input( ButtonPolicy::SMI_NOOP );
return;
}
-
+
// Update the display
int const top = max(found-5, 1);
bibLB->setTopItem( top );
bibLB->setSelected( found, true );
slotBibSelected( 0 );
-
+
form_->bc().input( ButtonPolicy::SMI_VALID );
}
#include "ViewBase.h"
#include "LString.h"
#include "ButtonPolicies.h"
+#include "ControlButton.h"
class qt2BC;
Q_OBJECT
public:
///
- Qt2Base(ControlButton &, string const &);
+ Qt2Base(::ControlButton &, const QString &);
///
virtual ~Qt2Base() {}
private:
/// dialog title, displayed by WM.
- string title_;
+ QString title_;
};
{
protected:
///
- Qt2DB(ControlButton &, string const &);
+ Qt2DB(::ControlButton &, const QString&);
/// Pointer to the actual instantiation of the Qt dialog
virtual QDialog* form() const;
/// Real GUI implementation.
template <class Dialog>
-Qt2DB<Dialog>::Qt2DB(ControlButton & c, string const & t)
+Qt2DB<Dialog>::Qt2DB(::ControlButton & c, const QString& t)
: Qt2Base(c, t)
{}
{
protected:
///
- Qt2CB(ControlButton &, string const &);
+ Qt2CB(::ControlButton &, const QString&);
/// The parent controller
Controller & controller() const;
};
template <class Controller, class Base>
-Qt2CB<Controller, Base>::Qt2CB(ControlButton & c, string const & t)
+Qt2CB<Controller, Base>::Qt2CB(::ControlButton & c, const QString& t)
: Base(c, t)
{}