Ejemplo n.º 1
0
void AMBrowseScansView::initializeChildViews()
{
	// Scan Thumbnail View
	AMScanThumbnailGridView* thumbnailView = new AMScanThumbnailGridView(this);
	thumbnailView->setContextMenuPolicy(Qt::CustomContextMenu);
	QIcon thumbnailIcon;
	thumbnailIcon.addFile(QString::fromUtf8(":/22x22/view-list-icons-symbolic.png"), QSize(), QIcon::Normal, QIcon::Off);
	thumbnailIcon.addFile(QString::fromUtf8(":/22x22/view-list-icons-symbolic_dark.png"), QSize(), QIcon::Normal, QIcon::On);

	addChildView(thumbnailView, thumbnailIcon);

	// Table Data View
	AMScanTableView* tableView = new AMScanTableView(this);
	tableView->setContextMenuPolicy(Qt::CustomContextMenu);
	QIcon tableIcon;
	tableIcon.addFile(QString::fromUtf8(":/22x22/view-list-details-symbolic.png"), QSize(), QIcon::Normal, QIcon::Off);
	tableIcon.addFile(QString::fromUtf8(":/22x22/view-list-details-symbolic_dark.png"), QSize(), QIcon::Normal, QIcon::On);


	addChildView(tableView, tableIcon);

	// Tree Data View
	AMScanTreeView* treeView = new AMScanTreeView(this);
	treeView->setContextMenuPolicy(Qt::CustomContextMenu);
	QIcon treeIcon;
	treeIcon.addFile(QString::fromUtf8(":/22x22/view-list-compact-symbolic.png"), QSize(), QIcon::Normal, QIcon::Off);
	treeIcon.addFile(QString::fromUtf8(":/22x22/view-list-compact-symbolic_dark.png"), QSize(), QIcon::Normal, QIcon::On);

	addChildView(treeView, treeIcon);
}
void ofxGenericBarGraphView::setCurrentTextVisible( bool visible )
{
    if ( visible )
    {
        if ( !_currentText )
        {
            _currentText = ofxGenericTextView::create( getFrame( ofPoint( 0, 0 ) ) );
            if ( _currentText )
            {
                //_currentText->setAutosizeFontToFitText( ofxGenericViewAutoresizingFull );
                switch( _expand )
                {
                    case ofxGenericBarGraphViewExpandHorizontalRight:
                        _currentText->setTextAlignment( ofxGenericTextHorizontalAlignmentLeft );
                        break;
                    default:
                        _currentText->setTextAlignment( ofxGenericTextHorizontalAlignmentRight );
                        break;

                }
                addChildView( _currentText );
                
                _currentText->setText( ofToString( getCurrent() ) );
            }
        }
        updateCurrentText();
    } else
    {
        if ( _currentText )
        {
            _currentText->removeFromParent();
            _currentText = ofPtr< ofxGenericTextView >();
        }
    }
}
Ejemplo n.º 3
0
void CameraView::didLoad()
{
    ofxGenericView::didLoad();
    setBackgroundColor( ofColor( 0, 0, 0 ) );
    setAutoresizingMask( ofxGenericViewAutoresizingFull );

    _microphone = ofxGenericMicrophone::create();

    _camera = ofxGenericCameraPreviewView::create( dynamic_pointer_cast< ofxGenericCameraPreviewViewDelegate >( _this ), getFrame( ofPoint( 0, 0 ) ) );
    _camera->setAutoresizingMask( ofxGenericViewAutoresizingFull );
    addChildView( _camera );
    
    _currentlyTakingPictureView = ofxGenericActivityView::create( ofRectangle( 20, 40, 20, 20 ) );
    _currentlyTakingPictureView->setColor( ofColor( 0, 0, 0 ) );
    _currentlyTakingPictureView->setHidesWhenStoppedAnimating( true );
    addChildView( _currentlyTakingPictureView );
}
void ofxGenericFrameView::willAppear()
{
    ofxGenericView::willAppear();
    
    for( unsigned int edge = 1; edge <= 4; edge ++ )
    {
        ofPtr< ofxGenericView > add = ofxGenericView::create();
        add->setBackgroundColor( _color );
        _frame.push_back( add );
        addChildView( add );
    }
    refresh();
}
void ofxGenericBarGraphView::didLoad()
{
    _barView = ofxGenericImageView::create( getFrame() );
    addChildView( _barView );
    recalculateBar();
}