Beispiel #1
0
Standalone::Standalone(QWidget *parent, const char *name):QWidget(parent,name)
{
	m=new MainWidget(this);
	connect(m, SIGNAL(configChanged()), SLOT(configChanged()));
	actions=new QHButtonGroup(this);
	_whatsthis=new QPushButton(_("&What's This?"), actions);
	_whatsthis->setAccel(SHIFT+Key_F1);
	QWhatsThis::add(_whatsthis, _("The <i>What's This?</i> button is part of this program's help system. Click on the What's This? button then on any widget in the window to get information (like this) on it."));
	connect(_whatsthis, SIGNAL(clicked()), SLOT(whatsthis()));
	_help=new QPushButton(_("&Help"), actions);
	_help->setAccel(Key_F1);
	QWhatsThis::add(_help, _("This button calls up the program's online help system. If it does nothing, no help file has been written (yet); in that case, use the <i>What's This</i> button on the left."));
	connect(_help, SIGNAL(clicked()), this, SLOT(help()));
	_deflt=new QPushButton(_("&Default"), actions);
	QWhatsThis::add(_deflt, _("This button resets all parameters to some (hopefully sane) default values."));	
	connect(_deflt, SIGNAL(clicked()), this, SLOT(defaults()));
	_reset=new QPushButton(_("&Reset"), actions);
	QWhatsThis::add(_reset, _("This button resets all parameters to what they were before you started the program."));
	connect(_reset, SIGNAL(clicked()), this, SLOT(reset()));
	_apply=new QPushButton(_("&Apply"), actions);
	QWhatsThis::add(_apply, _("This button saves all your changes without exiting."));
	connect(_apply, SIGNAL(clicked()), this, SLOT(apply()));
	_ok=new QPushButton(_("&OK"), actions);
	QWhatsThis::add(_ok, _("This button saves all your changes and exits the program."));
	connect(_ok, SIGNAL(clicked()), this, SLOT(ok()));
	_cancel=new QPushButton(_("&Cancel"), actions);
	QWhatsThis::add(_cancel, _("This button exits the program without saving your changes."));
	connect(_cancel, SIGNAL(clicked()), this, SLOT(cancel()));
	_apply->setEnabled(false);
	setMinimumWidth(actions->sizeHint().width()+10);
	arrangeWidgets();
}
 void ImageViewerScreen::createUI()
 {
     setupMainLayout();
     setupImageView();
     setupButtons();
     setupActivityIndicator();
     arrangeWidgets();
 }
Beispiel #3
0
	void CameraScreen::createUI()
	{
        setupMainLayout();
		setupCamera();
		setupButtons();
		setupActivityIndicator();
		arrangeWidgets();
	}
Beispiel #4
0
        void kClipHolder::removeBtnView(){
            if(btnView) {
                for (int i=0; i<btnView->widgets.size(); i++)
                    ofRemoveListener( *btnView->events.lookup("btnClicked"),this,&kClipHolder::btnClicked);

                view->addDelete(btnView);

                removeWidget(btnView);
                btnView.reset();
                removeSubView();
                arrangeWidgets();

            }

        }
Beispiel #5
0
void WordSelect::makeButton(string _str){
    btn = make_shared<kLabelButton>( );

    string newString;

    if( _str.length() <= 20 )
        newString = _str;
    else
        newString = _str.substr(0,20);

    btn->setLabel( newString );
    btn->set(0,0,80,70);
    btn->setMode(TOGGLE_ON);
    addWidget(btn);
    ofAddListener(*btn->events.lookup("press"),this,&WordSelect::btnClicked);
    arrangeWidgets();
}
Beispiel #6
0
//--------------------------------------------------------------
void kThreadClipView::update(ofEventArgs & args) {

//cout << "UPDATE" << endl;
	// make sure the thread has finished and that we have a loaded 'cue' video that has NOT been textured
	if( !isThreadRunning()
//        && loaded[cueVideo] && !textured[cueVideo]
        ) {


        if ( shouldSetClips ) {
            for (int i=0; i<tmpClips.size(); i++)
            {
                clips[i] -> img.setUseTexture(true);
                cout << "TEXTTT"<<clips[i] -> img.isUsingTexture() << endl;
//                clips[i] -> setClip(tmpClips[i]);

                const ofPixels& pix = clips[i] -> img.getPixelsRef();
                clips[i] -> img.getTextureReference().allocate(
                         pix.getWidth()
                        ,pix.getHeight()
                        ,ofGetGlInternalFormat(pix)
                );

                clips[i] -> img.setUseTexture(true);
                clips[i] -> img.update();


            }

            tmpClips.clear();
            arrangeWidgets();

            shouldSetClips = false;
        }


	}

	// if we have a loaded video and the thread is not running then update the current video player
//	if(loaded[currentVideo] && textured[currentVideo]) {
//		video[currentVideo]->update();
//	}
#ifdef USE_QUE
//	if(!loading) popQueue();
#endif
}
Beispiel #7
0
    bool kClipView::addClip(shared_ptr<Clip> _clip){
        shared_ptr<kClipShow> clip = make_shared<kClipShow>();
        clip -> setClip(_clip);
//        clip -> setName(_clip->getName());
        clip->set( 0, 0, CLIPVIEW_SIZE, CLIPVIEW_SIZE );
        clip->setActiveRange(0.5f);
        addWidget( clip );
        cout << "ADDDDD "<< clip->getName() << endl;
        clips.push_back(clip);
//

        ofAddListener( *clip->events.lookup("press"),this,&kClipView::clipClicked );
        ofAddListener( *clip->events.lookup("drag"),this,&kClipView::clipDragged );

//        if(!visible) clip->hide();
        arrangeWidgets();
    }
Beispiel #8
0
        void kClipHolder::addBtnView(){
            btnView = make_shared<kCircleButtonView>();
            btnView->set(0,0,1.0f,1.0f);
            btnView -> applySettings ( settings  );
            btnView -> setWidgetSettings ( settings );

            addWidget(btnView);

            vector<string> labels;
            labels.push_back("select");
            labels.push_back("connect");
            labels.push_back("related");
            labels.push_back("scenes");
            labels.push_back("tags");
//
            btnView -> addButtons(labels);
////            for (int i=0; i<labels.size(); i++)
////                ofAddListener( *btnView->events.lookup("btnClicked"),this,&kClipHolder::btnClicked);

            arrangeWidgets();


        }
Beispiel #9
0
        void kClipHolder::showView(float _x, float _y)   {
            if(subView) {
                subView -> setX( _x );
                subView -> setY( _y );

                subView -> label = "options";
//
                /// ask for ctl to populate it, through notify

                vector<string> labels;
                for (int i=0; i<2; i++)
                {
                    labels.push_back( ofToString(rand()%10) );
                }

                subView -> addButtons(labels);

                subView -> show();

                arrangeWidgets();
            }


        }
Beispiel #10
0
void Standalone::resizeEvent(QResizeEvent *e)
{
	QWidget::resizeEvent(e);
	arrangeWidgets();
}
Beispiel #11
0
        void kMediaScrollView::addMedia( vector<shared_ptr<MediaHolder> > _media ){

            clearWidgets();
            string type;

            for (int i=0; i<_media.size(); i++)
            {

                type = _media[i]->getType();

                if(type == "clip") {
                    shared_ptr<kClipShow> btn = make_shared<kClipShow>();
                    btn->setSize(widgetSize);

                    shared_ptr< Clip > clip = dynamic_pointer_cast< Clip >( _media[i] );

                    btn->setClip( clip );

                    btn->value = i;
                    addWidget( btn );

                    ofAddListener( *btn->events.lookup("press"),this,&kMediaScrollView::btnClicked);
                    ofAddListener( *btn->events.lookup("drag"),this,&kMediaScrollView::btnDragged);

                }
                else if(type == "sample") {

//                    shared<kSampleShow> btn = make_shared<kSampleShow>();
//                    btn->setSize(widgetSize);
//                    btn->setSample( _samples[i] );
//
//                    btn->value = i;
//                    addWidget( btn );
//
//                    ofAddListener( *btn->events.lookup("press"),this,&kButtonView::btnClicked);
//                    ofAddListener( *btn->events.lookup("drag"),this,&kButtonView::btnDragged);

                }
                else if(type == "text") {

//                    shared<kTextShow> btn = make_shared<kTextShow>();
//                    btn->setSize(widgetSize);
//                    btn->setText( _texts[i] );
//
//                    btn->value = i;
//                    addWidget( btn );
//
//                    ofAddListener( *btn->events.lookup("press"),this,&kButtonView::btnClicked);
//                    ofAddListener( *btn->events.lookup("drag"),this,&kButtonView::btnDragged);

                }



            }



            arrangeWidgets();


        }
Beispiel #12
0
void managementWidget::resizeEvent(QResizeEvent *)
{
  arrangeWidgets();
}