Beispiel #1
0
	void ScrollView::setPropertyOverride(const std::string& _key, const std::string& _value)
	{
		/// @wproperty{ScrollView, VisibleVScroll, bool} Видимость вертикальной полосы прокрутки.
		if (_key == "VisibleVScroll")
			setVisibleVScroll(utility::parseValue<bool>(_value));

		/// @wproperty{ScrollView, VisibleHScroll, bool} Видимость горизонтальной полосы прокрутки.
		else if (_key == "VisibleHScroll")
			setVisibleHScroll(utility::parseValue<bool>(_value));

		/// @wproperty{ScrollView, CanvasAlign, Align} Выравнивание содержимого.
		else if (_key == "CanvasAlign")
			setCanvasAlign(utility::parseValue<Align>(_value));

		/// @wproperty{ScrollView, CanvasSize, int int} Размер содержимого.
		else if (_key == "CanvasSize")
			setCanvasSize(utility::parseValue<IntSize>(_value));

		else
		{
			Base::setPropertyOverride(_key, _value);
			return;
		}

		eventChangeProperty(this, _key, _value);
	}
Beispiel #2
0
	void ScrollView::setProperty(const std::string& _key, const std::string& _value)
	{
		if (_key == "ScrollView_VisibleVScroll") setVisibleVScroll(utility::parseValue<bool>(_value));
		else if (_key == "ScrollView_VisibleHScroll") setVisibleHScroll(utility::parseValue<bool>(_value));
		else if (_key == "ScrollView_CanvasAlign") setCanvasAlign(utility::parseValue<Align>(_value));
		else if (_key == "ScrollView_CanvasSize") setCanvasSize(utility::parseValue<IntSize>(_value));

#ifndef MYGUI_DONT_USE_OBSOLETE
		else if (_key == "ScrollView_VScroll")
		{
			MYGUI_LOG(Warning, "ScrollView_VScroll is obsolete, use ScrollView_VisibleVScroll");
			setVisibleVScroll(utility::parseValue<bool>(_value));
		}
		else if (_key == "ScrollView_HScroll")
		{
			MYGUI_LOG(Warning, "ScrollView_HScroll is obsolete, use ScrollView_VisibleHScroll");
			setVisibleHScroll(utility::parseValue<bool>(_value));
		}
#endif // MYGUI_DONT_USE_OBSOLETE

		else
		{
			Base::setProperty(_key, _value);
			return;
		}
		eventChangeProperty(this, _key, _value);
	}
Beispiel #3
0
void QQuickContext2DTexture::canvasChanged(const QSize& canvasSize, const QSize& tileSize, const QRect& canvasWindow, const QRect& dirtyRect, bool smooth, bool antialiasing)
{
    QSize ts = tileSize;
    if (ts.width() > canvasSize.width())
        ts.setWidth(canvasSize.width());

    if (ts.height() > canvasSize.height())
        ts.setHeight(canvasSize.height());

    setCanvasSize(canvasSize);
    setTileSize(ts);
    setCanvasWindow(canvasWindow);

    if (canvasSize == canvasWindow.size()) {
        m_tiledCanvas = false;
    } else {
        m_tiledCanvas = true;
    }

    if (dirtyRect.isValid())
        setDirtyRect(dirtyRect);

    setSmooth(smooth);
    setAntialiasing(antialiasing);
}
	void ScrollView::setPropertyOverride(const std::string& _key, const std::string& _value)
	{
		if (_key == "VisibleVScroll")
			setVisibleVScroll(utility::parseValue<bool>(_value));
		else if (_key == "VisibleHScroll")
			setVisibleHScroll(utility::parseValue<bool>(_value));
		else if (_key == "CanvasAlign")
			setCanvasAlign(utility::parseValue<Align>(_value));
		else if (_key == "CanvasSize")
			setCanvasSize(utility::parseValue<IntSize>(_value));
		else
		{
			Base::setPropertyOverride(_key, _value);
			return;
		}
		eventChangeProperty(this, _key, _value);
	}
Beispiel #5
0
	void ScrollView::setCanvasSize(int _width, int _height)
	{
		setCanvasSize(IntSize(_width, _height));
	}
QmvFormTool::QmvFormTool( QmvRelationWidget * rlw, QmvApplication * parent, const char * name )
        : QmvToolWindow( rlw->getRelation(), parent, name )
{
    
        // ------------------------------------------------------------
        // Query Objects
        // ------------------------------------------------------------
    
    
        // Form header
    fh = 0;
    pagesize = background.size();
    
    if ( rlw )
        rlw_form = rlw;
    else
        throw( QmvException( QString( "<h3>QmvFormTool::QmvFormTool</h2>"
                                      "Failed to build FORM object" ),
                             QmvException::Critical) );
    reln_form = rlw->getRelation();
    if ( !reln_form )
        throw( QmvException( QString( "<h3>QmvFormTool::QmvFormTool</h2>"
                                      "Failed to build FORM object" ),
                             QmvException::Critical) );
        // Form details.
    
    QmvSqlClass * fmdt_existing = (QmvSqlClass *) reln_form->dataBase()->dbRelation( "fmdt" );
    if ( fmdt_existing )
        reln_fmdt = new QmvSqlClass( *fmdt_existing );
    else
        throw( QmvException( QString( "<h3>QmvFormTool::QmvFormTool</h2>"
                                      "Failed to build FMDT object" ),
                             QmvException::Critical) );
    
    
 
        // -------------------------------------------
        // Mouse Clicks ------------------------------
        // -------------------------------------------
    
        // notice button clicks on grid
    connect( canvasView(), SIGNAL( clicked( QCanvasItem *, const QPoint &, ButtonState, ButtonState ) ),
             this, SLOT( popupEventDetails( QCanvasItem *, const QPoint &, ButtonState, ButtonState ) ) );

        //  doubleclick - edit
    connect( canvasView(), SIGNAL( doubleClicked( QCanvasItem *, const QPoint &, ButtonState, ButtonState ) ),
             this, SLOT( dataChangeRequested( QCanvasItem *, const QPoint &, ButtonState, ButtonState ) ) );

        // notice grid movements
    connect( canvasView(), SIGNAL( moved( QCanvasItem *, const QPoint &, const QPoint & ) ),
             this, SLOT( eventLabelMoved( QCanvasItem *, const QPoint &, const QPoint & ) ) );

        // notice resizes
    connect( canvasView(), SIGNAL( resized( QCanvasItem *, const QRect &, const QRect & ) ),
             this, SLOT( eventLabelResized( QCanvasItem *, const QRect &, const QRect & ) ) );

        // --- ACCELERATORS  ---------------------------------------
        // ------------------------------------------------------------

    QAccel * ap_accel = new QAccel( this, "forms" );
    int a_id;
    
        // line down
    a_id = ap_accel->insertItem( Key_Down );
    ap_accel->connectItem( a_id, this, SLOT( slotLineDown() ) );
    ap_accel->setWhatsThis( a_id, "Scroll down one line" );
        // line up
    a_id = ap_accel->insertItem( Key_Up );
    ap_accel->connectItem( a_id, this, SLOT( slotLineUp() ) );
    ap_accel->setWhatsThis( a_id, "Scroll up one line" );
    
        // page down
    a_id = ap_accel->insertItem( Key_Next );
    ap_accel->connectItem( a_id, this, SLOT( slotPageDown() ) );
    ap_accel->setWhatsThis( a_id, "Scroll down one page" );
        // page up
    a_id = ap_accel->insertItem( Key_Prior );
    ap_accel->connectItem( a_id, this, SLOT( slotPageUp() ) );
    ap_accel->setWhatsThis( a_id, "Scroll up one page" );

    QAction * ac;
    QActionGroup * ag_insert = new QActionGroup( this, "ag_insert" );
    
        // ------------------------------------------------------------
        // Navigation Toolbar
        // ------------------------------------------------------------
        // clear the navigation toolbar - not needed yet
    navigationToolBar()->clear();
    
        // ------------------------------------------------------------
        // Tool buttons for adding detail objects
        // ------------------------------------------------------------
    
    ag_insert->setExclusive(TRUE);
    QSignalMapper *ndt_sigmap = new QSignalMapper( this );
    connect( ndt_sigmap, SIGNAL( mapped(int) ),
             this, SLOT( slotAddNewDetail(int) ) );
        
        // Label -----------------------------------------------------
    ac = new QAction( "Text",
                      *stdicons->makeTextPixmap( new QPixmap(stdicons->getPixmap(QmvIcons::BlankPageIcon)),
                                                 tr("T"), QFont("Times"), QColor( blue ), QRect() ),
                      "Text",
                      ALT+SHIFT+Key_T,
                      ag_insert, "text", FALSE );
    ndt_sigmap->setMapping( ac, formDetail::Label );
    connect( ac, SIGNAL( activated() ), ndt_sigmap, SLOT( map() ) );
        
        // Field -----------------------------------------------------
    ac = new QAction( "Field",
                      *stdicons->makeTextPixmap( new QPixmap(stdicons->getPixmap(QmvIcons::BlankPageIcon)),
                                                 tr("F"), QFont("Times"), QColor( blue ), QRect() ),
                      "Field",
                      ALT+SHIFT+Key_F,
                      ag_insert, "Field", FALSE );
    ndt_sigmap->setMapping( ac, formDetail::Field );
    connect( ac, SIGNAL( activated() ), ndt_sigmap, SLOT( map() ) );
        
        // Line -----------------------------------------------------
    ac = new QAction( "Line",
                      *stdicons->makeTextPixmap( new QPixmap(stdicons->getPixmap(QmvIcons::BlankPageIcon)),
                                                 tr("L"), QFont("Times"), QColor( blue ), QRect() ),
                      "Line",
                      ALT+SHIFT+Key_L,
                      ag_insert, "Line", FALSE );
    ndt_sigmap->setMapping( ac, formDetail::Line );
    connect( ac, SIGNAL( activated() ), ndt_sigmap, SLOT( map() ) );
        
        // Calc -----------------------------------------------------
    ac = new QAction( "Calculation",
                      *stdicons->makeTextPixmap( new QPixmap(stdicons->getPixmap(QmvIcons::BlankPageIcon)),
                                                 tr("C"), QFont("Times"), QColor( blue ), QRect() ),
                      "Calculation",
                      ALT+SHIFT+Key_C,
                      ag_insert, "Calculation", FALSE );
    ndt_sigmap->setMapping( ac, formDetail::Calc );
    connect( ac, SIGNAL( activated() ), ndt_sigmap, SLOT( map() ) );
        
        // Special -----------------------------------------------------
    ac = new QAction( "Special",
                      *stdicons->makeTextPixmap( new QPixmap(stdicons->getPixmap(QmvIcons::BlankPageIcon)),
                                                 tr("S"), QFont("Times"), QColor( blue ), QRect() ),
                      "Special",
                      ALT+SHIFT+Key_S,
                      ag_insert, "Special", FALSE );
    ndt_sigmap->setMapping( ac, formDetail::Special );
    connect( ac, SIGNAL( activated() ), ndt_sigmap, SLOT( map() ) );
    
        // Print ------------------------------------------------------
    ac = new QAction( "Print",
                      QPixmap( QmvFormToolIcons::print_xpm ),
                      "&Print",
                      Key_P,
                      ag_insert, "form_print", FALSE );
    connect( ac, SIGNAL( activated() ), this, SLOT( slotPrint() ) );

        // Fax ------------------------------------------------------
    ac = new QAction( "Fax",
                      QPixmap( QmvFormToolIcons::fax_xpm ),
                      "Fa&x",
                      Key_X,
                      ag_insert, "form_fax", FALSE );
    connect( ac, SIGNAL( activated() ), this, SLOT( slotFax() ) );

        // Email ------------------------------------------------------
    ac = new QAction( "Email",
                      QPixmap( QmvFormToolIcons::email_xpm ),
                      "&Email",
                      Key_E,
                      ag_insert, "form_email", FALSE );
    connect( ac, SIGNAL( activated() ), this, SLOT( slotEmail() ) );

        // Add actiongroup to toolbar
    otherToolBar()->clear();
    new QLabel( "Add new detail: ", otherToolBar(), "display_label" );
    ag_insert->addTo( otherToolBar() );

   
        // prepare for display
    setToolBarsMovable(FALSE);
    adjustSize();
    updateGeometry();
    setFocus();
        // adjust canvas to the base magnification.
    setCanvasSize();
}
void ImageListModel::setCanvasHeight(int h) {
     setCanvasSize(QSize( _canvasSize.width(),h));
}
void ImageListModel::setCanvasWidth(int w) {
    setCanvasSize(QSize(w, _canvasSize.height()));
}
void ImageListModel::setCanvasSize(int w, int h) {
    setCanvasSize(QSize(w,h));
}