Back to index

scribus-ng  1.3.4.dfsg+svn20071115
Public Member Functions | Protected Slots | Private Member Functions | Private Attributes | Friends
LineStyleWidget Class Reference

#include <smlinestyle.h>

Collaboration diagram for LineStyleWidget:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 LineStyleWidget ()
 ~LineStyleWidget ()
void showStyle (const multiLine &lineStyle, ColorList &colorList, int subLine=0)
void languageChange ()

Protected Slots

void slotEditNewLine (int i)

Private Member Functions

void updateLineList ()
QColor getColor (const QString &name, int shade)

Private Attributes

LineCombo * dashCombo
MSpinBox * lineWidth
multiLine currentStyle
ColorList colors

Friends

class SMLineStyle

Detailed Description

Definition at line 22 of file smlinestyle.h.


Constructor & Destructor Documentation

Definition at line 35 of file smlinestyle.cpp.

                                 : LineStyleWBase()
{
       addButton->setPixmap(loadIcon("penciladd.png"));
       removeButton->setPixmap(loadIcon("pencilsub.png"));

       dashCombo = new LineCombo(this);
       lineLayout->addWidget(dashCombo, 0, 0);

       lineWidth = new MSpinBox( 0, 300, this, 1 );
       lineWidth->setSuffix( tr( " pt" ) );
       widthLayout->addWidget(lineWidth, 0, 1);

       endCombo->insertItem(loadIcon("ButtCap.png"), tr( "Flat Cap" ) );
       endCombo->insertItem(loadIcon("SquareCap.png"), tr( "Square Cap" ) );
       endCombo->insertItem(loadIcon("RoundCap.png"), tr( "Round Cap" ) );

       joinCombo->insertItem(loadIcon("MiterJoin.png"), tr( "Miter Join" ) );
       joinCombo->insertItem(loadIcon("BevelJoin.png"), tr( "Bevel Join" ) );
       joinCombo->insertItem(loadIcon("RoundJoin.png"), tr( "Round Join" ) );

       languageChange();
}

Here is the call graph for this function:

Definition at line 181 of file smlinestyle.cpp.

{
       
}

Member Function Documentation

QColor LineStyleWidget::getColor ( const QString &  name,
int  shade 
) [private]

Definition at line 174 of file smlinestyle.cpp.

{
       const ScColor& color = colors[name];
       QColor tmpf = ScColorEngine::getDisplayColor(color, colors.document(), shade);
       return tmpf;
}

Here is the caller graph for this function:

Definition at line 58 of file smlinestyle.cpp.

{
/***********************************/
/*      Begin Tooltips             */
/***********************************/
// These are for the line style page

       QToolTip::add(addButton,    tr("Add a new line"));
       QToolTip::add(removeButton, tr("Remove a line"));
       QToolTip::add(dashCombo,    tr("Line style"));
       QToolTip::add(lineWidth,    tr("Line width"));
       QToolTip::add(endCombo,     tr("End style"));
       QToolTip::add(joinCombo,    tr("Join style"));
       QToolTip::add(colorCombo,   tr("Line color"));
       QToolTip::add(shadeBox,     tr("Line shade"));

/***********************************/
/*      End Tooltips               */
/***********************************/


}

Here is the call graph for this function:

Here is the caller graph for this function:

void LineStyleWidget::showStyle ( const multiLine lineStyle,
ColorList &  colorList,
int  subLine = 0 
)

Definition at line 81 of file smlinestyle.cpp.

{
       disconnect(lineStyles, SIGNAL(highlighted(int)), this, SLOT(slotEditNewLine(int)));
       currentStyle = lineStyle;
       colorCombo->clear();
       ColorList::Iterator it;
       ScribusDoc* doc = colorList.document();
       for (it = colorList.begin(); it != colorList.end(); ++it)
              colorCombo->listBox()->insertItem(new ColorWidePixmapItem(colorList[it.key()], doc, it.key()));
       colors = colorList;
       updateLineList();
       slotEditNewLine(subLine);
       connect(lineStyles, SIGNAL(highlighted(int)), this, SLOT(slotEditNewLine(int)));
}

Here is the call graph for this function:

Here is the caller graph for this function:

void LineStyleWidget::slotEditNewLine ( int  i) [protected, slot]

Definition at line 96 of file smlinestyle.cpp.

{
       lineStyles->setSelected(i, true);
       //currentLine_ = i;
       lineWidth->setValue(currentStyle[i].Width);
       colorCombo->setCurrentText(currentStyle[i].Color);
       shadeBox->setValue(currentStyle[i].Shade);
       
       switch (static_cast<PenStyle>(currentStyle[i].Dash))
       {
       case SolidLine:
              dashCombo->setCurrentItem(0);
              break;
       case DashLine:
              dashCombo->setCurrentItem(1);
              break;
       case DotLine:
              dashCombo->setCurrentItem(2);
              break;
       case DashDotLine:
              dashCombo->setCurrentItem(3);
              break;
       case DashDotDotLine:
              dashCombo->setCurrentItem(4);
              break;
       default:
              dashCombo->setCurrentItem(0);
              break;
       }

       switch (static_cast<PenCapStyle>(currentStyle[i].LineEnd))
       {
       case FlatCap:
              endCombo->setCurrentItem(0);
              break;
       case SquareCap:
              endCombo->setCurrentItem(1);
              break;
       case RoundCap:
              endCombo->setCurrentItem(2);
              break;
       default:
              endCombo->setCurrentItem(0);
              break;
       }

       switch (static_cast<PenJoinStyle>(currentStyle[i].LineJoin))
       {
       case MiterJoin:
              joinCombo->setCurrentItem(0);
              break;
       case BevelJoin:
              joinCombo->setCurrentItem(1);
              break;
       case RoundJoin:
              joinCombo->setCurrentItem(2);
              break;
       default:
              joinCombo->setCurrentItem(0);
              break;
       }
}

Here is the caller graph for this function:

void LineStyleWidget::updateLineList ( ) [private]

Definition at line 159 of file smlinestyle.cpp.

{
       QString tmp, tmp2;
       lineStyles->clear();
       QPixmap * pm2;
       for (multiLine::iterator it = currentStyle.begin(); it != currentStyle.end(); ++it)
       {
              pm2 = getWidePixmap(getColor((*it).Color, (*it).Shade));
              tmp2 = " "+tmp.setNum((*it).Width)+ tr(" pt")+" ";
              tmp2 += CommonStrings::translatePenStyleName(static_cast<PenStyle>((*it).Dash));
              tmp2 += " ";
              lineStyles->insertItem(*pm2, tmp2);
       }
}

Here is the call graph for this function:

Here is the caller graph for this function:


Friends And Related Function Documentation

friend class SMLineStyle [friend]

Definition at line 41 of file smlinestyle.h.


Member Data Documentation

ColorList LineStyleWidget::colors [private]

Definition at line 36 of file smlinestyle.h.

Definition at line 35 of file smlinestyle.h.

LineCombo* LineStyleWidget::dashCombo [private]

Definition at line 33 of file smlinestyle.h.

MSpinBox* LineStyleWidget::lineWidth [private]

Definition at line 34 of file smlinestyle.h.


The documentation for this class was generated from the following files: