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


C++ BRect::Set方法代码示例

本文整理汇总了C++中BRect::Set方法的典型用法代码示例。如果您正苦于以下问题:C++ BRect::Set方法的具体用法?C++ BRect::Set怎么用?C++ BRect::Set使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在BRect的用法示例。


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

示例1: BApplication

	TableDemo() 
		: BApplication("application/x-vnd.haiku.table-demo")
	{
		BRect frameRect;
		frameRect.Set(100, 100, 400, 400);
		TableDemoWindow* window = new TableDemoWindow(frameRect);
		window->Show();
	}
开发者ID:mariuz,项目名称:haiku,代码行数:8,代码来源:TableDemo.cpp

示例2: Bounds

GraphWindow::GraphWindow(BRect frame):BWindow(frame, "Graph", B_TITLED_WINDOW,
								B_NOT_ZOOMABLE|B_ASYNCHRONOUS_CONTROLS|B_WILL_ACCEPT_FIRST_CLICK)
{	
	BRect the_rect;
	BMenu* tempMenu;
	
	the_rect = Bounds();
	
	menuBar = new BMenuBar(the_rect, "GraphMenuBar");
	AddChild(menuBar);
	
	tempMenu = new BMenu("File");
	tempMenu->AddItem(new BMenuItem("About", new BMessage(MENU_FILE_ABOUT) ));
	tempMenu->AddSeparatorItem();
	tempMenu->AddItem(new BMenuItem("Save", new BMessage(MENU_FILE_SAVE), 'S'));
	tempMenu->AddSeparatorItem();
	tempMenu->AddItem(new BMenuItem("Quit", new BMessage(MENU_FILE_QUIT) , 'Q') );
	
	
	menuBar->AddItem(tempMenu);
	
	tempMenu = new BMenu("Edit");
	tempMenu->AddItem(new BMenuItem("Copy", new BMessage(MENU_EDIT_COPY), 'C' ) );
	
	menuBar->AddItem(tempMenu);
	
	tempMenu = new BMenu("Window");
	settingsWindowItem = new BMenuItem("Window Settings", new BMessage(MENU_WINDOW_SETTINGS), '1');
	settingsWindowItem->SetMarked(true);
	tempMenu->AddItem(settingsWindowItem);
	
	functionWindowItem = new BMenuItem("Function List", new BMessage(MENU_WINDOW_FUNCTION), '2');
	functionWindowItem->SetMarked(true);
	tempMenu->AddItem(functionWindowItem);
	
	menuBar->AddItem(tempMenu);
	
	menuBar->ResizeToPreferred();
	
	the_rect.top = menuBar->Frame().bottom +1;
	AddChild(the_graph = new GraphView( the_rect ));
	savePanel = new BFilePanel(B_SAVE_PANEL, new BMessenger(this) ,NULL,B_FILE_NODE,false);

	BRect windowRect;
	windowRect.Set(frame.right,frame.top, frame.right+250, frame.top+110);
	windowRect.OffsetBy(10,0);
	settingsWindow = new SettingsWindow(windowRect);
	windowRect.OffsetBy(0,settingsWindow->Frame().Height()+20);
	windowRect.right=windowRect.left+250;
	windowRect.bottom=windowRect.top+300; 
	functionWindow = new FunctionListWindow(windowRect);
	settingsWindow->AddToSubset(this);
	functionWindow->AddToSubset(this);


	
	
}
开发者ID:HaikuArchives,项目名称:Graph,代码行数:58,代码来源:GraphWindow.cpp

示例3: FriendWindow

	Friend() 
		:
		BApplication("application/x-vnd.haiku.Friend") 
	{
		BRect frameRect;
		frameRect.Set(100, 100, 300, 300);
		FriendWindow* window = new FriendWindow(frameRect);
		window->Show();
	}
开发者ID:SummerSnail2014,项目名称:haiku,代码行数:9,代码来源:FriendLayout.cpp

示例4: PinwheelWindow

	Pinwheel() 
		:
		BApplication("application/x-vnd.haiku.Pinwheel") 
	{
		BRect frameRect;
		frameRect.Set(100, 100, 300, 300);
		PinwheelWindow* window = new PinwheelWindow(frameRect);
		window->Show();
	}
开发者ID:SummerSnail2014,项目名称:haiku,代码行数:9,代码来源:Pinwheel.cpp

示例5: ViewsWindow

	Views() 
		:
		BApplication("application/x-vnd.haiku.Views") 
	{
		BRect frameRect;
		frameRect.Set(100, 100, 300, 300);
		ViewsWindow* window = new ViewsWindow(frameRect);
		window->Show();
	}
开发者ID:SummerSnail2014,项目名称:haiku,代码行数:9,代码来源:Views.cpp

示例6: BScreen

/////////////////////////////////////////////////////////////////
//init window frame.
/////////////////////////////////////////////////////////////////
BRect
kanBeApp::InitFrame(float w, float h)
{
BRect			frameRect;

	frameRect.Set(0, 0, K_CONVBUFSIZE * w + 2 * 2, h * 2 + 2 * 3);
	frameRect.OffsetTo(10, BScreen().Frame().bottom - h * 2 - 2 * 3 - 30);

	return frameRect;
}
开发者ID:mt819,项目名称:CannaIM,代码行数:13,代码来源:kanBeApp.cpp

示例7: HWindow

HApp::HApp()
	:
	BApplication("application/x-vnd.Haiku-Sounds")
{
	BRect rect;
	rect.Set(200, 150, 590, 570);

	HWindow* window = new HWindow(rect, B_TRANSLATE_SYSTEM_NAME("Sounds"));
	window->Show();
}
开发者ID:SummerSnail2014,项目名称:haiku,代码行数:10,代码来源:HApp.cpp

示例8:

/*
 * setup this arranger view, call parents and stuff back up the chain and create a time scale object
 */
int
MFCArrangeView::OnCreate(LPCREATESTRUCT lpCreateStruct )
{
	int		ret = MFCSequenceEditor::OnCreate(lpCreateStruct);

	BRect		r;
	r.Set(0, bounds.bottom-60, 600, bounds.bottom-50);
	tScale.CreateTScale(r, this, 1111, this);
	return ret;
}
开发者ID:dakyri,项目名称:qua,代码行数:13,代码来源:MFCArrangeView.cpp

示例9: BApplication

SampleGLApp::SampleGLApp()
    : BApplication("application/x-vnd.Haiku-GLDirectMode")
{
    BRect windowRect;
    uint32 type = BGL_RGB|BGL_DOUBLE|BGL_DEPTH;

    windowRect.Set(50, 50, 350, 350);

    theWindow = new SampleGLWindow(windowRect, type);
}
开发者ID:yunxiaoxiao110,项目名称:haiku,代码行数:10,代码来源:GLDirectMode.cpp

示例10: settings

BRect
RepositoriesSettings::GetFrame()
{
	BMessage settings(_ReadFromFile());
	BRect frame;
	status_t status = settings.FindRect(key_frame, &frame);
	// Set default off screen so it will center itself
	if (status != B_OK)
		frame.Set(-10, -10, 750, 300);
	return frame;
}
开发者ID:looncraz,项目名称:haiku,代码行数:11,代码来源:RepositoriesSettings.cpp

示例11: HWindow

/***********************************************************
 * Constructor.
 ***********************************************************/
HApp::HApp():BApplication("application/x-vnd.takamatsu-hltrackerreader")
{
	BRect rect;
	RectUtils utils;
	if(utils.LoadRectFromApp("servwinrect",&rect) == false)
	{
		rect.Set(40,40,500,300);
	}
	fWindow = new HWindow(rect,_("Tracker"));
	fWindow->Show();
}
开发者ID:HaikuArchives,项目名称:SilverWing,代码行数:14,代码来源:HApp.cpp

示例12: AttachedToWindow

void HexKeyView::AttachedToWindow() 
{
    
    BBox *aBox;
    BRect aBoxRect;
	aBoxRect.Set(10, 10, 370, 270);
    
    aBox = new BBox(aBoxRect, "Box1", B_FOLLOW_NONE);
    aBox->SetLabel(LABEL_BOX_TITLE);
    AddChild(aBox);
    
    BRect drawRect;
	drawRect.Set(10, 10, 340, 240);
	
	DrawView *drawView;
	drawView = new DrawView(drawRect, "DrawView");
	drawView->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
	drawView->SetLowColor(ui_color(B_PANEL_BACKGROUND_COLOR));
	aBox->AddChild(drawView);
	
}
开发者ID:HaikuArchives,项目名称:HexKeycode,代码行数:21,代码来源:GuiHexKeyView.cpp

示例13: MouseDown

void MonthWindowView::MouseDown(BPoint p)
{
 // It's necessary to define whether mouse cursor is on one of dates
 BRect r;
 
 int k=cwday1;
 float x=w_cell*k+1;
 float y=yearStringView->Frame().bottom+h_cell+h_cell;
 
 int qu_days=monthDays[cmonth-1]; // quantity of days in month
 
 if(cmonth==2) if(cyear%4==0) if((cyear%100!=0) || (cyear%400==0)) qu_days=29;
 
 bool flag=false; // whether mouse is pressed just on date
 int t=0;
 while(t<qu_days)
 {
  t++;
  r.Set(x,y-h_cell+5,x+w_cell-1,y+4);
  
  if(r.Contains(p))
  {
   flag=true;
   dayPressed=t;
   cursorPressed.Set(r.left,r.top,r.right,r.bottom);
   MousePressed=true;
   break; // exit while
  }
  
  x+=w_cell;
  k++;
  
  if(k==7)
  {
   k=0;
   y+=h_cell;
   x=1;
  }
 }
}
开发者ID:peja,项目名称:shanty,代码行数:40,代码来源:MonthWindowView.cpp

示例14: initialize

Error OS_Haiku::initialize(const VideoMode &p_desired, int p_video_driver, int p_audio_driver) {
	main_loop = NULL;
	current_video_mode = p_desired;

	app = new HaikuApplication();

	BRect frame;
	frame.Set(50, 50, 50 + current_video_mode.width - 1, 50 + current_video_mode.height - 1);

	window = new HaikuDirectWindow(frame);
	window->SetVideoMode(&current_video_mode);

	if (current_video_mode.fullscreen) {
		window->SetFullScreen(true);
	}

	if (!current_video_mode.resizable) {
		uint32 flags = window->Flags();
		flags |= B_NOT_RESIZABLE;
		window->SetFlags(flags);
	}

#if defined(OPENGL_ENABLED)
	context_gl = memnew(ContextGL_Haiku(window));
	context_gl->initialize();
	context_gl->make_current();
	context_gl->set_use_vsync(current_video_mode.use_vsync);
	RasterizerGLES3::register_config();
	RasterizerGLES3::make_current();

#endif

	visual_server = memnew(VisualServerRaster);
	// FIXME: Reimplement threaded rendering
	if (get_render_thread_mode() != RENDER_THREAD_UNSAFE) {
		visual_server = memnew(VisualServerWrapMT(visual_server, false));
	}

	ERR_FAIL_COND_V(!visual_server, ERR_UNAVAILABLE);

	video_driver_index = p_video_driver;

	input = memnew(InputDefault);
	window->SetInput(input);

	window->Show();
	visual_server->init();

	AudioDriverManager::initialize(p_audio_driver);

	return OK;
}
开发者ID:Paulloz,项目名称:godot,代码行数:52,代码来源:os_haiku.cpp

示例15: app

int
main()
{
	BApplication app("application/x-vnd.haiku.ThreeButtons");

	BRect frameRect;
	frameRect.Set(100, 100, 600, 300);
	ThreeButtonsWindow* window = new ThreeButtonsWindow(frameRect);
	window->Show();

	app.Run();
	return 0;
}
开发者ID:veer77,项目名称:Haiku-services-branch,代码行数:13,代码来源:ThreeButtons.cpp


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