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


C++ ViewColor函数代码示例

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


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

示例1: AttachedToWindow

void FolderPanel :: AttachedToWindow( void )
{
	BRect r ;
	if( Parent() )
		r = Parent()->Frame() ;
	else
		r = Window()->Frame() ;
	
	font_height fh ;
	GetFontHeight( &fh ) ;
	
	r.top = 0 ;
	r.right = r.Width() ;
	r.left = 0 ;  
	r.bottom = 3 * (fh.ascent + fh.descent + fh.leading ) ;
	
	MoveTo( 0,0 ) ;
	ResizeTo( r.right, r.bottom ) ;
		
	r.left    = 25 ;
	r.right   = r.right - r.left ;
	r.top     = r.Height()/5 ;
	r.bottom  = r.bottom - r.top ;
	
	fpFolderPU->MoveTo( r.left , r.top ) ;
	fpFolderPU->ResizeTo( r.Width() , r.Height() ) ;

	fpFolderPU->SetViewColor( ViewColor() ) ;
	fpFolderPU->SetLowColor( ViewColor() ) ;

	AddChild( fpFolderPU ) ;
}
开发者ID:HaikuArchives,项目名称:TraX,代码行数:32,代码来源:FolderPanel.cpp

示例2: Window

void
BComboBox::AttachedToWindow()
{
	Window()->AddFilter(fWinMovedFilter);
	if (Parent()) {
		SetViewColor(Parent()->ViewColor());
		SetLowColor(ViewColor());
	}

	bool enabled = IsEnabled();
	rgb_color mc = HighColor();
	rgb_color base;
	BFont textFont;

	// mc used to be base in this line
	if (mc.red == 255 && mc.green == 255 && mc.blue == 255)
		base = ViewColor();
	else
		base = LowColor();

	fText->GetFontAndColor(0, &textFont);
	mc = enabled ? mc : disable_color(base);

	fText->SetFontAndColor(&textFont, B_FONT_ALL, &mc);

	if (!enabled)
		base = tint_color(base, B_DISABLED_MARK_TINT);
	else
		base.red = base.green = base.blue = 255;

	fText->SetLowColor(base);
	fText->SetViewColor(base);

	fText->MakeEditable(enabled);
}
开发者ID:anevilyak,项目名称:haiku,代码行数:35,代码来源:ComboBox.cpp

示例3: ViewColor

void
LanguageListView::Draw(BRect updateRect)
{
	BOutlineListView::Draw(updateRect);

	if (fDropIndex >= 0 && fDropTargetHighlightFrame.IsValid()) {
		// TODO: decide if drawing of a drop target indicator should be moved
		//       into ControlLook
		BGradientLinear gradient;
		int step = fGlobalDropTargetIndicator ? 64 : 128;
		for (int i = 0; i < 256; i += step)
			gradient.AddColor(i % (step * 2) == 0
				? ViewColor() : ui_color(B_CONTROL_HIGHLIGHT_COLOR), i);
		gradient.AddColor(ViewColor(), 255);
		gradient.SetStart(fDropTargetHighlightFrame.LeftTop());
		gradient.SetEnd(fDropTargetHighlightFrame.RightBottom());
		if (fGlobalDropTargetIndicator) {
			BRegion region(fDropTargetHighlightFrame);
			region.Exclude(fDropTargetHighlightFrame.InsetByCopy(2.0, 2.0));
			ConstrainClippingRegion(&region);
			FillRect(fDropTargetHighlightFrame, gradient);
			ConstrainClippingRegion(NULL);
		} else
			FillRect(fDropTargetHighlightFrame, gradient);
	}
}
开发者ID:veer77,项目名称:Haiku-services-branch,代码行数:26,代码来源:LanguageListView.cpp

示例4: SetLowColor

void ArpDocumentButton::AttachedToWindow()
{
	inherited::AttachedToWindow();
	#if 0
	if( ViewColor() != B_TRANSPARENT_COLOR ) SetLowColor(ViewColor());
	else SetLowColor(ui_color(B_MENU_BACKGROUND_COLOR));
	#endif
	SetLowColor(ui_color(B_MENU_BACKGROUND_COLOR));
	SetViewColor(B_TRANSPARENT_COLOR);
}
开发者ID:tgkokk,项目名称:Sequitur,代码行数:10,代码来源:ArpDocumentButton.cpp

示例5: redraw

void
WorkspacesView::Draw(DrawingEngine* drawingEngine, BRegion* effectiveClipping,
	BRegion* windowContentClipping, bool deep)
{
	// we can only draw within our own area
	BRegion redraw(ScreenAndUserClipping(windowContentClipping));
	// add the current clipping
	redraw.IntersectWith(effectiveClipping);

	int32 columns, rows;
	_GetGrid(columns, rows);

	// draw grid

	// make sure the grid around the active workspace is not drawn
	// to reduce flicker
	BRect activeRect = _WorkspaceAt(Window()->Desktop()->CurrentWorkspace());
	BRegion gridRegion(redraw);
	gridRegion.Exclude(activeRect);
	drawingEngine->ConstrainClippingRegion(&gridRegion);

	BRect frame = Bounds();
	ConvertToScreen(&frame);

	// horizontal lines

	drawingEngine->StrokeLine(BPoint(frame.left, frame.top),
		BPoint(frame.right, frame.top), ViewColor());

	for (int32 row = 0; row < rows; row++) {
		BRect rect = _WorkspaceAt(row * columns);
		drawingEngine->StrokeLine(BPoint(frame.left, rect.bottom),
			BPoint(frame.right, rect.bottom), ViewColor());
	}

	// vertical lines

	drawingEngine->StrokeLine(BPoint(frame.left, frame.top),
		BPoint(frame.left, frame.bottom), ViewColor());

	for (int32 column = 0; column < columns; column++) {
		BRect rect = _WorkspaceAt(column);
		drawingEngine->StrokeLine(BPoint(rect.right, frame.top),
			BPoint(rect.right, frame.bottom), ViewColor());
	}

	drawingEngine->ConstrainClippingRegion(&redraw);

	// draw workspaces

	for (int32 i = rows * columns; i-- > 0;) {
		_DrawWorkspace(drawingEngine, redraw, i);
	}
	fWindow->ServerWindow()->ResyncDrawState();
}
开发者ID:mmanley,项目名称:Antares,代码行数:55,代码来源:WorkspacesView.cpp

示例6: Window

void
SLoadingModulesViewLight::ReGetBitmap()
{
	BWindow *window = Window();
	if(!window) return;

	bool is_hidden = window->IsHidden();

	if(!is_hidden) window->Hide();

	if(red_bitmap) delete red_bitmap;
	red_bitmap = new BBitmap(Bounds(), B_BITMAP_ACCEPTS_VIEWS, B_RGB32);
	if(red_bitmap)
	{
		SAutolock<BBitmap> autolock(red_bitmap);
		BView *bitmap_view = new BView(red_bitmap->Bounds(), NULL, B_FOLLOW_NONE, B_WILL_DRAW);
		red_bitmap->AddChild(bitmap_view);
		bitmap_view->PushState();
		bitmap_view->SetDrawingMode(B_OP_ALPHA);
		bitmap_view->SetHighColor(ViewColor());
		bitmap_view->FillRect(Bounds());
		bitmap_view->SetHighColor(203, 0, 51, 255);
		bitmap_view->FillArc(Bounds(), 0, 360);
		bitmap_view->SetHighColor(20, 20, 20, 150);
		bitmap_view->StrokeArc(Bounds(), 45, 180);
		bitmap_view->SetHighColor(220, 220, 220, 150);
		bitmap_view->StrokeArc(Bounds(), 225, 180);
		bitmap_view->PopState();
		bitmap_view->Sync();
	}

	if(green_bitmap) delete green_bitmap;
	green_bitmap = new BBitmap(Bounds(), B_BITMAP_ACCEPTS_VIEWS, B_RGB32);
	if(green_bitmap)
	{
		SAutolock<BBitmap> autolock(green_bitmap);
		BView *bitmap_view = new BView(green_bitmap->Bounds(), NULL, B_FOLLOW_NONE, B_WILL_DRAW);
		green_bitmap->AddChild(bitmap_view);
		bitmap_view->PushState();
		bitmap_view->SetDrawingMode(B_OP_ALPHA);
		bitmap_view->SetHighColor(ViewColor());
		bitmap_view->FillRect(Bounds());
		bitmap_view->SetHighColor(0, 169, 12, 255);
		bitmap_view->FillArc(Bounds(), 0, 360);
		bitmap_view->SetHighColor(20, 20, 20, 150);
		bitmap_view->StrokeArc(Bounds(), 45, 180);
		bitmap_view->SetHighColor(220, 220, 220, 150);
		bitmap_view->StrokeArc(Bounds(), 225, 180);
		bitmap_view->PopState();
		bitmap_view->Sync();
	}

	if(!is_hidden) window->Show();
}
开发者ID:Haiku-cn,项目名称:BeCJK,代码行数:54,代码来源:LoadingModules.cpp

示例7: rect

void
ControlView::Draw(BRect updateRect)
{
    BRect rect(Bounds());
    SetHighColor(tint_color(ViewColor(), B_LIGHTEN_2_TINT));
    StrokeLine(rect.LeftTop(), rect.RightTop());
    StrokeLine(rect.LeftTop(), rect.LeftBottom());

    SetHighColor(tint_color(ViewColor(), B_DARKEN_2_TINT));
    StrokeLine(rect.LeftBottom(), rect.RightBottom());
    StrokeLine(rect.RightBottom(), rect.RightTop());
}
开发者ID:nielx,项目名称:haiku-serviceskit,代码行数:12,代码来源:ControlView.cpp

示例8: BView

TGAView::TGAView(const char *name, uint32 flags, TranslatorSettings *settings)
	:
	BView(name, flags),
	fSettings(settings)
{
	SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
	SetLowColor(ViewColor());

 	fTitle = new BStringView("title", B_TRANSLATE("TGA Image Translator"));
 	fTitle->SetFont(be_bold_font);

 	char detail[100];
 	sprintf(detail, B_TRANSLATE("Version %d.%d.%d %s"),
 		static_cast<int>(B_TRANSLATION_MAJOR_VERSION(TGA_TRANSLATOR_VERSION)),
 		static_cast<int>(B_TRANSLATION_MINOR_VERSION(TGA_TRANSLATOR_VERSION)),
 		static_cast<int>(B_TRANSLATION_REVISION_VERSION(
 			TGA_TRANSLATOR_VERSION)), __DATE__);
 	fDetail = new BStringView("detail", detail);
 	fWrittenBy = new BStringView("writtenby",
 		B_TRANSLATE("Written by the Haiku Translation Kit Team"));

 	fpchkIgnoreAlpha = new BCheckBox(B_TRANSLATE("Ignore TGA alpha channel"),
		new BMessage(CHANGE_IGNORE_ALPHA));
 	int32 val = (fSettings->SetGetBool(TGA_SETTING_IGNORE_ALPHA)) ? 1 : 0;
 	fpchkIgnoreAlpha->SetValue(val);
 	fpchkIgnoreAlpha->SetViewColor(ViewColor());

 	fpchkRLE = new BCheckBox(B_TRANSLATE("Save with RLE Compression"),
		new BMessage(CHANGE_RLE));
 	val = (fSettings->SetGetBool(TGA_SETTING_RLE)) ? 1 : 0;
 	fpchkRLE->SetValue(val);
 	fpchkRLE->SetViewColor(ViewColor());

 	// Build the layout
 	SetLayout(new BGroupLayout(B_HORIZONTAL));

 	AddChild(BGroupLayoutBuilder(B_VERTICAL, 7)
 		.Add(fTitle)
 		.Add(fDetail)
 		.AddGlue()
 		.Add(fpchkIgnoreAlpha)
 		.Add(fpchkRLE)
 		.AddGlue()
 		.Add(fWrittenBy)
 		.AddGlue()
 		.SetInsets(5, 5, 5, 5)
 	);

 	BFont font;
 	GetFont(&font);
 	SetExplicitPreferredSize(BSize((font.Size() * 333)/12,
 		(font.Size() * 200)/12));
}
开发者ID:veer77,项目名称:Haiku-services-branch,代码行数:53,代码来源:TGAView.cpp

示例9: top

void DCCConnect::Draw(BRect)
{
	BView* top(Window()->ChildAt(0));

	if (this != top) {
		BeginLineArray(2);
		AddLine(Bounds().LeftTop(), Bounds().RightTop(), tint_color(ViewColor(), B_DARKEN_2_TINT));

		AddLine(Bounds().LeftTop() + BPoint(0.0, 1.0), Bounds().RightTop() + BPoint(0.0, 1.0),
				tint_color(ViewColor(), B_LIGHTEN_MAX_TINT));
		EndLineArray();
	}
}
开发者ID:carriercomm,项目名称:Vision,代码行数:13,代码来源:DCCConnect.cpp

示例10: SetDrawingMode

void InfoBox::DrawWarningBitmap() {
	if ((float)cd_size>(float)((levelSB->MaxValue())*(2048.0F))) {
		SetDrawingMode(B_OP_COPY);
		SetHighColor(ViewColor());
		FillRect(BRect(205, 52, 205+kDataWidth, 52+kDataHeight));
		SetDrawingMode(B_OP_ALPHA);
		DrawBitmap(warningBM, BPoint(205, 52));
	} else {
		SetDrawingMode(B_OP_COPY);
		SetHighColor(ViewColor());
		FillRect(BRect(205, 52, 205+kDataWidth, 52+kDataHeight));
		SetHighColor(0,0,0);
	}
}
开发者ID:carriercomm,项目名称:Helios,代码行数:14,代码来源:InfoBox.cpp

示例11: PushState

void
TTimeView::Draw(BRect /*updateRect*/)
{
	PushState();

	SetHighColor(ViewColor());
	SetLowColor(ViewColor());
	FillRect(Bounds());
	SetHighColor(0, 0, 0, 255);

	DrawString(fCurrentTimeStr, fTimeLocation);

	PopState();
}
开发者ID:mmadia,项目名称:Haiku-services-branch,代码行数:14,代码来源:TimeView.cpp

示例12: PushState

void
TTimeView::Draw(BRect /*updateRect*/)
{
	PushState();

	SetHighColor(ViewColor());
	SetLowColor(ViewColor());
	FillRect(Bounds());
	SetHighColor(ui_color(B_MENU_ITEM_TEXT_COLOR));

	DrawString(fCurrentTimeStr, fTimeLocation);

	PopState();
}
开发者ID:ysei,项目名称:haiku,代码行数:14,代码来源:TimeView.cpp

示例13: GetFontHeight

//------------------------------------------------------------------------------
void BMenuField::DrawLabel(BRect bounds, BRect update)
{
	font_height fh;
	GetFontHeight(&fh);

	if (Label())
	{
		SetLowColor(ViewColor());

		float y = (float)ceil(fh.ascent + fh.descent + fh.leading) + 2.0f;
		float x;

		switch (fAlign)
		{
			case B_ALIGN_RIGHT:
				x = fDivider - StringWidth(Label()) - 3.0f;
				break;

			case B_ALIGN_CENTER:
				x = fDivider - StringWidth(Label()) / 2.0f;
				break;

			default:
				x = 3.0f;
				break;
		}
		
		SetHighColor(tint_color(ui_color(B_PANEL_BACKGROUND_COLOR),
					 IsEnabled() ? B_DARKEN_MAX_TINT : B_DISABLED_LABEL_TINT));
		DrawString(Label(), BPoint(x, y));
	}
}
开发者ID:Ithamar,项目名称:cosmoe,代码行数:33,代码来源:MenuField.cpp

示例14: BeginLineArray

void ArpConfigureView::Draw(BRect )
{
	BeginLineArray(6);
	const rgb_color bgcolor = ViewColor();
	
	if( mMakeDefaultButton ) {
		BRect revFrame(mMakeDefaultButton->Frame());
		const float left = revFrame.right + floor((mSpaceWidth*3)/2);
		AddLine( BPoint(left, revFrame.top),
				 BPoint(left, revFrame.bottom),
				 tint_color(bgcolor, B_DARKEN_4_TINT) );
		AddLine( BPoint(left+1, revFrame.top),
				 BPoint(left+1, revFrame.bottom),
				 tint_color(bgcolor, .2) );
	}
	
	BRect bnd(Bounds());
	BRect panFrame(mPanel->Frame());
	AddLine( BPoint(bnd.left, bnd.bottom),
			 BPoint(bnd.left, panFrame.bottom+1),
			 tint_color(bgcolor, .2) );
	AddLine( BPoint(bnd.left, panFrame.bottom+1),
			 BPoint(bnd.right, panFrame.bottom+1),
			 tint_color(bgcolor, .2) );
	AddLine( BPoint(bnd.right, panFrame.bottom+1),
			 BPoint(bnd.right, bnd.bottom),
			 tint_color(bgcolor, B_DARKEN_4_TINT) );
	AddLine( BPoint(bnd.right, bnd.bottom),
			 BPoint(bnd.left, bnd.bottom),
			 tint_color(bgcolor, B_DARKEN_4_TINT) );
	
	EndLineArray();
}
开发者ID:HaikuArchives,项目名称:Sequitur,代码行数:33,代码来源:ArpConfigurePanel.cpp

示例15: moveSelectedFieldsBy

void MainView::MouseMoved(BPoint point, uint32 transit, const BMessage *msg)
{
	if(!track_mouse) return;

	if(mouse_view) mouse_view->UpdateMouse(point);
	h_ruler->UpdateSlider(point);
	v_ruler->UpdateSlider(point);
	if(drag_move) {
		moveSelectedFieldsBy(BPoint(point.x - drag_start.x, point.y - drag_start.y));
		drag_start = point;
	}
//Temporary sel rect implementation
#ifdef HAIKU
	else if(drag_select) {
		SetHighColor(ViewColor());
		StrokeRect(sel_rect);
		SetHighColor(0,0,200);
		sel_rect.SetRightBottom(point);
		StrokeRect(sel_rect);	
	}
#endif
	else if(draw_crosshairs) {
		drawCrosshairs(point);
	}
}
开发者ID:brennanos,项目名称:XFile-Haiku,代码行数:25,代码来源:MainView.cpp


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