Exemplo n.º 1
0
LayerButton* MultiLayer::addLayerButton()
{
	foreach(LayerButton *btn, buttonsList)
		btn->setOn(false);

	LayerButton *button = new LayerButton(QString::number(graphsList.size() + 1));
	connect (button, SIGNAL(clicked(LayerButton*)), this, SLOT(activateGraph(LayerButton*)));
	connect (button, SIGNAL(showCurvesDialog()), this, SIGNAL(showCurvesDialog()));

	buttonsList.append(button);
    layerButtonsBox->addWidget(button);
	return button;
}
Exemplo n.º 2
0
bool LayerButton::eventFilter(QObject *object, QEvent *e)
{
if ( object != (QObject *)btn)
	return FALSE;

switch(e->type())
    {
        case QEvent::MouseButtonDblClick:
			{
			if (btn->isOn())
             	emit showCurvesDialog();
			return TRUE; 
			}

		case QEvent::MouseButtonPress:
			{
			const QMouseEvent *me = (const QMouseEvent *)e;
			if (me->button()==QMouseEvent::RightButton)	
				emit showLayerMenu();
			else if (me->button()==QMouseEvent::LeftButton)	
				{
				if (!btn->isOn())
					emit clicked(this);
				}
			return TRUE; 
			}
			default:
				;
    }
return QObject::eventFilter(object, e);
}
Exemplo n.º 3
0
LayerButton *MultiLayer::addLayerButton() {
  for (int i = 0; i < buttonsList.count(); i++) {
    LayerButton *btn = (LayerButton *)buttonsList.at(i);
    btn->setOn(false);
  }

  LayerButton *button = new LayerButton(QString::number(++graphs));
  connect(button, SIGNAL(clicked(LayerButton *)), this,
          SLOT(activateGraph(LayerButton *)));
  connect(button, SIGNAL(showContextMenu()), this,
          SIGNAL(showLayerButtonContextMenu()));
  connect(button, SIGNAL(showCurvesDialog()), this, SIGNAL(showCurvesDialog()));

  buttonsList.append(button);
  layerButtonsBox->addWidget(button);
  return button;
}
Exemplo n.º 4
0
LayerButton* MultiLayer::addLayerButton()
{
for (int i=0;i<(int)buttonsList->count();i++)
	{
	LayerButton *btn=(LayerButton*) buttonsList->at(i);
	btn->setOn(FALSE);
	}

LayerButton *button=new LayerButton(QString::number(++graphs),hbox1,0);
connect (button,SIGNAL(clicked(LayerButton*)),this, SLOT(activateGraph(LayerButton*)));
connect (button,SIGNAL(showLayerMenu()),this, SIGNAL(showWindowContextMenu()));
connect (button,SIGNAL(showCurvesDialog()),this, SIGNAL(showCurvesDialog()));
button->setOn(TRUE);
buttonsList->append(button);
hbox1->setMaximumWidth(graphs*button->width());

button->show();
return button;
}
Exemplo n.º 5
0
void LayerButton::mouseDoubleClickEvent ( QMouseEvent * )
{
	emit showCurvesDialog();
}