* \file QBrowseBox.C
*
* Original file taken from klyx 0.10 sources:
- * $Id: QBrowseBox.C,v 1.2 2002/10/15 17:45:12 leeming Exp $
+ * $Id: QBrowseBox.C,v 1.3 2002/10/15 18:29:01 larsbj Exp $
*
* \author Kalle Dalheimer ?
*
QBrowseBox::QBrowseBox(int rows, int cols, QWidget * parent,
- const char * name, WFlags fl)
+ char const * name, WFlags fl)
: QGridView()
{
setNumRows( rows );
setCellWidth( width()/cols );
setCellHeight( height()/rows );
- _texts = new QString[rows*cols];
- _pixmaps = new QPixmap[rows*cols];
+ _texts = new QString[rows * cols];
+ _pixmaps = new QPixmap[rows * cols];
_activecell.setX( 0 );
_activecell.setY( 0 );
return row + col*numCols();
}
-
+
void QBrowseBox::insertItem( const QString& text, int row, int col )
{
_texts[ coordsToIndex( row, col ) ] = text;
}
-
+
void QBrowseBox::insertItem( QPixmap pixmap, int row, int col )
{
_pixmaps[ coordsToIndex( row, col ) ] = pixmap;
{
int w = (pixmap.width()/numCols());
int h = (pixmap.height()/numRows());
-
+
for( int row = 0; row < numRows(); row++ )
- for( int col = 0; col < numCols(); col++ )
+ for( int col = 0; col < numCols(); col++ )
{
QPixmap small(w,h);
bitBlt(&small,0,0,&pixmap,col*w,row*h,w,h,Qt::CopyROP,false);
resize(pixmap.width() + (numCols()+1)*frameWidth(),
pixmap.height() +(numRows()+1)*frameWidth());
}
-
+
void QBrowseBox::removeItem( int row, int col )
{
_texts[ coordsToIndex( row, col ) ] = "";
_pixmaps[ coordsToIndex( row, col ) ].resize( 0, 0 );
}
-
+
void QBrowseBox::clear()
{
for( int row = 0; row < numRows(); row++ )
removeItem( row, col );
}
-
+
QString QBrowseBox::text( int row, int col )
{
if( col<0 || col >= numCols() || row<0 || row >= numRows() )
return _texts[ coordsToIndex( row, col ) ];
}
-
+
QPixmap QBrowseBox::pixmap( int row, int col )
{
static QPixmap empty;
default:
e->ignore();
}
-
+
}
void QBrowseBox::mouseReleaseEvent( QMouseEvent* e )
{
painter->setClipRect(cellGeometry(row,col));//, QPainter::CoordPainter);
bool ispixmap = false;
-
+
if( ! _pixmaps[coordsToIndex(row,col)].isNull() ) {
painter->drawPixmap(0,0,_pixmaps[coordsToIndex(row,col)]);
ispixmap = true;
int cellx;
int celly;
-
+
if( x < 0 || y < 0 || x > width() || y > height() ) {
// outside the box
cellx = -1;
// remove old highlighting
updateCell( oldactivecellx, oldactivecelly );
// set new highlighting
- updateCell( _activecell.x(), _activecell.y() );
+ updateCell( _activecell.x(), _activecell.y() );
}
}
void QBrowseBox::moveLeft( )
{
int const y = _activecell.y();
-
+
if (y>0)
_activecell.setY(y-1);
-
+
updateCell(_activecell.x(), y);
updateCell(_activecell.x(), _activecell.y());
}
void QBrowseBox::moveRight( )
{
int const y = _activecell.y();
-
+
if (y<numCols()-1)
_activecell.setY(y+1);
-
+
updateCell(_activecell.x(), y);
updateCell(_activecell.x(),_activecell.y());
}
void QBrowseBox::moveUp( )
{
int const x = _activecell.x();
-
+
if (x>0)
_activecell.setX(x-1);
-
+
updateCell(x, _activecell.y());
updateCell(_activecell.x(),_activecell.y());
}
void QBrowseBox::moveDown( )
{
int const x = _activecell.x();
-
+
if (x<numRows()-1)
_activecell.setX(x+1);
-
+
updateCell(x, _activecell.y());
updateCell(_activecell.x(),_activecell.y());
}
* \file QDocument.C
* This file is part of LyX, the document processor.
* Licence details can be found in the file COPYING.
- *
+ *
* \author Edwin Leuven
*
* Full author contact details are available in file CREDITS
dialog_->langModule->languageCO->insertItem(
lit->first.c_str());
}
-
+
dialog_->langModule->quoteStyleCO->insertItem(_("``text''"));
dialog_->langModule->quoteStyleCO->insertItem(_("''text''"));
dialog_->langModule->quoteStyleCO->insertItem(_(",,text``"));
"koi8-r","koi8-u","cp866","cp1251",
"iso88595","pt154",0};
dialog_->packagesModule->encodingCO->insertStrList(items);
-
+
dialog_->packagesModule->lspacingCO->insertItem(
_("Single"),Spacing::Single);
dialog_->packagesModule->lspacingCO->insertItem(
QString font = tex_fonts[n];
dialog_->layoutModule->fontsCO->insertItem(font);
}
-
+
dialog_->layoutModule->fontsizeCO->insertItem(_("default"));
dialog_->layoutModule->fontsizeCO->insertItem(_("10"));
dialog_->layoutModule->fontsizeCO->insertItem(_("11"));
dialog_->layoutModule->fontsizeCO->insertItem(_("12"));
-
+
dialog_->layoutModule->skipCO->insertItem(_("Smallskip"));
dialog_->layoutModule->skipCO->insertItem(_("Medskip"));
dialog_->layoutModule->skipCO->insertItem(_("Bigskip"));
string const bmtablefile = LibFileSearch("images", "standard", "xpm");
QString s = bmtablefile.c_str();
qWarning("%d",s);
-
+
// Manage the restore, ok, apply, restore and cancel/close buttons
bc().setOK(dialog_->okPB);
bc().setApply(dialog_->applyPB);
/* preamble */
controller().params().preamble =
dialog_->preambleModule->preambleMLE->text().latin1();
-
+
/* biblio */
controller().params().use_natbib =
dialog_->biblioModule->natbibCB->isChecked();
else
controller().params().quotes_times = InsetQuotes::DoubleQ;
-
+
InsetQuotes::quote_language lga = InsetQuotes::EnglishQ;
switch (dialog_->langModule->quoteStyleCO->currentItem()) {
case 0:
);
break;
}
-
+
controller().params().graphicsDriver =
dialog_->packagesModule->psdriverCO->currentText().latin1();
-
+
controller().params().use_amsmath =
dialog_->packagesModule->amsCB->isChecked();
-
+
controller().params().inputenc =
dialog_->packagesModule->encodingCO->currentText().latin1();
dialog_->layoutModule->classCO->currentItem();
//bool succes = controller().classApply();
-
+
controller().params().fonts =
dialog_->layoutModule->fontsCO->currentText().latin1();
-
+
controller().params().fontsize =
dialog_->layoutModule->fontsizeCO->currentText().latin1();
-
+
controller().params().pagestyle =
dialog_->layoutModule->pagestyleCO->currentText().latin1();
-
+
if (dialog_->layoutModule->indentRB->isChecked())
controller().params().paragraph_separation = BufferParams::PARSEP_INDENT;
else
controller().params().options =
dialog_->layoutModule->optionsLE->text().latin1();
-
+
controller().params().float_placement =
dialog_->layoutModule->floatPlacementLE->text().latin1();
/* paper */
controller().params().papersize2 =
dialog_->paperModule->papersizeCO->currentItem();
-
+
controller().params().paperwidth =
LyXLength(dialog_->paperModule->paperwidthLE->text().toDouble(),
dialog_->paperModule->paperwidthUnitCO->currentLengthItem()
controller().params().columns = 2;
else
controller().params().columns = 1;
-
+
if (dialog_->paperModule->facingPagesCB->isChecked())
controller().params().sides = LyXTextClass::TwoSides;
else
controller().params().sides = LyXTextClass::OneSide;
-
+
if (dialog_->paperModule->landscapeRB->isChecked())
controller().params().orientation = BufferParams::ORIENTATION_LANDSCAPE;
else
margin = margin - 1;
}
controller().params().paperpackage = char(margin);
-
+
controller().params().leftmargin =
LyXLength(dialog_->marginsModule->innerLE->text().toDouble(),
dialog_->marginsModule->innerUnit->currentLengthItem()
).asString();
-
+
controller().params().topmargin =
LyXLength(dialog_->marginsModule->topLE->text().toDouble(),
dialog_->marginsModule->topUnit->currentLengthItem()
controller().params().use_natbib);
dialog_->biblioModule->citeStyleCO->setCurrentItem(
controller().params().use_numerical_citations ? 1 : 0);
-
+
/* language & quotes */
dialog_->langModule->singleQuoteRB->setChecked(
controller().params().quotes_times == InsetQuotes::SingleQ);
dialog_->langModule->doubleQuoteRB->setChecked(
controller().params().quotes_times == InsetQuotes::DoubleQ);
-
+
int const pos = int(findPos(lang_,
controller().params().language->lang()));
dialog_->langModule->languageCO->setCurrentItem(pos);
}
++pos2;
}
-
-
+
+
QString text = controller().params().graphicsDriver.c_str();
int nitem = dialog_->packagesModule->psdriverCO->count();
for (int n=0; n<nitem ; ++n) {
dialog_->packagesModule->psdriverCO->setCurrentItem(n);
}
}
-
-
+
+
dialog_->packagesModule->amsCB->setChecked(
controller().params().use_amsmath);
dialog_->updateFontsize(controller().textClass().opt_fontsize(),
controller().params().fontsize);
-
+
dialog_->updatePagestyle(controller().textClass().opt_pagestyle(),
controller().params().pagestyle);
-
-
+
+
for (int n=0; tex_fonts[n][0]; ++n) {
if (tex_fonts[n]==controller().params().fonts) {
dialog_->layoutModule->fontsCO->setCurrentItem(n);
} else {
dialog_->layoutModule->skipRB->setChecked(true);
}
-
+
int skip = 0;
switch (controller().params().getDefSkip().kind()) {
case VSpace::SMALLSKIP:
} else {
dialog_->layoutModule->optionsLE->setText("");
}
-
+
/* paper */
int const psize = controller().params().papersize2;
dialog_->paperModule->papersizeCO->setCurrentItem(psize);
dialog_->paperModule->facingPagesCB->setChecked(
controller().params().sides == LyXTextClass::TwoSides);
-
+
dialog_->paperModule->twoColumnCB->setChecked(
controller().params().columns == 2);
-
+
dialog_->paperModule->paperwidthUnitCO->setCurrentItem(
LyXLength(controller().params().paperwidth).unit());
-
+
dialog_->paperModule->paperwidthLE->setText(
tostr(LyXLength(controller().params().paperwidth).value()).c_str());
-
+
dialog_->paperModule->paperheightUnitCO->setCurrentItem(
LyXLength(controller().params().paperheight).unit());
dialog_->paperModule->paperheightLE->setText(
tostr(LyXLength(controller().params().paperheight).value()).c_str());
-
+
/* margins */
int item = controller().params().paperpackage;
if (controller().params().use_geometry) {
LyXLength(controller().params().topmargin).unit());
dialog_->marginsModule->topLE->setText(
tostr(LyXLength(controller().params().topmargin).value()).c_str());
-
+
dialog_->marginsModule->bottomUnit->setCurrentItem(
LyXLength(controller().params().bottommargin).unit());
dialog_->marginsModule->bottomLE->setText(
tostr(LyXLength(controller().params().bottommargin).value()).c_str());
-
+
dialog_->marginsModule->innerUnit->setCurrentItem(
LyXLength(controller().params().leftmargin).unit());
dialog_->marginsModule->innerLE->setText(
tostr(LyXLength(controller().params().leftmargin).value()).c_str());
-
+
dialog_->marginsModule->outerUnit->setCurrentItem(
LyXLength(controller().params().rightmargin).unit());
dialog_->marginsModule->outerLE->setText(
tostr(LyXLength(controller().params().rightmargin).value()).c_str());
-
+
dialog_->marginsModule->headheightUnit->setCurrentItem(
LyXLength(controller().params().headheight).unit());
dialog_->marginsModule->headheightLE->setText(
tostr(LyXLength(controller().params().headheight).value()).c_str());
-
+
dialog_->marginsModule->headsepUnit->setCurrentItem(
LyXLength(controller().params().headsep).unit());
dialog_->marginsModule->headsepLE->setText(
tostr(LyXLength(controller().params().headsep).value()).c_str());
-
+
dialog_->marginsModule->footskipUnit->setCurrentItem(
LyXLength(controller().params().footskip).unit());
dialog_->marginsModule->footskipLE->setText(
tostr(LyXLength(controller().params().footskip).value()).c_str());
-
-
-}
-
-
-
-
-
+}