Ejemplo n.º 1
0
void InsetMathXYArrow::draw(PainterInfo & pi, int x, int y) const
{
	metrics(mi_);
	FontSetChanger dummy(pi.base, "textrm");

	if (editing()) {

#if 0

		int lasc;
		int ldes;
		int lwid;
		mathed_string_dim(pi.base.font, "target: ", lasc, ldes, lwid);

		cell(0).draw(pi, x + lwid, y);
		pi.base.text(x + 3, y, "target");
		y += max(dim0.des, ldes) + 5;

		y += max(dim1.asc, lasc) + 5;
		cell(1).draw(pi, x + lwid, y);
		pi.base.text(x + 3, y, "label");

#endif

	} else {

		pi.pain.text(x, y, "X");
		MathData const & s = sourceCell();
		MathData const & t = targetCell();
		pi.pain.line(s.xm(), s.ym(), t.xm(), t.ym(), Color_math);
		cell(1).draw(pi, (s.xm() + t.xm())/2, (s.ym() + t.ym())/2);

	}
}
Ejemplo n.º 2
0
void ClipboardBrowser::updateEditorGeometry()
{
    if ( editing() ) {
        const QRect contents = viewport()->contentsRect();
        const QMargins margins = contentsMargins();
        m_editor->setGeometry( contents.translated(margins.left(), margins.top()) );
    }
}
Ejemplo n.º 3
0
bool InsetPreview::previewState(BufferView * bv) const
{
	if (!editing(bv) && RenderPreview::previewText()) {
		graphics::PreviewImage const * pimage =
			preview_->getPreviewImage(bv->buffer());
		return pimage && pimage->image();
	}
	return false;
}
Ejemplo n.º 4
0
bool InsetPreview::previewState(BufferView * bv) const
{
	if (!editing(bv) && (RenderPreview::status() == LyXRC::PREVIEW_ON ||
			     RenderPreview::status() == LyXRC::PREVIEW_NO_MATH)) {
		graphics::PreviewImage const * pimage =
			preview_->getPreviewImage(bv->buffer());
		return pimage && pimage->image();
	}
	return false;
}
Ejemplo n.º 5
0
void param_set_t::add_command( param_t *p)
{
    if( editing())
    {
        if( !command_->has_command_for_param( p))
        {
            std::auto_ptr<undo::command_t> c( p->create_command());

            if( c.get())
                command_->add_command( p, c);
        }
    }
}
Ejemplo n.º 6
0
void Inset::drawMarkers(PainterInfo & pi, int x, int y) const
{
	ColorCode pen_color = mouseHovered(pi.base.bv) || editing(pi.base.bv)?
		Color_mathframe : Color_mathcorners;

	Dimension const dim = dimension(*pi.base.bv);

	int const t = x + dim.width() - 1;
	int const d = y + dim.descent();
	pi.pain.line(x, d - 3, x, d, pen_color);
	pi.pain.line(t, d - 3, t, d, pen_color);
	pi.pain.line(x, d, x + 3, d, pen_color);
	pi.pain.line(t - 3, d, t, d, pen_color);
}
Ejemplo n.º 7
0
void Inset::drawMarkers2(PainterInfo & pi, int x, int y) const
{
	ColorCode pen_color = mouseHovered(pi.base.bv) || editing(pi.base.bv)?
		Color_mathframe : Color_mathcorners;

	drawMarkers(pi, x, y);
	Dimension const dim = dimension(*pi.base.bv);
	int const t = x + dim.width() - 1;
	int const a = y - dim.ascent();
	pi.pain.line(x, a + 3, x, a, pen_color);
	pi.pain.line(t, a + 3, t, a, pen_color);
	pi.pain.line(x, a, x + 3, a, pen_color);
	pi.pain.line(t - 3, a, t, a, pen_color);
	setPosCache(pi, x, y);
}
Ejemplo n.º 8
0
bool InsetMathXYArrow::metrics(MetricsInfo & mi) const
{
	InsetMathNest::metrics(mi);
	mi_   = mi;
	FontSetChanger dummy(mi.base, "textrm");
#if 0
	target_ = mi.inset ? mi.inset->asXYMatrixInset() : 0;

	if (editing()) {
		int w    = mathed_string_width(mi.base.font, from_ascii("target: "));
		width_   = w + max(dim0.width(), dim1.wid);
		ascent_  = dim0.asc;
		descent_ = dim0.des + dim1.height() + 10;
	} else {
		width_   = 0;
		ascent_  = 0;
		descent_ = 0;
		//mathed_string_dim(font_, "X", ascent_, descent_, width_);
	}
#endif
}
Ejemplo n.º 9
0
void ConcatString::altitudeEdit(QString text)
{
    if (text.isEmpty()) return;
    if (!Global::valideFloat(text, this)) altitude->setText("");
    editing();
}
Ejemplo n.º 10
0
void MetaPanel::setEditMode( bool b_editing )
{
    b_inEditMode = b_editing;
    if( b_editing )emit editing();
}
Ejemplo n.º 11
0
bool ClipboardBrowser::hasUserSelection() const
{
    return isActiveWindow() || editing() || selectionModel()->selectedRows().count() > 1;
}
Ejemplo n.º 12
0
MediaInfoDialog::MediaInfoDialog( intf_thread_t *_p_intf,
                                  input_item_t *p_item ) :
                                  QVLCFrame( _p_intf )
{
    isMainInputInfo = ( p_item == NULL );

    setWindowTitle( qtr( "Media Information" ) );

    /* TabWidgets and Tabs creation */
    infoTabW = new QTabWidget;

    MP = new MetaPanel( infoTabW, p_intf );
    infoTabW->addTab( MP, qtr( "&General" ) );
    EMP = new ExtraMetaPanel( infoTabW, p_intf );
    infoTabW->addTab( EMP, qtr( "&Extra Metadata" ) );
    IP = new InfoPanel( infoTabW, p_intf );
    infoTabW->addTab( IP, qtr( "&Codec Details" ) );
    if( isMainInputInfo )
    {
        ISP = new InputStatsPanel( infoTabW, p_intf );
        infoTabW->addTab( ISP, qtr( "&Statistics" ) );
    }

    QGridLayout *layout = new QGridLayout( this );

    /* No need to use a QDialogButtonBox here */
    saveMetaButton = new QPushButton( qtr( "&Save Metadata" ) );
    saveMetaButton->hide();
    QPushButton *closeButton = new QPushButton( qtr( "&Close" ) );
    closeButton->setDefault( true );

    QLabel *uriLabel = new QLabel( qtr( "Location:" ) );
    QLineEdit *uriLine = new QLineEdit;

    layout->addWidget( infoTabW, 0, 0, 1, 8 );
    layout->addWidget( uriLabel, 1, 0, 1, 1 );
    layout->addWidget( uriLine, 1, 1, 1, 7 );
    layout->addWidget( saveMetaButton, 2, 6 );
    layout->addWidget( closeButton, 2, 7 );

    BUTTONACT( closeButton, close() );

    /* The tabs buttons are shown in the main dialog for space and cosmetics */
    BUTTONACT( saveMetaButton, saveMeta() );

    /* Let the MetaData Panel update the URI */
    CONNECT( MP, uriSet( const QString& ), uriLine, setText( const QString& ) );
    CONNECT( MP, editing(), saveMetaButton, show() );

    /* Display the buttonBar according to the Tab selected */
    CONNECT( infoTabW, currentChanged( int ), this, updateButtons( int ) );

    /* If using the General Mode */
    if( isMainInputInfo )
    {
        msg_Dbg( p_intf, "Using a general info windows" );
        /**
         * Connects on the various signals of input_Manager
         * For the currently playing element
         **/
        CONNECT( THEMIM->getIM(), infoChanged( input_item_t* ),
                 IP, update( input_item_t* ) );
        CONNECT( THEMIM->getIM(), currentMetaChanged( input_item_t* ),
                 MP, update( input_item_t* ) );
        CONNECT( THEMIM->getIM(), currentMetaChanged( input_item_t* ),
                 EMP, update( input_item_t* ) );
        CONNECT( THEMIM->getIM(), statisticsUpdated( input_item_t* ),
                 ISP, update( input_item_t* ) );

        if( THEMIM->getInput() )
            p_item = input_GetItem( THEMIM->getInput() );
    }
    else