当前位置: 首页>>代码示例>>C++>>正文


C++ setBackgroundColor函数代码示例

本文整理汇总了C++中setBackgroundColor函数的典型用法代码示例。如果您正苦于以下问题:C++ setBackgroundColor函数的具体用法?C++ setBackgroundColor怎么用?C++ setBackgroundColor使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了setBackgroundColor函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: DiagramView

MediaRoutingView::MediaRoutingView(
	RouteAppNodeManager *nodeManager,
	BRect frame,
	const char *name,
	uint32 resizeMode)
	: DiagramView(frame, "MediaRoutingView", true, B_FOLLOW_ALL_SIDES),
	  manager(nodeManager),
	  m_layout(M_ICON_VIEW),
	  m_nextGroupNumber(1),
	  m_lastDroppedNode(0),
	  m_draggedWire(0)
{
	D_METHOD(("MediaRoutingView::MediaRoutingView()\n"));
	ASSERT(manager);

	setBackgroundColor(tint_color(ui_color(B_PANEL_BACKGROUND_COLOR), B_DARKEN_2_TINT));
	setItemAlignment(5.0, 5.0);
	_initLayout();
}
开发者ID:HaikuArchives,项目名称:Cortex,代码行数:19,代码来源:MediaRoutingView.cpp

示例2: setBackgroundColor

void FileTransferWidget::onFileTransferPaused(ToxFile file)
{
    if (fileInfo != file)
        return;

    fileInfo = file;

    ui->etaLabel->setText("");
    ui->progressLabel->setText(tr("Paused", "file transfer widget"));

    // reset mean
    meanIndex = 0;
    for (size_t i=0; i<TRANSFER_ROLLING_AVG_COUNT; ++i)
        meanData[i] = 0.0;

    setBackgroundColor(Style::getColor(Style::LightGrey), false);

    setupButtons();
}
开发者ID:pakhandibaba,项目名称:qTox,代码行数:19,代码来源:filetransferwidget.cpp

示例3: UINode

IUINodeMap::IUINodeMap (IFrontend *frontend, ServiceProvider& serviceProvider, CampaignManager& campaignManager, int x, int y, int width, int height, ClientMap& map) :
		UINode(frontend), _map(map), _campaignManager(campaignManager)
{
	Commands.registerCommand(CMD_CL_CONNECT, new CmdConnect(&_map, serviceProvider));
	Commands.registerCommand(CMD_CL_DISCONNECT, new CmdDisconnect(serviceProvider));
	Commands.registerCommand(CMD_MOVE_UP, new CmdMove(_map, DIRECTION_UP));
	Commands.registerCommand(CMD_MOVE_DOWN, new CmdMove(_map, DIRECTION_DOWN));
	Commands.registerCommand(CMD_ZOOM, new CmdZoom(_map));
	Commands.registerCommand(CMD_MOVE_LEFT, new CmdMove(_map, DIRECTION_LEFT));
	Commands.registerCommand(CMD_MOVE_RIGHT, new CmdMove(_map, DIRECTION_RIGHT));

	ProtocolHandlerRegistry& r = ProtocolHandlerRegistry::get();
	r.registerClientHandler(protocol::PROTO_CHANGEANIMATION, new ChangeAnimationHandler(_map));
	r.registerClientHandler(protocol::PROTO_MAPRESTART, new MapRestartHandler(_map));
	r.registerClientHandler(protocol::PROTO_PAUSE, new PauseHandler(_map));
	r.registerClientHandler(protocol::PROTO_UPDATEENTITY, new UpdateEntityHandler(_map));
	r.registerClientHandler(protocol::PROTO_REMOVEENTITY, new RemoveEntityHandler(_map));
	r.registerClientHandler(protocol::PROTO_SOUND, new SoundHandler());
	r.registerClientHandler(protocol::PROTO_BACKTOMAIN, new BackToMainHandler());
	r.registerClientHandler(protocol::PROTO_RUMBLE, new RumbleHandler(_map));
	r.registerClientHandler(protocol::PROTO_PLAYERLIST, new PlayerListHandler(this));
	r.registerClientHandler(protocol::PROTO_MESSAGE, new TextMessageHandler(this));
	r.registerClientHandler(protocol::PROTO_CLOSEMAP, new CloseMapHandler(_map));
	r.registerClientHandler(protocol::PROTO_LOADMAP, new HudLoadMapHandler(_map, serviceProvider));
	r.registerClientHandler(protocol::PROTO_MAPSETTINGS, new HudMapSettingsHandler(_map));
	r.registerClientHandler(protocol::PROTO_INITWAITING, new InitWaitingMapHandler(serviceProvider));
	r.registerClientHandler(protocol::PROTO_STARTMAP, new StartMapHandler());
	r.registerClientHandler(protocol::PROTO_UPDATEHITPOINTS, new UpdateHitpointsHandler());
	r.registerClientHandler(protocol::PROTO_UPDATELIVES, new UpdateLivesHandler(campaignManager));
	r.registerClientHandler(protocol::PROTO_UPDATEPOINTS, new UpdatePointsHandler());
	r.registerClientHandler(protocol::PROTO_TIMEREMAINING, new TimeRemainingHandler());
	r.registerClientHandler(protocol::PROTO_FINISHEDMAP, new FinishedMapHandler(_map));

	_campaignManager.addListener(this);

	setBackgroundColor(colorNull);

	const float w = static_cast<float>(_frontend->getWidth());
	const float h = static_cast<float>(_frontend->getHeight());
	setPos(_map.getX() / w, _map.getY() / h);
	setSize(_map.getWidth() / w, _map.getHeight() / h);
}
开发者ID:ptitSeb,项目名称:caveexpress,代码行数:42,代码来源:IUINodeMap.cpp

示例4: ProgramSettings

OpenGLPage::OpenGLPage()
{
    ProgramSettings* settings = new ProgramSettings();
    QGridLayout* openglConfigLayout = new QGridLayout();
    QLabel* shadingmodetitle = new QLabel(tr("Shading Mode (0-3)"));
    QSpinBox* shadingmode = new QSpinBox();

    shadingmode->setMaximum(3);
    shadingmode->setMinimum(0);
    shadingmode->setValue(settings->value("opengl/shadingmode").toInt());
    QObject::connect(shadingmode, SIGNAL(valueChanged(int)),
                     settings, SLOT(setShadingMode(int)));

    QLabel* ambientlighttitle = new QLabel(tr("Ambient Light Intensity"));
    QSpinBox* ambientlight = new QSpinBox();

    ambientlight->setMaximum(100);
    ambientlight->setMinimum(0);
    ambientlight->setValue(settings->value("opengl/ambientlight").toInt());
    QObject::connect(ambientlight, SIGNAL(valueChanged(int)),
                     settings, SLOT(setAmbientLight(int)));

    QLabel* backgroundcolortitle = new QLabel(tr("Background Color"));
    QComboBox* backgroundcolor = new QComboBox();

    backgroundcolor->addItem(tr("blue"));
    backgroundcolor->addItem(tr("red"));
    backgroundcolor->addItem(tr("green"));
    backgroundcolor->addItem(tr("brown"));
    backgroundcolor->setCurrentIndex(backgroundcolor->findText(settings->value("opengl/backgroundcolor").toString()));
    QObject::connect(backgroundcolor, SIGNAL(currentIndexChanged(QString)),
                     settings, SLOT(setBackgroundColor(QString)));

    openglConfigLayout->addWidget(shadingmodetitle, 1, 1);
    openglConfigLayout->addWidget(shadingmode, 1, 2);
    openglConfigLayout->addWidget(ambientlighttitle, 2, 1);
    openglConfigLayout->addWidget(ambientlight, 2, 2);
    openglConfigLayout->addWidget(backgroundcolortitle, 3, 1);
    openglConfigLayout->addWidget(backgroundcolor, 3, 2);

    setLayout(openglConfigLayout);
}
开发者ID:engleek,项目名称:Reactive-Systems-Simulator,代码行数:42,代码来源:configdialog.cpp

示例5: initw

// Canvas functions
Canvas::Canvas( int width, int height, const char * windowTitle ) {
	
	// initialize openGL and everything
	glutWin initw(	height, width, 20, 20,
					GLUT_SINGLE | GLUT_RGB,
					windowTitle );
	
	// make sure the frustum is set up properly
	setWindow( 0.0f, (float)width, 0.0f, (float)height );
	setViewPort( 0, width, 0, height );
	
	// set turtle position
	currPos = Point2( 0.0f, 0.0f );
	currDir = 0.0f;

	// set initial colors
	setBackgroundColor( 0.0f, 0.0f, 0.0f );
	setColor( 1.0f, 0.0f, 0.0f );
	
}
开发者ID:yuzhidi,项目名称:ComputerGraphicsUsingOpenGL3rdEdition,代码行数:21,代码来源:Canvas.cpp

示例6: setBackgroundColor

void LogLineBox::SetColor(QColor color)
{
  setBackgroundColor(color);
  line_cart_label->setBackgroundColor(color);
  line_cut_label->setBackgroundColor(color);
  line_group_label->setBackgroundColor(color);
  line_trans_label->setBackgroundColor(color);
  line_title_label->setBackgroundColor(color);
  line_description_label->setBackgroundColor(color);
  line_artist_label->setBackgroundColor(color);
  line_outcue_label->setBackgroundColor(color);
  line_time_label->setBackgroundColor(color);
  line_length_label->setBackgroundColor(color);
  line_talktime_label->setBackgroundColor(color);
  line_up_label->setBackgroundColor(color);
  line_position_bar->setBackgroundColor(QColor(lightGray));
  line_down_label->setBackgroundColor(color);
  line_comment_label->setBackgroundColor(color);
  line_icon_label->setBackgroundColor(color);
}
开发者ID:WMTH,项目名称:rivendell,代码行数:20,代码来源:loglinebox.cpp

示例7: QWidget

QIMPenWidget::QIMPenWidget( QWidget *parent )
 : QWidget( parent )
{
    charSets.setAutoDelete( TRUE );
    inputStroke = 0;
    outputChar = 0;
    outputStroke = 0;
    mode = Waiting;
    currCharSet = 0;
    readOnly = FALSE;
    strokes.setAutoDelete( TRUE );

    timer = new QTimer(this);
    connect( timer, SIGNAL(timeout()), SLOT(timeout()));

    setBackgroundColor( qApp->palette().color( QPalette::Active,
                                               QColorGroup::Base ) );
    strokeColor = black;
    setFixedHeight( 75 );
}
开发者ID:opieproject,项目名称:opie,代码行数:20,代码来源:qimpenwidget.cpp

示例8: setForegroundColor

int eButton::setProperty(const eString &prop, const eString &value)
{
	if (prop=="foregroundColor")
	{
		normalF=eSkin::getActive()->queryColor(value);
		setForegroundColor(normalF);
	}
	else if (prop=="backgroundColor")
	{
		normalB=eSkin::getActive()->queryColor(value);
		setBackgroundColor(normalB);
	}
	if (prop=="activeForegroundColor")
		focusF=eSkin::getActive()->queryColor(value);
	else if (prop=="activeBackgroundColor")
		focusB=eSkin::getActive()->queryColor(value);
	else
		return eLabel::setProperty(prop, value);
	return 0;
}
开发者ID:ChakaZulu,项目名称:my_tuxbox_apps,代码行数:20,代码来源:ebutton.cpp

示例9: toLower

    bool Label::setProperty(std::string property, const std::string& value)
    {
        property = toLower(property);

        if (property == "configfile")
        {
            load(value);
        }
        else if (property == "text")
        {
            std::string text;
            decodeString(value, text);
            setText(text);
        }
        else if (property == "textcolor")
        {
            setTextColor(extractColor(value));
        }
        else if (property == "textsize")
        {
            setTextSize(atoi(value.c_str()));
        }
        else if (property == "backgroundcolor")
        {
            setBackgroundColor(extractColor(value));
        }
        else if (property == "autosize")
        {
            if ((value == "true") || (value == "True"))
                setAutoSize(true);
            else if ((value == "false") || (value == "False"))
                setAutoSize(false);
            else
                TGUI_OUTPUT("TGUI error: Failed to parse 'AutoSize' property.");
        }
        else // The property didn't match
            return ClickableWidget::setProperty(property, value);

        // You pass here when one of the properties matched
        return true;
    }
开发者ID:IMACoconut,项目名称:ImaKart,代码行数:41,代码来源:Label.cpp

示例10: QWidget

Load::Load( QWidget *parent, const char *name, WFlags f )
    : QWidget( parent, name, f )
{
    setMinimumHeight( 30 );
    setBackgroundColor( black );
    points = 100;
    setMinimumWidth( points );
    userLoad = new double [points];
    systemLoad = new double [points];
    for ( int i = 0; i < points; i++ ) {
	userLoad[i] = 0.0;
	systemLoad[i] = 0.0;
    }
    maxLoad = 1.3;
    QTimer *timer = new QTimer( this );
    connect( timer, SIGNAL(timeout()), SLOT(timeout()) );
    timer->start( 2000 );
    gettimeofday( &last, 0 );
    first = TRUE;
    timeout();
}
开发者ID:opieproject,项目名称:opie,代码行数:21,代码来源:load.cpp

示例11: Widget

	Label::Label(int x, int y, int width, int height, Widget* parent) :
		Widget(x, y, width, height, parent), 
		mustCalcStrSize(true),
		caption(""),
		font(NULL),
		autoSizeX(false),
		autoSizeY(false),
		multiLine(false),
		horizontalAlignment(HA_LEFT),
		verticalAlignment(VA_TOP)
	{
		if(!font)
		{
			this->font = Engine::getSingleton().getDefaultFont();
		} else {
			this->font = font;
		}
		//calcStrSize();
		setDrawBackground();
		setBackgroundColor(0xffff00ff);
	}
开发者ID:Felard,项目名称:MoSync,代码行数:21,代码来源:Label.cpp

示例12: QWidget

DiagramCanvas::DiagramCanvas( QWidget *parent, const char *name, bool r )
    : QWidget( parent, name ), buffer( width(), height() )
{
	readOnly = r;

	initialize_colors();
	setBackgroundColor( CANVAS );
	buffer.resize( 600, 600 );
	buffer.fill( CANVAS );
	setBackgroundMode( QWidget::NoBackground );
	setMouseTracking( TRUE );
	edge_creation_in_progress = FALSE;
	vertex_drag_in_progress = FALSE;
	proximity_tolerance = 3;
	num_arcs = 0;
	num_links = 0;
	num_cuffs = 0;
	untouched = TRUE;
	drill_on = FALSE;

}
开发者ID:DamianHeard,项目名称:orb,代码行数:21,代码来源:diagram_canvas.cpp

示例13: Super

UINodeServerSelector::UINodeServerSelector (IFrontend *frontend, int rows) :
		Super(frontend, 1, rows)
{
	_headlineFont = getFont(HUGE_FONT);
	_headlineHeight = _headlineFont->getCharHeight();
	setBackgroundColor(backgroundColor);
	setSize(0.8f, 0.6f);
	setScrollingEnabled(true);
	setPageVisible(false);
	setAlignment(NODE_ALIGN_CENTER | NODE_ALIGN_MIDDLE);
	setId("server-selector");
	setFont(HUGE_FONT);
	setRowHeight(getFontHeight() / static_cast<float>(_frontend->getHeight()));
	_mouseWheelScrollAmount = _rowHeight * _frontend->getHeight() * 5;
	Vector4Set(colorWhite, _fontColor);
	reset();
	setRowSpacing(2);
	_entryOffsetY = _headlineHeight;
	_colWidth = _size.x;
	setAutoColsRows();
}
开发者ID:LibreGames,项目名称:caveexpress,代码行数:21,代码来源:UINodeServerSelector.cpp

示例14: GlassWidget

GlassViewer::GlassViewer() : gcn::Widget(), GlassWidget(this) {
	model = (residx_t)-1;
	world = false;
	SET_VEC3(camPos, 0, 0, 0);
	SET_VEC3(position, 0, 0, 0);
	SET_VEC3(target, 0, 1, 0);
	angle = 0;
	dAngle = 1;
	distance = 20;
	fov = 90;
	animState = "";
	mAutoRotate = false;
	mOpaque = true;
	mMousePressed = false;
	setBackgroundColor(gcn::Color(128,128,128));
	
	setFocusable(true);
	
	addMouseListener((GlassWidget*)this);
	addKeyListener((GlassWidget*)this);
}
开发者ID:newerthcom,项目名称:savagerebirth,代码行数:21,代码来源:GlassViewer.cpp

示例15: AMenu

WinnerMenu::WinnerMenu(AWidget *parent) :
  AMenu(parent)
{
	_newGame = new Button(this);
	_winner = new Text(this);

	_newGame->setSize(sf::Vector2f(250, 50));
	_newGame->setPosition(sf::Vector2f(125, 225));
	_newGame->setBackgroundTexture("../Assets/button_select.png");
	_newGame->setFont("../Assets/fontBambo.ttf");
	_newGame->setFontSize(30);
	_newGame->setText("Nouvelle partie");
	_newGame->setAction([this](){_gameInstance->restart();});
	_winner->setPosition(sf::Vector2f(300, 300));
	_winner->setFont("../Assets/fontBambo.ttf");
	_winner->setColor(sf::Color::Red);
	_winner->setFontSize(42);
  setPosition(sf::Vector2f(149, 249));
  setSize(sf::Vector2f(500, 300));
  setBackgroundColor(sf::Color(0, 0, 0, 127));
}
开发者ID:Mulverick,项目名称:Gomoku,代码行数:21,代码来源:WinnerMenu.cpp


注:本文中的setBackgroundColor函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。