Ejemplo n.º 1
0
void E1Popup::popup(const QPoint &pos)
{
    QSize s = sizeHint();
    QPoint showPoint(pos.x() - s.width(), pos.y() - s.height());
    move(showPoint);
    show();
    raise();
}
Ejemplo n.º 2
0
void showVector(Point *ptr, int dim) {
	int i;

	for(i = 0; i< dim; i++){
	    printf("\nPonto %d: \n", i);
		showPoint(ptr + i);

	}

}
Ejemplo n.º 3
0
void ScheduleScreen::addSchedulePoints()
{
    // create all 28 schedule points with proper connections
    // fill all points into pointList for easy access

    for(int a=0;a<28;a++)
    {
        SchedulePoint *schedulePoint = new SchedulePoint(a);
        connect(schedulePoint, SIGNAL(clicked(SchedulePoint *)), this, SLOT(selectDay(SchedulePoint*)));
        connect(this, SIGNAL(valueChanged()), schedulePoint, SLOT(updateUnit()));
        schedulePoint->setTimeBlockWidth(timeBlockWidth);
        schedulePoint->setWeekHeight(weekHeight);
        schedulePoint->setPointArea(pointArea);
        showPoint(schedulePoint);
        pointList.insert(a,schedulePoint);
    }

}
Ejemplo n.º 4
0
void MaskWidget::paintEvent(QPaintEvent* e)
{
	if (!m_desktopPixmap.isNull())
	{
		m_curPos = QCursor::pos();		
		QPainter painter(this);

		painter.drawPixmap(0, 0, m_desktopPixmap);

		if (!m_bScreenShotDone)
		{
			if (!m_bDragging)
			{
				m_curRc.setRect(-9999, -9999, 19999, 19999);
				for (std::vector<RECT>::iterator it = g_winRects.begin(); it != g_winRects.end(); ++it)
				{
					QRect rect;
					rect.setRect(it->left, it->top, it->right - it->left, it->bottom - it->top);
					if (rect.contains(QCursor::pos()) && m_curRc.contains(rect)/* && rect.height() > 5 && rect.width() > 5*/)
					{
						m_curRc = rect;
						//break;
					}
				}
			}
			else
			{
				m_curRc = QRect(m_startPoint, QCursor::pos());
			}
		}

		painter.save();
		painter.setPen(Qt::NoPen);
		painter.setBrush(QColor(0, 0, 0, 120));
		QPolygon p1(QRect(0, 0, width(), height()));
		QPolygon p2(m_curRc, true);
		p1 = p1.subtracted(p2);
		painter.drawPolygon(p1);
		painter.restore();

		painter.save();
		QPen pen = painter.pen();
		if (m_bScreenShotDone || m_bMousePressing)
		{
			pen.setWidth(2);
			pen.setColor(QColor(6, 157, 213));
			pen.setStyle(Qt::DashDotDotLine);
		}
		else
		{
			pen.setWidth(4);
			pen.setColor(QColor(0, 255, 0));
			pen.setStyle(Qt::SolidLine);
		}
		painter.setPen(pen);
		painter.drawRect(m_curRc);
		painter.restore();

		painter.save();
		
		QRect ori(m_curPos.x() - 15, m_curPos.y() - 11, 30, 22);
		QPixmap magnifier(126, 122);
		QPainter painter2(&magnifier);
		painter2.save();
		painter2.fillRect(0, 0, 126, 122, QBrush(QColor(51, 51, 51, 200)));
		painter2.restore();

		QPen p = painter2.pen();
		p.setWidth(1);
		p.setColor(QColor(51, 51, 51));
		painter2.setPen(p);
		painter2.drawRect(0, 0, 125, 93);

		p.setWidth(2);
		p.setColor(QColor(255, 255, 255));
		painter2.setPen(p);
		painter2.drawRect(2, 2, 122, 90);

		painter2.drawPixmap(3, 3, m_desktopPixmap.copy(ori).scaled(120, 88));

		p.setWidth(4);
		p.setColor(QColor(0, 122, 179, 128));
		painter2.setPen(p);
		painter2.drawLine(5, 45, 121, 45);
		painter2.drawLine(61, 5, 61, 89);

		p.setWidth(1);
		p.setColor(QColor(255, 255, 255));
		painter2.setPen(p);
		painter2.drawText(6, 105, QString("%1 x %2").arg(m_curRc.width()).arg(m_curRc.height()));
		QImage image = m_desktopPixmap.toImage();
		QRgb rgb = image.pixel(m_curPos.x()-1, m_curPos.y()-1);
		painter2.drawText(6, 118, QString("rgb(%1,%2,%3").arg(qRed(rgb)).arg(qGreen(rgb)).arg(qBlue(rgb)));

		QPoint showPoint(m_curPos.x() + 10, m_curPos.y() + 10);
		if (m_curPos.y() + 130 > this->height())
			showPoint.setY(m_curPos.y() - 130);

		if (m_curPos.x() + 130 > this->width())
			showPoint.setX(m_curPos.x() - 130);

		painter.drawPixmap(showPoint, magnifier);
	}
}
Ejemplo n.º 5
0
void schedulescreen::addSchedulePoints()
{

    // create all 28 schedule points with proper connections
    // fill all points into pointList for easy access
    point0 = new schedulepoint(0);
    connect(point0, SIGNAL(clicked(schedulepoint *)), this, SLOT(showButtons(schedulepoint *)));
    connect(this, SIGNAL(valueChanged()), point0, SLOT(updateUnit()));
    showPoint(point0);
    pointList.append(point0);
    point1 = new schedulepoint(1);
    connect(point1, SIGNAL(clicked(schedulepoint *)), this, SLOT(showButtons(schedulepoint *)));
    connect(this, SIGNAL(valueChanged()), point1, SLOT(updateUnit()));
    showPoint(point1);
    pointList.append(point1);
    point2 = new schedulepoint(2);
    connect(point2, SIGNAL(clicked(schedulepoint *)), this, SLOT(showButtons(schedulepoint *)));
    connect(this, SIGNAL(valueChanged()), point2, SLOT(updateUnit()));
    showPoint(point2);
    pointList.append(point2);
    point3 = new schedulepoint(3);
    connect(point3, SIGNAL(clicked(schedulepoint *)), this, SLOT(showButtons(schedulepoint *)));
    connect(this, SIGNAL(valueChanged()), point3, SLOT(updateUnit()));
    showPoint(point3);
    pointList.append(point3);
    point4 = new schedulepoint(4);
    connect(point4, SIGNAL(clicked(schedulepoint *)), this, SLOT(showButtons(schedulepoint *)));
    connect(this, SIGNAL(valueChanged()), point4, SLOT(updateUnit()));
    showPoint(point4);
    pointList.append(point4);
    point5 = new schedulepoint(5);
    connect(point5, SIGNAL(clicked(schedulepoint *)), this, SLOT(showButtons(schedulepoint *)));
    connect(this, SIGNAL(valueChanged()), point5, SLOT(updateUnit()));
    showPoint(point5);
    pointList.append(point5);
    point6 = new schedulepoint(6);
    connect(point6, SIGNAL(clicked(schedulepoint *)), this, SLOT(showButtons(schedulepoint *)));
    connect(this, SIGNAL(valueChanged()), point6, SLOT(updateUnit()));
    showPoint(point6);
    pointList.append(point6);
    point7 = new schedulepoint(7);
    connect(point7, SIGNAL(clicked(schedulepoint *)), this, SLOT(showButtons(schedulepoint *)));
    connect(this, SIGNAL(valueChanged()), point7, SLOT(updateUnit()));
    showPoint(point7);
    pointList.append(point7);
    point8 = new schedulepoint(8);
    connect(point8, SIGNAL(clicked(schedulepoint *)), this, SLOT(showButtons(schedulepoint *)));
    connect(this, SIGNAL(valueChanged()), point8, SLOT(updateUnit()));
    showPoint(point8);
    pointList.append(point8);
    point9 = new schedulepoint(9);
    connect(point9, SIGNAL(clicked(schedulepoint *)), this, SLOT(showButtons(schedulepoint *)));
    connect(this, SIGNAL(valueChanged()), point9, SLOT(updateUnit()));
    showPoint(point9);
    pointList.append(point9);
    point10 = new schedulepoint(10);
    connect(point10, SIGNAL(clicked(schedulepoint *)), this, SLOT(showButtons(schedulepoint *)));
    connect(this, SIGNAL(valueChanged()), point10, SLOT(updateUnit()));
    showPoint(point10);
    pointList.append(point10);
    point11 = new schedulepoint(11);
    connect(point11, SIGNAL(clicked(schedulepoint *)), this, SLOT(showButtons(schedulepoint *)));
    connect(this, SIGNAL(valueChanged()), point11, SLOT(updateUnit()));
    showPoint(point11);
    pointList.append(point11);
    point12 = new schedulepoint(12);
    connect(point12, SIGNAL(clicked(schedulepoint *)), this, SLOT(showButtons(schedulepoint *)));
    connect(this, SIGNAL(valueChanged()), point12, SLOT(updateUnit()));
    showPoint(point12);
    pointList.append(point12);
    point13 = new schedulepoint(13);
    connect(point13, SIGNAL(clicked(schedulepoint *)), this, SLOT(showButtons(schedulepoint *)));
    connect(this, SIGNAL(valueChanged()), point13, SLOT(updateUnit()));
    showPoint(point13);
    pointList.append(point13);
    point14 = new schedulepoint(14);
    connect(point14, SIGNAL(clicked(schedulepoint *)), this, SLOT(showButtons(schedulepoint *)));
    connect(this, SIGNAL(valueChanged()), point14, SLOT(updateUnit()));
    showPoint(point14);
    pointList.append(point14);
    point15 = new schedulepoint(15);
    connect(point15, SIGNAL(clicked(schedulepoint *)), this, SLOT(showButtons(schedulepoint *)));
    connect(this, SIGNAL(valueChanged()), point15, SLOT(updateUnit()));
    showPoint(point15);
    pointList.append(point15);
    point16 = new schedulepoint(16);
    connect(point16, SIGNAL(clicked(schedulepoint *)), this, SLOT(showButtons(schedulepoint *)));
    connect(this, SIGNAL(valueChanged()), point16, SLOT(updateUnit()));
    showPoint(point16);
    pointList.append(point16);
    point17 = new schedulepoint(17);
    connect(point17, SIGNAL(clicked(schedulepoint *)), this, SLOT(showButtons(schedulepoint *)));
    connect(this, SIGNAL(valueChanged()), point17, SLOT(updateUnit()));
    showPoint(point17);
    pointList.append(point17);
    point18 = new schedulepoint(18);
    connect(point18, SIGNAL(clicked(schedulepoint *)), this, SLOT(showButtons(schedulepoint *)));
    connect(this, SIGNAL(valueChanged()), point18, SLOT(updateUnit()));
    showPoint(point18);
    pointList.append(point18);
    point19 = new schedulepoint(19);
    connect(point19, SIGNAL(clicked(schedulepoint *)), this, SLOT(showButtons(schedulepoint *)));
    connect(this, SIGNAL(valueChanged()), point19, SLOT(updateUnit()));
    showPoint(point19);
    pointList.append(point19);
    point20 = new schedulepoint(20);
    connect(point20, SIGNAL(clicked(schedulepoint *)), this, SLOT(showButtons(schedulepoint *)));
    connect(this, SIGNAL(valueChanged()), point20, SLOT(updateUnit()));
    showPoint(point20);
    pointList.append(point20);
    point21 = new schedulepoint(21);
    connect(point21, SIGNAL(clicked(schedulepoint *)), this, SLOT(showButtons(schedulepoint *)));
    connect(this, SIGNAL(valueChanged()), point21, SLOT(updateUnit()));
    showPoint(point21);
    pointList.append(point21);
    point22 = new schedulepoint(22);
    connect(point22, SIGNAL(clicked(schedulepoint *)), this, SLOT(showButtons(schedulepoint *)));
    connect(this, SIGNAL(valueChanged()), point22, SLOT(updateUnit()));
    showPoint(point22);
    pointList.append(point22);
    point23 = new schedulepoint(23);
    connect(point23, SIGNAL(clicked(schedulepoint *)), this, SLOT(showButtons(schedulepoint *)));
    connect(this, SIGNAL(valueChanged()), point23, SLOT(updateUnit()));
    showPoint(point23);
    pointList.append(point23);
    point24 = new schedulepoint(24);
    connect(point24, SIGNAL(clicked(schedulepoint *)), this, SLOT(showButtons(schedulepoint *)));
    connect(this, SIGNAL(valueChanged()), point24, SLOT(updateUnit()));
    showPoint(point24);
    pointList.append(point24);
    point25 = new schedulepoint(25);
    connect(point25, SIGNAL(clicked(schedulepoint *)), this, SLOT(showButtons(schedulepoint *)));
    connect(this, SIGNAL(valueChanged()), point25, SLOT(updateUnit()));
    showPoint(point25);
    pointList.append(point25);
    point26 = new schedulepoint(26);
    connect(point26, SIGNAL(clicked(schedulepoint *)), this, SLOT(showButtons(schedulepoint *)));
    connect(this, SIGNAL(valueChanged()), point26, SLOT(updateUnit()));
    showPoint(point26);
    pointList.append(point26);
    point27 = new schedulepoint(27);
    connect(point27, SIGNAL(clicked(schedulepoint *)), this, SLOT(showButtons(schedulepoint *)));
    connect(this, SIGNAL(valueChanged()), point27, SLOT(updateUnit()));
    showPoint(point27);
    pointList.append(point27);

    // create proxy widgets to hold push buttons so arrows can be added to graphics view
    proxyLeftButton = new QGraphicsProxyWidget();
    proxyRightButton = new QGraphicsProxyWidget();
    proxyUpButton = new QGraphicsProxyWidget();
    proxyDownButton = new QGraphicsProxyWidget();

}
Ejemplo n.º 6
0
kdvi::kdvi( char *fname, QWidget *, const char *name )
    : KTopLevelWidget( name )
{
    msg = NULL;
    ssmenu = NULL;
    hbl = NULL;
    prefs = NULL;

    keys = new KAccel(this);

    readConfig();
    setMinimumSize( 400, 60 );
    setCaption( kapp->getCaption() );
    tipgroup = new QToolTipGroup( this, "TipGroup" );
    connect( tipgroup, SIGNAL(showTip(const char *)), SLOT(showTip(const char *)) );
    connect( tipgroup, SIGNAL(removeTip()), SLOT(removeTip()) );

    // Create KPanner for toolBar2 and dviwindow

    kpan = new KPanner( this, "panner",
                        KPanner::O_VERTICAL|KPanner::U_ABSOLUTE, 100);
    setView( kpan, TRUE );
    setFrameBorderWidth( 4 );
    kpan->setAbsSeparator( pannerValue );
    connect( kpan, SIGNAL(positionChanged()), SLOT(pannerChanged()) );

    // Create a dvi window

    dviwin = new dviWindow( basedpi, mfmode, paper, makepk,
                            kpan->child1(), "dviWindow" );
    connect( dviwin, SIGNAL(currentPage(int)), SLOT(setPage(int)) );
    connect( dviwin, SIGNAL(shrinkChanged(int)), SLOT(shrinkChanged(int)) );
    connect( dviwin, SIGNAL(fileChanged()), SLOT(fileChanged()) );
    connect( dviwin, SIGNAL(statusChange(const char *)),
             SLOT(showTip(const char *)) );
    connect( dviwin, SIGNAL(setPoint(QPoint)), SLOT(showPoint(QPoint)) );

    // Create a menubar

    menuBar = NULL;
    makeMenuBar();

    // Create toolbars

    toolBar = NULL;
    makeButtons();
    makeToolBar2( kpan->child0() );

    // Create a statusbar

    statusBar = NULL;
    makeStatusBar( i18n("No document") );

    // Lay out widgets

    QBoxLayout *l;
    l = new QBoxLayout( kpan->child0(), QBoxLayout::LeftToRight );
    l->addWidget( toolBar2 );
    l->activate();
    l = new QBoxLayout( kpan->child1(), QBoxLayout::LeftToRight );
    l->addWidget( dviwin );
    l->activate();

    // Create RMB menu

    rmbmenu = new QPopupMenu;
    rmbmenu->setMouseTracking( TRUE );
    rmbmenu->connectItem( rmbmenu->insertItem(i18n("Toggle Menubar")),
                          this, SLOT(toggleShowMenubar()) );
    rmbmenu->connectItem( rmbmenu->insertItem(i18n("Mark page")),
                          marklist, SLOT(markSelected()) );
    rmbmenu->connectItem( rmbmenu->insertItem(i18n("Redraw")),
                          dviwin, SLOT(drawPage()) );
    rmbmenu->connectItem( rmbmenu->insertItem(i18n("Preferences ...")),
                          this, SLOT(optionsPreferences()) );

    // Bind keys

    bindKeys();
    updateMenuAccel();

// Drag and drop

    KDNDDropZone * dropZone = new KDNDDropZone( this , DndURL);
    connect( dropZone, SIGNAL( dropAction( KDNDDropZone *) ),
             SLOT( dropEvent( KDNDDropZone *) ) );

    // Read config options

    applyPreferences();

    selectSmall();
    dviwin->installEventFilter( this );

    message( "" );
    openFile(QString(fname));
}