示例#1
0
NS_CC_BEGIN

CAStepper::CAStepper(const CAStepperOrientation& type)
: m_bAutoRepeat(true)
, m_bContinuous(true)
, m_bWraps(false)
, m_value(0)
, m_minimumValue(0)
, m_maximumValue(100)
, m_stepValue(0)
, m_pDecrementImageView(NULL)
, m_pIncrementImageView(NULL)
, m_pBackgroundImageView(NULL)
, m_pBackgroundSelectedImageView(NULL)
, m_actionType(ActionNone)
, m_bTouchEffect(false)
, m_pDividerImageView(NULL)
, m_pCAStepperOrientation(type)
,m_cTintColor(ccc4(54, 195, 240, 255))
{
    memset(m_pBackgroundImage, 0x00, sizeof(m_pBackgroundImage));
    memset(m_pIncrementImage, 0x00, sizeof(m_pIncrementImage));
    memset(m_pDecrementImage, 0x00, sizeof(m_pDecrementImage));
    
    setBackgroundImage(CAImage::create("source_material/btn_rounded_normal.png"), CAControlStateNormal);
    setBackgroundImage(CAImage::create("source_material/btn_rounded_highlighted.png"), CAControlStateHighlighted);
    setIncrementImage(CAImage::create("source_material/stepper_inc_h.png"), CAControlStateAll);
    setIncrementImage(CAImage::create("source_material/stepper_inc_n.png"), CAControlStateNormal);
    setDecrementImage(CAImage::create("source_material/stepper_dec_h.png"), CAControlStateAll);
    setDecrementImage(CAImage::create("source_material/stepper_dec_n.png"), CAControlStateNormal);
}
示例#2
0
bool CAStepper::init()
{
    if (!CAControl::init())
    {
        return false;
    }
    setBackgroundImage(CAImage::create("source_material/btn_rounded_normal.png"), CAControlStateNormal);
    setBackgroundImage(CAImage::create("source_material/btn_rounded_highlighted.png"), CAControlStateHighlighted);
    setIncrementImage(CAImage::create("source_material/stepper_inc_h.png"), CAControlStateAll);
    setIncrementImage(CAImage::create("source_material/stepper_inc_n.png"), CAControlStateNormal);
    setDecrementImage(CAImage::create("source_material/stepper_dec_h.png"), CAControlStateAll);
    setDecrementImage(CAImage::create("source_material/stepper_dec_n.png"), CAControlStateNormal);
    return true;
}
示例#3
0
void AboutLayer::setupViews(){

    setBackgroundImage( "loading.png" );
    
    //  加入title
    CCSprite* title = CCSprite::create( "menuTitle.png",CCRectMake(0, 34, 130, 38) );
    
    title->setAnchorPoint( ccp(0.5, 1) );
    title->setPosition( ccp( getWinSize().width / 2 ,getWinSize().height -20 ) );
    this->addChild( title );
    //  加入文字说明
    
    CCLabelBMFont* pDes = CCLabelBMFont::create( "This Game is recoded by longlingxiu ", "arial-14.fnt" );
    
    pDes->setPosition( ccp(getWinSize().width / 2, getWinSize().height / 2) );
    
    this ->addChild(pDes);
    
    
    
    CCLabelBMFont* fontOfBack = CCLabelBMFont::create("Go Back", "arial-14.fnt" );
    
    fontOfBack->setScale(1.5f);
    
    CCMenuItemLabel* backLabel = CCMenuItemLabel::create(fontOfBack, this, menu_selector(AboutLayer::back_callback));
    backLabel->setAnchorPoint( ccp( 0.5, 0 ) );
    backLabel->setPosition( ccp( getWinSize().width / 2, 30) );
    
    CCMenu* menu = CCMenu::create( backLabel, NULL );;
    menu->setPosition( CCPointZero );
    
    this->addChild( menu );
    
}
示例#4
0
void GuiBox::setData(GuiBoxData data)
{
	setBackgroundImage(data.backgroundPath, data.backgroundTiled);
	setHorizontalImage(data.horizontalPath, data.horizontalTiled);
	setVerticalImage(data.verticalPath, data.verticalTiled);
	setCornerImage(data.cornerPath);
}
示例#5
0
void SpeedDial::loadSettings()
{
    m_loaded = true;

    Settings settings;
    settings.beginGroup("SpeedDial");
    QString allPages = settings.value("pages", QString()).toString();
    setBackgroundImage(settings.value("background", QString()).toString());
    m_backgroundImageSize = settings.value("backsize", "auto").toString();
    m_maxPagesInRow = settings.value("pagesrow", 4).toInt();
    m_sizeOfSpeedDials = settings.value("sdsize", 231).toInt();
    m_sdcentered = settings.value("sdcenter", false).toBool();
    settings.endGroup();

    if (allPages.isEmpty()) {
        allPages = "url:\"https://www.qupzilla.com\"|title:\"QupZilla\";"
                   "url:\"http://blog.qupzilla.com\"|title:\"QupZilla Blog\";"
                   "url:\"https://github.com/QupZilla/qupzilla\"|title:\"QupZilla GitHub\";"
                   "url:\"https://duckduckgo.com\"|title:\"DuckDuckGo\";";
    }
    changed(allPages);

    m_thumbnailsDir = DataPaths::currentProfilePath() + "/thumbnails/";

    // If needed, create thumbnails directory
    if (!QDir(m_thumbnailsDir).exists()) {
        QDir(DataPaths::currentProfilePath()).mkdir("thumbnails");
    }
}
示例#6
0
ErrorForm::ErrorForm(int error, QWidget *parent)
    : QWidget(parent)
{
	ui.setupUi(this);
	setBackgroundImage();
	
	QLabel *errorMsg = new QLabel("ERROR: " + QString::number(error), this);
	QLabel *personLogo = new QLabel(this);
	personLogo->setPixmap(QPixmap(":/icons/userIcon.png"));
	ButtonLabel *quitButton = new ButtonLabel(QPixmap(":/icons/quitButton.png"), QPixmap(":/icons/quitButton.png"), this);
	connect(quitButton, SIGNAL(released()), QApplication::instance(), SLOT(quit()));
	ButtonLabel *backButton = new ButtonLabel(QPixmap(":/icons/backButton.png"), QPixmap(":/icons/backButton.png"), this);
	connect(backButton, SIGNAL(released()), this, SLOT(close()));
	
	/* layout operations */
	QHBoxLayout *headerLayout = new QHBoxLayout();
	headerLayout->setContentsMargins(5, 5, 5, 5);
	headerLayout->addWidget(personLogo);
	headerLayout->addStretch();
	headerLayout->addWidget(quitButton);
	
	QVBoxLayout *mainLayout = new QVBoxLayout();
	mainLayout->addLayout(headerLayout);
	mainLayout->addWidget(errorMsg);
	mainLayout->setAlignment(errorMsg, Qt::AlignLeft);
	mainLayout->addStretch();
	mainLayout->addWidget(backButton);
	mainLayout->setAlignment(backButton, Qt::AlignLeft);
	
	setLayout(mainLayout);
}
/**
 * Subtract a previously set background image from an input image to produce
 * the output matrix.
 * 
 */
void BackgroundSubtractor::subtractBackground() {
    
    // Only proceed with processing if we are getting a valid frame
    if (frame_source.getSharedMat(current_frame)) {

        current_raw_frame = current_frame.clone();
        
        if (background_set) {

            try {
                CV_Assert(current_frame.size() == background_img.size());
                current_frame = current_frame - background_img;
            } catch (cv::Exception& e) {
                std::cout << "CV Exception: " << e.what() << "\n";
                exit(EXIT_FAILURE);
            }

        } else {

            // First image is always used as the default background image
            setBackgroundImage();
        }

        frame_sink.pushMat(current_frame);
    }

}
示例#8
0
ILXStatusBar::ILXStatusBar(int argc, char* argv[])
        : Application(&argc, &argv, (AppOptions) (OptDaleAuto))
{
    setBackgroundImage(ILIXI_DATADIR"car/statusbar/statusbar_bg.png");

    setMargins(0, 0, 0, 0);
    HBoxLayout* mainLayout = new HBoxLayout();
    mainLayout->setVerticalAlignment(Alignment::Middle);
    mainLayout->setSpacing(0);
    setLayout(mainLayout);

    _home = new StatusbarButton();
    _home->addImage(new Image(ILIXI_DATADIR"car/statusbar/home.png", Size(48, 48)));
    _home->addImage(new Image(ILIXI_DATADIR"car/statusbar/homeG.png", Size(48, 48)));
    _home->setActive(1);
    _home->sigClicked.connect(sigc::mem_fun(this, &ILXStatusBar::clickedHome));
    addWidget(_home);

    _switch = new StatusbarButton();
    _switch->addImage(new Image(ILIXI_DATADIR"car/statusbar/switch.png", Size(48, 48)));
    _switch->addImage(new Image(ILIXI_DATADIR"car/statusbar/switchG.png", Size(48, 48)));
    _switch->sigClicked.connect(sigc::mem_fun(this, &ILXStatusBar::clickedSwitcher));
    addWidget(_switch);

    _dash = new StatusbarButton();
    _dash->addImage(new Image(ILIXI_DATADIR"car/statusbar/dash.png", Size(48, 48)));
    _dash->addImage(new Image(ILIXI_DATADIR"car/statusbar/dashG.png", Size(48, 48)));
    _dash->sigClicked.connect(sigc::mem_fun(this, &ILXStatusBar::clickedDash));
    addWidget(_dash);

    _sound = new StatusbarButton();
    _sound->addImage(new Image(ILIXI_DATADIR"car/statusbar/vol0.png", Size(48, 48)));
    _sound->addImage(new Image(ILIXI_DATADIR"car/statusbar/vol0G.png", Size(48, 48)));
    _sound->addImage(new Image(ILIXI_DATADIR"car/statusbar/vol1.png", Size(48, 48)));
    _sound->addImage(new Image(ILIXI_DATADIR"car/statusbar/vol1G.png", Size(48, 48)));
    _sound->addImage(new Image(ILIXI_DATADIR"car/statusbar/vol2.png", Size(48, 48)));
    _sound->addImage(new Image(ILIXI_DATADIR"car/statusbar/vol2G.png", Size(48, 48)));
    _sound->addImage(new Image(ILIXI_DATADIR"car/statusbar/vol3.png", Size(48, 48)));
    _sound->addImage(new Image(ILIXI_DATADIR"car/statusbar/vol3G.png", Size(48, 48)));
    _sound->sigClicked.connect(sigc::mem_fun(this, &ILXStatusBar::clickedSound));
    _sound->setButtonState(6);
    addWidget(_sound);

    _back = new StatusbarButton();
    _back->setVisible(false);
    _back->addImage(new Image(ILIXI_DATADIR"car/statusbar/back0.png", Size(48, 48)));
    _back->sigClicked.connect(sigc::mem_fun(this, &ILXStatusBar::clickedBack));
    addWidget(_back);

    addWidget(new Clock());

    _rca = new RemoteContentArea();
    addWidget(_rca);

    sigVisible.connect(sigc::mem_fun(this, &ILXStatusBar::onShow));
    sigHidden.connect(sigc::mem_fun(this, &ILXStatusBar::onHide));

    _statComp = new StatusbarComponent(this);

}
示例#9
0
文件: app.cpp 项目: speakman/qlc
/**
 * Main initialization function
 */
void App::init()
{
	QSettings settings;

	setWindowIcon(QIcon(":/qlc.png"));

#ifndef __APPLE__
	/* MDI Area */
	setCentralWidget(new QMdiArea(this));
	centralWidget()->setContextMenuPolicy(Qt::CustomContextMenu);
	connect(centralWidget(),
		SIGNAL(customContextMenuRequested(const QPoint&)),
		this,
		SLOT(slotCustomContextMenuRequested(const QPoint&)));

	/* Workspace background */
	setBackgroundImage(settings.value("/workspace/background").toString());

	/* Application geometry and window state */
	QVariant var;
	var = settings.value(KXMLQLCGeometry, QRect(0, 0, 800, 600));
	if (var.isValid() == true)
		setGeometry(var.toRect());
	var = settings.value(KXMLQLCWindowState, Qt::WindowNoState);
	if (var.isValid() == true)
		setWindowState(Qt::WindowState(var.toInt()));
#else
	/* App is just a toolbar, we only need it to be the size of the
	   toolbar's buttons */
	resize(600, 32);
	move(0, 22);
#endif

	/* Input & output mappers and their plugins */
	initOutputMap();
	initInputMap();

	/* Function running engine/master timer */
	m_masterTimer = new MasterTimer(this, m_outputMap);
	m_masterTimer->start();

	/* Buses */
	Bus::init(this);

	/* Fixture definitions */
	loadFixtureDefinitions();

	// The main view
	initStatusBar();
	initActions();
	initMenuBar();
	initToolBar();

	// Document
	initDoc();

	// Start up in non-modified state
	m_doc->resetModified();
}
示例#10
0
文件: app.cpp 项目: speakman/qlc
void App::slotSetBackgroundImage()
{
	QString path = QFileDialog::getOpenFileName(
		this, tr("Open an image file"), getenv("HOME"),
		tr("Images (*.png *.xpm *.jpg *.gif)"));

	if (path.isEmpty() == false)
		setBackgroundImage(path);
}
示例#11
0
void EdoChatWindow::updateBackgroundImage()
{
	if (getComponentPropertyBool (EWND_BG_IMG, false, false) == true)
	{
		File bgFile(getComponentProperty (EWND_BG_IMG_PATH, false));
		if (bgFile.existsAsFile())
		{
			setBackgroundImage (ImageCache::getFromFile (bgFile));
		}
		else
		{
			setBackgroundImage (0);
		}
	}
	else
	{
		setBackgroundImage (0);
	}
}
示例#12
0
void BaseGUI::configureGUI(sofa::simulation::Node::SPtr groot)
{

    sofa::component::configurationsetting::SofaDefaultPathSetting *defaultPath;
    groot->get(defaultPath, sofa::core::objectmodel::BaseContext::SearchRoot);
    if (defaultPath)
    {
        if (!defaultPath->recordPath.getValue().empty())
        {
            setRecordPath(defaultPath->recordPath.getValue());
        }

        if (!defaultPath->gnuplotPath.getValue().empty())
            setGnuplotPath(defaultPath->gnuplotPath.getValue());
    }


    //Background
    sofa::component::configurationsetting::BackgroundSetting *background;
    groot->get(background, sofa::core::objectmodel::BaseContext::SearchRoot);
    if (background)
    {
        if (background->image.getValue().empty())
            setBackgroundColor(background->color.getValue());
        else
            setBackgroundImage(background->image.getFullPath());
    }

    //Stats
    sofa::component::configurationsetting::StatsSetting *stats;
    groot->get(stats, sofa::core::objectmodel::BaseContext::SearchRoot);
    if (stats)
    {
        setDumpState(stats->dumpState.getValue());
        setLogTime(stats->logTime.getValue());
        setExportState(stats->exportState.getValue());
#ifdef SOFA_DUMP_VISITOR_INFO
        setTraceVisitors(stats->traceVisitors.getValue());
#endif
    }

    //Viewer Dimension TODO in viewer !
    sofa::component::configurationsetting::ViewerSetting *viewerConf;
    groot->get(viewerConf, sofa::core::objectmodel::BaseContext::SearchRoot);
    if (viewerConf) setViewerConfiguration(viewerConf);

    //TODO: Video Recorder Configuration

    //Mouse Manager using ConfigurationSetting component...
    sofa::helper::vector< sofa::component::configurationsetting::MouseButtonSetting*> mouseConfiguration;
    groot->get<sofa::component::configurationsetting::MouseButtonSetting>(&mouseConfiguration, sofa::core::objectmodel::BaseContext::SearchRoot);

    for (unsigned int i=0; i<mouseConfiguration.size(); ++i)  setMouseButtonConfiguration(mouseConfiguration[i]);

}
示例#13
0
文件: Page.cpp 项目: woda/desktop
void	Page::setBackground(int idx) {
  switch (idx)
    {
    case Page::GENERAL_PAGE :
    case Page::ACCOUNT_PAGE :
    case Page::SYNC_PAGE :
    case Page::SIGNIN_PAGE :
      setBackgroundImage(":/fond");
      break;
    }
}
示例#14
0
osgtools::BusyWidget::BusyWidget( int width, int height ) :
	Widget(width, height, (width-30)/2, (height-30)/2, 30, 30),
	_sImgPath("../../dep/images/spinning-wait-icons/wait30trans.gif")
{
	// Set the background image
	setBackgroundImage(_sImgPath);

	// Set the background color
	if (_camera.valid())
		_camera->setClearColor(osg::Vec4(1.0, 1.0, 1.0, 1.0));
}
示例#15
0
TuningTabWidget::TuningTabWidget(QWidget *_parent)
: tabWidget(this), tuningWidget(&tabWidget), 
sceneWidget(&tabWidget), KTVDialog(_parent)
{
	setBackgroundImage(BACKGROUND_IMAGE_PATH);

	tabWidget.setGeometry(17, 30, 526, 260);

	tabWidget.addTab(&tuningWidget, TUNING_IMAGE_PATH);
	tabWidget.addTab(&sceneWidget, SCENE_IMAGE_PATH);
}
示例#16
0
void userPreferences::sBackgroundList()
{
  ParameterList params;
  params.append("image_id", _backgroundImageid);

  imageList newdlg(this, "", TRUE);
  newdlg.set(params);

  int imageid;
  if ((imageid = newdlg.exec()) != 0)
    setBackgroundImage(imageid);
}
示例#17
0
PreviewWidget::PreviewWidget(QWidget *parent)
: songID(0), collectionButton(COLLECTION_BUTTON_IMAGE, this), songButton(SONG_BUTTON_IMAGE, this),
insertSongButton(INSERT_SONG_BUTTON_IMAGE, this), loginInMaskWidget(parent), 
KTVDialog(parent)
{
	setBackgroundImage(WORD_COUNT_BACKGROUND_IMAGE_PATH);
	insertSongButton.setPos(QPoint(137, 418));
	songButton.setPos(QPoint(246, 409));
	collectionButton.setPos(QPoint(305, 418));

	setupConnection();
}
示例#18
0
ImageWidget::ImageWidget(QString image, QWidget *parent)
    : QWidget(parent)
{
	ui.setupUi(this);
	setBackgroundImage();
	this->setContentsMargins(0,0,0,0);
	
	/* create the GUI objects */
	backButton = new ButtonLabel(QPixmap(":/icons/backButton.png"), QPixmap(":/icons/backButtonPushed.png"), this);
	connect(backButton, SIGNAL(released()), this, SLOT(close()));
	quitButton = new ButtonLabel(QPixmap(":/icons/quitButton.png"), QPixmap(":/icons/quitButtonPushed.png"), this);
	connect(quitButton, SIGNAL(released()), QApplication::instance(), SLOT(quit()));
	patientIcon = new QLabel(this);
	patientIcon->setPixmap(QPixmap(":/icons/patientIcon.png"));
	
	footer = new ChangePatientFooter(this);
	
	QLabel *imageLabel = new QLabel(this);
	imageLabel->setPixmap(QPixmap(":/icons/testImage.png"));
	
	QLabel *headerText = new QLabel(this);
	headerText->setStyleSheet("font-family: arial; font-weight: bold; font-size: 18px;");
	headerText->setText("<font color=\"#622181\">Paziente</font><font color=\"#9C9E9F\"> / </font><font color=\"#0B72B5\">Immagini</font>");
	
	QVBoxLayout *mainLayout = new QVBoxLayout();
	
	QHBoxLayout *headerLayout = new QHBoxLayout();
	headerLayout->setContentsMargins(13, 13, 13, 0);
	headerLayout->addWidget(patientIcon);
	headerLayout->addSpacing(3);
	headerLayout->addWidget(headerText);
	headerLayout->setAlignment(headerText, Qt::AlignVCenter);
	headerLayout->addStretch();	
	headerLayout->addWidget(quitButton);
	
	QHBoxLayout *backHLayout = new QHBoxLayout();
	backHLayout->setContentsMargins(15, 0,0,0);
	backHLayout->addWidget(backButton);
	
	mainLayout->setContentsMargins(0,0,0,0);
	mainLayout->addLayout(headerLayout);
	mainLayout->addSpacing(7);
	mainLayout->addWidget(imageLabel);
	mainLayout->addStretch(3);
	mainLayout->addLayout(backHLayout);
	mainLayout->addStretch(1);
	mainLayout->addWidget(footer);
	
	setLayout(mainLayout);
}
示例#19
0
文件: kscrollbar.cpp 项目: kxtry/kxfw
/*!
  Sets the orientation of the scrollbar to the given \a orientation.
  \sa orientation()
 */
void KScrollBar::setOrientation(Qt::Orientation orientation)
{
	if(orientation == m_orientation)
		return;
    m_orientation = orientation;
	if(orientation == Qt::Vertical)
	{
		setLineAddImage(":/image/theme/vscrollbar_lineadd_normal.png|:/image/theme/vscrollbar_lineadd_hover.png|:/image/theme/vscrollbar_lineadd_down.png");
		setLineSubImage(":/image/theme/vscrollbar_linesub_normal.png|:/image/theme/vscrollbar_linesub_hover.png|:/image/theme/vscrollbar_linesub_down.png");
		setBackgroundImage(":/image/theme/vscrollbar_bkg.png");
		setThumbImage(":/image/theme/vscrollbar_thumb_normal.png|:/image/theme/vscrollbar_thumb_hover.png|:/image/theme/vscrollbar_thumb_down.png");
		setThumbIcon(":/image/theme/vscrollbar_thumbico.png");
		setThumbIconOffset(QPointF(-1,1));
	}
	else
	{
		setLineAddImage(":/image/theme/hscrollbar_lineadd_normal.png|:/image/theme/hscrollbar_lineadd_hover.png|:/image/theme/hscrollbar_lineadd_down.png");
		setLineSubImage(":/image/theme/hscrollbar_linesub_normal.png|:/image/theme/hscrollbar_linesub_hover.png|:/image/theme/hscrollbar_linesub_down.png");
		setBackgroundImage(":/image/theme/hscrollbar_bkg.png");
		setThumbImage(":/image/theme/hscrollbar_thumb_normal.png|:/image/theme/hscrollbar_thumb_hover.png|:/image/theme/hscrollbar_thumb_down.png");
		setThumbIcon(":/image/theme/hscrollbar_thumbico.png");
		setThumbIconOffset(QPointF(1,-1));
	}
}
示例#20
0
void k9MenuEdit::urBackgroundSelected(const QString &_fileName) {
    if ( m_menuEditor->getSelected() ) {
//If a button is selected, set the button image ...
        k9MenuButton *b=(k9MenuButton*)m_menuEditor->getSelected();
        QImage img;
        img.load(_fileName);
        b->setImage(img);
    } else {
//...otherwise, set the menu background image
        QImage img;
        img.load(_fileName);
        img=img.smoothScale(720,m_imageHeight,QImage::ScaleMax);
        setBackgroundImage(img);
    }
}
示例#21
0
NotesForm::NotesForm(QString title, QString text, QWidget *parent)
    : QWidget(parent)
{
	ui.setupUi(this);
	setBackgroundImage();
	
	/* create the GUI objects */
	backButton = new ButtonLabel(QPixmap(":/backButton.png"), QPixmap(":/backButton.png"), this);
	connect(backButton, SIGNAL(released()), this, SLOT(close()));
	quitButton = new ButtonLabel(QPixmap(":/quitButton.png"), QPixmap(":/quitButton.png"), this);
	connect(quitButton, SIGNAL(released()), QApplication::instance(), SLOT(quit()));
	patientImagesIcon = new QLabel(this);
	patientImagesIcon->setPixmap(QPixmap(":/icons/patient_images.png"));
	
	/* initialize the footer object */
	footer = new ChangePatientFooter(this);
	
	 /* layout operations */
	QHBoxLayout *headerLayout = new QHBoxLayout();
	headerLayout->setMargin(5);
	headerLayout->addWidget(patientImagesIcon);
	headerLayout->addStretch();	
	headerLayout->addWidget(quitButton);
	
	QVBoxLayout *mainLayout = new QVBoxLayout();
	QLabel *note = new QLabel(text, this);
	QScrollArea *scrollArea = new QScrollArea();
	scrollArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
	scrollArea->setWidget(note);
	
	mainLayout->addLayout(headerLayout);
	mainLayout->addStretch();
	mainLayout->addWidget(scrollArea);
	mainLayout->addStretch();
	mainLayout->addWidget(backButton);

	/* footer operations */
	QDesktopWidget* desktopWidget = QApplication::desktop();
	QRect rect = desktopWidget->availableGeometry();
	QSize footerSize(rect.width() , 60);
	footer->setMinimumSize(footerSize);
	footer->setMaximumSize(footerSize);
	footer->setBackgroundImage();
	mainLayout->addStretch();
	mainLayout->addWidget(footer);
			
	setLayout(mainLayout);
}
示例#22
0
//  对控件以及布景 进行初始化
void OptionLayer::setupViews(){
    
    //  加入背景图片
    
    setBackgroundImage( "loading.png" );
    
    //  加入menutitle
    CCSprite* title = CCSprite::create( "menuTitle.png",CCRectMake(0, 0, 133, 36) );
    
    title->setAnchorPoint( ccp(0.5, 1) );
    title->setPosition( ccp( getWinSize().width / 2 ,getWinSize().height -20 ) );
    this->addChild( title );
    
    //  加入menu-- 既是创建CCMenuItemToggle
    CCMenuItemToggle* music_trigger = CCMenuItemToggle::createWithTarget(this, menu_selector(OptionLayer::music_trigger_callback), CCMenuItemFont::create( "Music : On" ),CCMenuItemFont::create("Music : Off"),NULL);
    
    music_trigger->setPosition( ccp( getWinSize().width / 2 ,getWinSize().height / 2 ) );
    //  根据背景音乐播放与否来显示相关的文字选项
    
    if( SimpleAudioEngine::sharedEngine()->isBackgroundMusicPlaying() )
    {
              
        music_trigger->setSelectedIndex( 1 );
        
    }
    else
    {
        music_trigger->setSelectedIndex( 0 );
        
    }
    
    //  创建后退的CCMenuItem
    CCLabelBMFont* fontOfBack = CCLabelBMFont::create("Go Back", "arial-14.fnt" );
    
    fontOfBack->setScale(1.5f);
    
    CCMenuItemLabel* backLabel = CCMenuItemLabel::create(fontOfBack, this, menu_selector(OptionLayer::back_callback));
    backLabel->setAnchorPoint( ccp( 0.5, 0 ) );
    backLabel->setPosition( ccp( getWinSize().width / 2, 30) );
    
    
    CCMenu* menu = CCMenu::create( music_trigger,backLabel,NULL);
    
    menu ->setPosition( CCPointZero );
//    menu->setPosition( ccp( getWinSize().width / 2, getWinSize().height /  2) );
    
    this->addChild( menu );
}
示例#23
0
文件: vcwidget.cpp 项目: speakman/qlc
void VCWidget::chooseBackgroundImage()
{
	QLCImagePreview* preview = new QLCImagePreview();
	QFileDialog* fd = new QFileDialog(this);
	fd->setContentsPreviewEnabled(true);
	fd->setContentsPreview(preview, preview);
	fd->setPreviewMode(QFileDialog::Contents);
	fd->setFilter("Images (*.png *.xpm *.jpg *.gif)");
	fd->setSelection(backgroundImage());
	
	if (fd->exec() == QDialog::Accepted)
		setBackgroundImage(fd->selectedFile());
	
	delete preview;
	delete fd;
}
//--------------------------------------------------------------
void ofApp::setup(){
    sensors = new Sensor[3];
    simulate = false;
    setBackgroundImage();
    setGUI();
#if ARDUINO
    initArduino();
#endif
    failedAttempts = 0;
    
    // listen for EInitialized notification. this indicates that
    // the arduino is ready to receive commands and it is safe to
    // call setupArduino()
    initArduino();
    ofAddListener(arduino.EInitialized, this, &ofApp::setupArduino);
}
示例#25
0
osgtools::BusyWidget::BusyWidget( int width, int height, std::string& imagePath) : 
	Widget(width, height, width/2, height/2, 0, 0),
	_sImgPath( imagePath )
{
	// Set the background image
	setBackgroundImage(_sImgPath);

	// Set the background color
	if (_camera.valid())
		_camera->setClearColor(osg::Vec4(1.0, 1.0, 1.0, 1.0));

	// Update the dimensions
	if (_backgroundImage.valid()) {
		setWidth(_backgroundImage->s());
		setHeight(_backgroundImage->t());
	}
}
示例#26
0
FileBrowser::FileBrowser( const char *name, QWidget *parent )
    : BrowserCategory( name, parent )
    , d( new FileBrowser::Private( this ) )
{
    setLongDescription( i18n( "The file browser lets you browse files anywhere on your system, " \
                        "regardless of whether these files are part of your local collection. " \
                        "You can then add these files to the playlist as well as perform basic "\
                        "file operations." )
                       );
    setImagePath( KStandardDirs::locate( "data", "amarok/images/hover_info_files.png" ) );

    // set background
    if( AmarokConfig::showBrowserBackgroundImage() )
        setBackgroundImage( imagePath() );

    QTimer::singleShot( 0, this, SLOT(initView()) );
}
示例#27
0
AtmosphereWidget::AtmosphereWidget(QWidget *_parent)
: praiseButton(PRAISE_BUTTON_IMAGE, this), wooButton(WOO_BUTTON_IMAGE, this),
spoofButton(SPOOF_BUTTON_IMAGE, this), softLightButton(SOFT_LIGHT_BUTTON_IMAGE, this), 
rockLightButton(ROCK_LIGHT_BUTTON_IMAGE, this), lyricLightButton(LYRIC_BUTTON_IMAGE, this),
brightLightButton(BRIGHT_LIGHT_BUTTON_IMAGE, this)
, KTVDialog(_parent)
{
	setBackgroundImage(BACKGROUND_IMAGE_PATH);

	praiseButton.setPos(QPoint(50, 70));
	wooButton.setPos(QPoint(155, 70));
	spoofButton.setPos(QPoint(260, 70));

	softLightButton.setPos(QPoint(390, 75));
	rockLightButton.setPos(QPoint(470, 75));
	lyricLightButton.setPos(QPoint(390, 128));
	brightLightButton.setPos(QPoint(470, 128));
}
示例#28
0
MGuiApplication::MGuiApplication(int argc, char* argv[])
        : Application(&argc, &argv)
{
    setBackgroundImage(DATADIR"/themes/mgui/bg.dfiff");
    _statusBar = new StatusBar();
    _statusBar->setGeometry(5, 0, 470, 24);
    addWidget(_statusBar);

    _bottomBar = new BottomBar();
    _bottomBar->setGeometry(0, 248, 480, 24);
    addWidget(_bottomBar);

    _resetButton = new ilixi::PushButton("Reset");
    _resetButton->setGeometry(5, 48, 160, 40);
    addWidget(_resetButton);

    _fotaButton = new ilixi::PushButton("Fota");
    _fotaButton->setGeometry(5, 93, 160, 40);
    addWidget(_fotaButton);

    _assertButton = new ilixi::PushButton("No data assert");
    _assertButton->setGeometry(5, 138, 160, 40);
    addWidget(_assertButton);

    _keepAliveButton = new ilixi::PushButton("Keep alive");
    _keepAliveButton->setGeometry(5, 183, 160, 40);
    addWidget(_keepAliveButton);

    _cellular = new ilixi::ToolButton("Cellular");
    _cellular->setGeometry(315, 48, 160, 80);
    addWidget(_cellular);

    _wireless = new ilixi::ToolButton("Wireless");
    _wireless->setGeometry(315, 138, 160, 80);
    addWidget(_wireless);

    _thread = new UBusThread(_statusBar);
    _thread->start();
}
示例#29
0
cv::Mat BackgroundSubtractor::filter(cv::Mat& frame) {
    // Throws cv::Exception if there is a size mismatch between frames,
    // or in any case where cv assertions fail.
    
    // Only proceed with processing if we are getting a valid frame
    if (background_set) {

//#ifdef NOIMP_OAT_USE_CUDA
//        current_frame.upload(frame);
//        cv::cuda::subtract(current_frame, background_frame, result_frame);
//        result_frame.download(frame);
//#else
        frame = frame - background_frame;
//#endif
    } else {

        // First image is always used as the default background image if one is
        // not provided in a configuration file
        setBackgroundImage(frame);
    }

    return frame;
}
void CharSelectState::init(){
	setBackgroundImage(ResourceLoader::getResource("titleBG"));
	title.setTexture(ResourceLoader::getResource("charSelText")).setPosition({ gfx->getWindowWidth() / 2 - 100, 10, 200, 75 });
	setBorderColour({ 60, 60, 60, 255 });
	setSelBorderColour({ 150, 150, 150, 255 });
	setItemBgColour({ 200, 200, 200, 255 });

	SDL_Rect player1Quad = { (gfx->getWindowWidth() / 2) - (((gfx->getWindowWidth()/5)+10)*2), (gfx->getWindowHeight() / 20)*3	, gfx->getWindowWidth() / 5, (gfx->getWindowHeight() / 10) * 8 };
	SDL_Rect player2Quad = { (gfx->getWindowWidth() / 2) - ((gfx->getWindowWidth() / 5 ) + 5), (gfx->getWindowHeight() / 20)*3	, gfx->getWindowWidth() / 5, (gfx->getWindowHeight() / 10) * 8 };
	SDL_Rect player3Quad = { (gfx->getWindowWidth() / 2) + 5								 , (gfx->getWindowHeight() / 20)*3	, gfx->getWindowWidth() / 5, (gfx->getWindowHeight() / 10) * 8 };
	SDL_Rect player4Quad = { (gfx->getWindowWidth() / 2) + ((gfx->getWindowWidth() / 5) + 20), (gfx->getWindowHeight() / 20)*3	, gfx->getWindowWidth() / 5, (gfx->getWindowHeight() / 10) * 8 };

	playerQuarter * player1 = new playerQuarter(0, player1Quad);
	playerQuarter * player2 = new playerQuarter(1, player2Quad);
	playerQuarter * player3 = new playerQuarter(2, player3Quad);
	playerQuarter * player4 = new playerQuarter(3, player4Quad);

	players.push_back(player1);
	players.push_back(player2);
	players.push_back(player3);
	players.push_back(player4);
	addItem(&title);
}