• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ setBackgroundColor函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: GlassWidget

GlassWindow::GlassWindow() : gcn::Window(), GlassWidget(this), wmhandler() {
	titleBar = gcn::Image::load("/gui/standard/bar_gradient.png");
	mTitleBarHeight = titleBar->getHeight()+3;
	titleBarContainer._setParent(this);
	setAlignment(gcn::Graphics::LEFT);
	shadeState = SH_OPEN;
	titleVisible = true;
	mGradient = false;
	frame = NULL;
	mBorder = 0;
	
	setBackgroundColor(gcn::Color(213,213,213));
	
	wmhandler.setWindow(this);
	
	buildTitleBar(WT_ALL);
	
	//for GlassWidget
	addActionListener(this);
	addFocusListener(this);
	gui->addGlobalKeyListener(this);
}
开发者ID:newerthcom,项目名称:savagerebirth,代码行数:22,代码来源:GlassWindow.cpp


示例17: ACLevelMeter

LedMeter::LedMeter(QWidget *parent, bool blueState) : ACLevelMeter(parent) {
	setBackgroundColor(black);
	QBoxLayout * l = new QVBoxLayout( this );
	l->setAutoAdd(TRUE);
	for(int i=0;i<12;i++) {
		QColor c;
		if(blueState)
			c = blue;
		else {
			c = red;
			if(i>=2) c = yellow;
			if(i>=5) c = green;
		}

		// put each led in its own frame, since it seems to be broken
		QFrame *lframe = new QFrame(this);
		QBoxLayout *lfl = new QVBoxLayout( lframe );
		lfl->setAutoAdd(TRUE);
		leds[i] =
			new KLed(c,KLed::Off, KLed::Sunken, KLed::Circular,lframe);
	}
}
开发者ID:serghei,项目名称:kde3-kdemultimedia,代码行数:22,代码来源:levelmeters.cpp


示例18: current_context_index

BEGIN_NAMESPACE_MW



/**********************************************************************
 *                  StimulusDisplay Methods
 **********************************************************************/
StimulusDisplay::StimulusDisplay(bool drawEveryFrame, bool announceIndividualStimuli) :
    current_context_index(-1),
    mainDisplayRefreshRate(0.0),
    currentOutputTimeUS(-1),
    announceIndividualStimuli(announceIndividualStimuli),
    announceStimuliOnImplicitUpdates(true),
    drawEveryFrame(drawEveryFrame)
{
    // defer creation of the display chain until after the stimulus display has been created
    display_stack = shared_ptr< LinkedList<StimulusNode> >(new LinkedList<StimulusNode>());
    
	setDisplayBounds();
    setBackgroundColor(0.5, 0.5, 0.5);

    opengl_context_manager = OpenGLContextManager::instance();
    clock = Clock::instance();

    waitingForRefresh = false;
    needDraw = false;
    
    if (kCVReturnSuccess != CVDisplayLinkCreateWithActiveCGDisplays(&displayLink) ||
        kCVReturnSuccess != CVDisplayLinkSetOutputCallback(displayLink,
                                                           &StimulusDisplay::displayLinkCallback,
                                                           this))
    {
        throw SimpleException("Unable to create display link");
    }
        
    stateSystemNotification = shared_ptr<VariableCallbackNotification>(new VariableCallbackNotification(boost::bind(&StimulusDisplay::stateSystemCallback, this, _1, _2)));
    state_system_mode->addNotification(stateSystemNotification);
}
开发者ID:BramVerhoef,项目名称:mworks,代码行数:38,代码来源:StimulusDisplay.cpp


示例19: glewInit

// Customize a few OPenGL states to fit the application's needs
void Application::customizeStates() {
    // Puts the window top-left corner at the following coordinates
    // Resizing doesn't impact so it is not very usefull
    //putenv("SDL_VIDEO_WINDOW_POS=100,0");

    // Glew initialisation : to register all available extentions
    GLenum glewError = glewInit();
    if (glewError != GLEW_OK)
        cerr << "GLEW Error : " << glewGetErrorString(glewError) << endl;

    // Mouse motion will not generate events
    // Instead we will check the position ourselves when we need them
    SDL_EventState(SDL_MOUSEMOTION, SDL_IGNORE);

    // Initialization of the m_bShowMouse position in the middle of the window

    // WarpMouse changes the mouse position and
    // generates motion events which we need to ignore.
    SDL_EventState(SDL_MOUSEMOTION, SDL_IGNORE);
    SDL_WarpMouse(m_width / 2, m_height / 2);
    // After, we can reactivate the m_bShowMouse motion events
    // But we instead choose to check directly the position
    // ourselves when we need it (in the camera update)
    // It is better then to disable the unused events
    SDL_EventState(SDL_MOUSEMOTION, SDL_ENABLE);

    // Depth test
    glEnable(GL_DEPTH_TEST);
    
    // Decides the background color used after this call
    setBackgroundColor(Color::BLACK);
    
    // Sets the with of the lines
    glLineWidth(2);
    
    // Disables culling
    //glDisable(GL_CULL_FACE);
}
开发者ID:garden-troublemakers,项目名称:alidade,代码行数:39,代码来源:Application.cpp


示例20: QFrame

MenuColumn::MenuColumn( QWidget* parent,
                        const QString& name,
                        const QColor& bg,
                        const QColor& hl )
    : QFrame( parent, name ? name : "GenericMenuColumn" ), m_name( name )
{
    setFrameStyle( QFrame::Plain | QFrame::MenuBarPanel );
    m_mainLay = new QVBoxLayout( this );
    m_compLay = new QVBoxLayout();
    m_mainLay->addLayout( m_compLay );

    if( !m_name.isNull() )
        loadItems();

    // override color
    if( bg.isValid() )
        setBackgroundColor( bg );
    if( hl.isValid() )
        setHighlightColor( hl );


    setPaletteBackgroundColor( backgroundColor() );
}
开发者ID:engina,项目名称:xkmenu,代码行数:23,代码来源:menucolumn.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ setBackgroundRole函数代码示例发布时间:2022-05-30
下一篇:
C++ setBackgroundBrush函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap