void Plot3DDialog::initTitlePage()
{
    QHBoxLayout* hb1 = new QHBoxLayout();
    hb1->addStretch();
	buttonLowerGreek = new QPushButton(QChar(0x3B1));
    hb1->addWidget(buttonLowerGreek);
	buttonUpperGreek = new QPushButton(QChar(0x393));
    hb1->addWidget(buttonUpperGreek);
	btnTitleColor = new QPushButton(tr( "&Color" ));
    hb1->addWidget(btnTitleColor);
	btnTitleFont = new QPushButton(tr( "&Font" ));
    hb1->addWidget(btnTitleFont);
    hb1->addStretch();

	QVBoxLayout* vl = new QVBoxLayout();
	boxTitle = new QLineEdit();
	vl->addWidget(boxTitle);
    vl->addLayout(hb1);
    vl->addStretch();

    title = new QWidget();
    title->setLayout(vl);
	generalDialog->insertTab(title, tr( "&Title" ) );

	connect( btnTitleColor, SIGNAL(clicked()), this, SLOT(pickTitleColor() ) );
	connect( btnTitleFont, SIGNAL(clicked()), this, SLOT(pickTitleFont() ) );
	connect( buttonLowerGreek, SIGNAL(clicked()), this, SLOT(showLowerGreek()));
	connect( buttonUpperGreek, SIGNAL(clicked()), this, SLOT(showUpperGreek()));
}
Пример #2
0
void Plot3DDialog::initAxesPage() {
  axesList2 = new QListWidget();
  axesList2->addItem(tr("X"));
  axesList2->addItem(tr("Y"));
  axesList2->addItem(tr("Z"));
  axesList2->setFixedWidth(50);
  axesList2->setCurrentRow(0);

  QGridLayout* gl1 = new QGridLayout();
  gl1->addWidget(new QLabel(tr("Title")), 0, 0);
  boxLabel = new QLineEdit();
  gl1->addWidget(boxLabel, 0, 1);
  gl1->addWidget(new QLabel(tr("Axis Font")), 1, 0);

  QHBoxLayout* hb1 = new QHBoxLayout();
  btnLabelFont = new QPushButton(tr("&Choose font"));
  hb1->addWidget(btnLabelFont);
  buttonAxisLowerGreek = new QPushButton(QChar(0x3B1));
  hb1->addWidget(buttonAxisLowerGreek);
  buttonAxisUpperGreek = new QPushButton(QChar(0x393));
  hb1->addWidget(buttonAxisUpperGreek);
  hb1->addStretch();
  gl1->addLayout(hb1, 1, 1);

  gl1->addWidget(new QLabel(tr("Major Ticks Length")), 2, 0);
  boxMajorLength = new QLineEdit();
  gl1->addWidget(boxMajorLength, 2, 1);
  gl1->addWidget(new QLabel(tr("Minor Ticks Length")), 3, 0);
  boxMinorLength = new QLineEdit();
  gl1->addWidget(boxMinorLength, 3, 1);
  gl1->setRowStretch(4, 1);

  QGroupBox* gb1 = new QGroupBox();
  gb1->setLayout(gl1);

  QHBoxLayout* hb2 = new QHBoxLayout();
  hb2->addWidget(axesList2);
  hb2->addWidget(gb1);

  axes = new QWidget();
  axes->setLayout(hb2);
  generalDialog->insertTab(axes, tr("&Axis"));

  connect(buttonAxisLowerGreek, SIGNAL(clicked()), this,
          SLOT(showLowerGreek()));
  connect(buttonAxisUpperGreek, SIGNAL(clicked()), this,
          SLOT(showUpperGreek()));
  connect(axesList2, SIGNAL(currentRowChanged(int)), this,
          SLOT(viewAxisOptions(int)));
  connect(axesList, SIGNAL(currentRowChanged(int)), this,
          SLOT(viewScaleLimits(int)));
  connect(btnLabelFont, SIGNAL(clicked()), this, SLOT(pickAxisLabelFont()));
}
TextFormatButtons::TextFormatButtons(QTextEdit * textEdit, Buttons buttons, QWidget * parent)
: QWidget(parent),
connectedTextEdit(textEdit),
d_buttons(buttons)
{
	QHBoxLayout * layout = new QHBoxLayout(this);
	layout->setMargin(0);
	layout->setSpacing(0);

	QFont font = this->font();
	font.setPointSize(14);

	if (buttons == Legend){
		buttonCurve = new QPushButton( QPixmap(lineSymbol_xpm), QString());
		buttonCurve->setMaximumWidth(40);
		buttonCurve->setMinimumHeight(35);
		buttonCurve->setFont(font);
		layout->addWidget(buttonCurve);
		connect( buttonCurve, SIGNAL(clicked()), this, SLOT(addCurve()) );
	}

	buttonSubscript = new QPushButton(QPixmap(index_xpm), QString());
	buttonSubscript->setMaximumWidth(40);
	buttonSubscript->setMinimumHeight(35);
	buttonSubscript->setFont(font);
	layout->addWidget(buttonSubscript);
	connect( buttonSubscript, SIGNAL(clicked()), this, SLOT(addSubscript()) );

	buttonSuperscript = new QPushButton(QPixmap(exp_xpm), QString());
	buttonSuperscript->setMaximumWidth(40);
	buttonSuperscript->setMinimumHeight(35);
	buttonSuperscript->setFont(font);
	layout->addWidget(buttonSuperscript);
	connect( buttonSuperscript, SIGNAL(clicked()), this, SLOT(addSuperscript()));

	if (buttons != Equation){
		buttonLowerGreek = new QPushButton(QString(QChar(0x3B1)));
		buttonLowerGreek->setFont(font);
		buttonLowerGreek->setMaximumWidth(40);
		layout->addWidget(buttonLowerGreek);
		connect( buttonLowerGreek, SIGNAL(clicked()), this, SLOT(showLowerGreek()));

		buttonUpperGreek = new QPushButton(QString(QChar(0x393)));
		buttonUpperGreek->setFont(font);
		buttonUpperGreek->setMaximumWidth(40);
		layout->addWidget(buttonUpperGreek);
		connect( buttonUpperGreek, SIGNAL(clicked()), this, SLOT(showUpperGreek()));

		buttonMathSymbols = new QPushButton(QString(QChar(0x222B)));
		buttonMathSymbols->setFont(font);
		buttonMathSymbols->setMaximumWidth(40);
		layout->addWidget(buttonMathSymbols);
		connect( buttonMathSymbols, SIGNAL(clicked()), this, SLOT(showMathSymbols()));

		buttonArrowSymbols = new QPushButton(QString(QChar(0x2192)));
		buttonArrowSymbols->setFont(font);
		buttonArrowSymbols->setMaximumWidth(40);
		layout->addWidget(buttonArrowSymbols);
		connect( buttonArrowSymbols, SIGNAL(clicked()), this, SLOT(showArrowSymbols()));
	}

	if (buttons != Plot3D && buttons != Equation){
		font = this->font();
		font.setBold(true);
		font.setPointSize(14);

		buttonBold = new QPushButton(tr("B","Button bold"));
		buttonBold->setFont(font);
		buttonBold->setMaximumWidth(40);
		layout->addWidget(buttonBold);
		connect( buttonBold, SIGNAL(clicked()), this, SLOT(addBold()));

		font = this->font();
		font.setItalic(true);
		font.setPointSize(14);

		buttonItalics = new QPushButton(tr("It","Button italics"));
		buttonItalics->setFont(font);
		buttonItalics->setMaximumWidth(40);
		layout->addWidget(buttonItalics);
		connect( buttonItalics, SIGNAL(clicked()), this, SLOT(addItalics()));

		font = this->font();
		font.setUnderline(true);
		font.setPointSize(14);

		buttonUnderline = new QPushButton(tr("U","Button underline"));
		buttonUnderline->setFont(font);
		buttonUnderline->setMaximumWidth(40);
		layout->addWidget(buttonUnderline);
   		layout->addStretch();
		connect( buttonUnderline, SIGNAL(clicked()), this, SLOT(addUnderline()));
	}

	if (buttons == Equation){
		buttonFraction = new QPushButton(QPixmap(fraction_xpm), QString());
		buttonFraction->setMaximumWidth(40);
		buttonFraction->setMinimumHeight(35);
		buttonFraction->setFont(font);
		layout->addWidget(buttonFraction);
		connect(buttonFraction, SIGNAL(clicked()), this, SLOT(addFraction()));

		buttonSquareRoot = new QPushButton(QPixmap(square_root_xpm), QString());
		buttonSquareRoot->setMaximumWidth(40);
		buttonSquareRoot->setMinimumHeight(35);
		buttonSquareRoot->setFont(font);
		layout->addWidget(buttonSquareRoot);
		connect(buttonSquareRoot, SIGNAL(clicked()), this, SLOT(addSquareRoot()));
		layout->addStretch();
	}
}
Пример #4
0
void TextFormatButtons::init(Buttons buttons)
{
  QHBoxLayout *layout = (QHBoxLayout*)this->layout();
  QLayoutItem *child;
  while ((child = layout->takeAt(0)) != 0){
    if (child->widget())
      delete child->widget();
  }

  QFont font = QFont();
  int btnSize = 32;
#ifdef Q_OS_MAC
  btnSize = 38;
#endif
  if (buttons == Legend || buttons == TexLegend){
    QPushButton *buttonCurve = new QPushButton( QPixmap(":/lineSymbol.png"), QString());
    buttonCurve->setFixedWidth(btnSize);
    buttonCurve->setFixedHeight(btnSize);
    buttonCurve->setFont(font);
    layout->addWidget(buttonCurve);
    connect( buttonCurve, SIGNAL(clicked()), this, SLOT(addCurve()) );
  }

  QPushButton *buttonSubscript = new QPushButton(QPixmap(":/index.png"), QString());
  buttonSubscript->setFixedWidth(btnSize);
  buttonSubscript->setFixedHeight(btnSize);
  buttonSubscript->setFont(font);
  layout->addWidget(buttonSubscript);
  connect( buttonSubscript, SIGNAL(clicked()), this, SLOT(addSubscript()) );

  QPushButton *buttonSuperscript = new QPushButton(QPixmap(":/exp.png"), QString());
  buttonSuperscript->setFixedWidth(btnSize);
  buttonSuperscript->setFixedHeight(btnSize);
  buttonSuperscript->setFont(font);
  layout->addWidget(buttonSuperscript);
  connect( buttonSuperscript, SIGNAL(clicked()), this, SLOT(addSuperscript()));

  if (buttons == Equation || buttons == TexLegend){
    QPushButton *buttonFraction = new QPushButton(QPixmap(":/fraction.png"), QString());
    buttonFraction->setFixedWidth(btnSize);
    buttonFraction->setFixedHeight(btnSize);
    buttonFraction->setFont(font);
    layout->addWidget(buttonFraction);
    connect(buttonFraction, SIGNAL(clicked()), this, SLOT(addFraction()));

    QPushButton *buttonSquareRoot = new QPushButton(QPixmap(":/square_root.png"), QString());
    buttonSquareRoot->setFixedWidth(btnSize);
    buttonSquareRoot->setFixedHeight(btnSize);
    buttonSquareRoot->setFont(font);
    layout->addWidget(buttonSquareRoot);
    connect(buttonSquareRoot, SIGNAL(clicked()), this, SLOT(addSquareRoot()));
  }

  QPushButton *buttonLowerGreek = new QPushButton(QString(QChar(0x3B1)));
  buttonLowerGreek->setFont(font);
  buttonLowerGreek->setFixedWidth(btnSize);
  buttonLowerGreek->setFixedHeight(btnSize);
  layout->addWidget(buttonLowerGreek);
  connect( buttonLowerGreek, SIGNAL(clicked()), this, SLOT(showLowerGreek()));

  QPushButton *buttonUpperGreek = new QPushButton(QString(QChar(0x393)));
  buttonUpperGreek->setFont(font);
  buttonUpperGreek->setFixedWidth(btnSize);
  buttonUpperGreek->setFixedHeight(btnSize);
  layout->addWidget(buttonUpperGreek);
  connect( buttonUpperGreek, SIGNAL(clicked()), this, SLOT(showUpperGreek()));

  QPushButton *buttonArrowSymbols = new QPushButton(QString(QChar(0x2192)));
  buttonArrowSymbols->setFont(font);
  buttonArrowSymbols->setFixedWidth(btnSize);
  buttonArrowSymbols->setFixedHeight(btnSize);
  layout->addWidget(buttonArrowSymbols);
  connect( buttonArrowSymbols, SIGNAL(clicked()), this, SLOT(showArrowSymbols()));

  QPushButton *buttonMathSymbols = new QPushButton(QString(QChar(0x222B)));
  buttonMathSymbols->setFont(font);
  buttonMathSymbols->setFixedWidth(btnSize);
  buttonMathSymbols->setFixedHeight(btnSize);
  layout->addWidget(buttonMathSymbols);
  connect( buttonMathSymbols, SIGNAL(clicked()), this, SLOT(showMathSymbols()));

  if (buttons != Plot3D && buttons != Equation && buttons != TexLegend){
    font = this->font();
    font.setBold(true);

    QPushButton *buttonBold = new QPushButton(tr("B","Button bold"));
    buttonBold->setFont(font);
    buttonBold->setFixedWidth(btnSize);
    buttonBold->setFixedHeight(btnSize);
    layout->addWidget(buttonBold);
    connect( buttonBold, SIGNAL(clicked()), this, SLOT(addBold()));

    font = this->font();
    font.setItalic(true);

    QPushButton *buttonItalics = new QPushButton(tr("It","Button italics"));
    buttonItalics->setFont(font);
    buttonItalics->setFixedWidth(btnSize);
    buttonItalics->setFixedHeight(btnSize);
    layout->addWidget(buttonItalics);
    connect( buttonItalics, SIGNAL(clicked()), this, SLOT(addItalics()));

    font = this->font();
    font.setUnderline(true);

    QPushButton *buttonUnderline = new QPushButton(tr("U","Button underline"));
    buttonUnderline->setFont(font);
    buttonUnderline->setFixedWidth(btnSize);
    buttonUnderline->setFixedHeight(btnSize);
    layout->addWidget(buttonUnderline);
    layout->addStretch();
    connect( buttonUnderline, SIGNAL(clicked()), this, SLOT(addUnderline()));
  } else
    layout->addStretch();
}