本文整理汇总了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();
}
示例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);
}
示例3: FriendWindow
Friend()
:
BApplication("application/x-vnd.haiku.Friend")
{
BRect frameRect;
frameRect.Set(100, 100, 300, 300);
FriendWindow* window = new FriendWindow(frameRect);
window->Show();
}
示例4: PinwheelWindow
Pinwheel()
:
BApplication("application/x-vnd.haiku.Pinwheel")
{
BRect frameRect;
frameRect.Set(100, 100, 300, 300);
PinwheelWindow* window = new PinwheelWindow(frameRect);
window->Show();
}
示例5: ViewsWindow
Views()
:
BApplication("application/x-vnd.haiku.Views")
{
BRect frameRect;
frameRect.Set(100, 100, 300, 300);
ViewsWindow* window = new ViewsWindow(frameRect);
window->Show();
}
示例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;
}
示例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();
}
示例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;
}
示例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);
}
示例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;
}
示例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();
}
示例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);
}
示例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;
}
}
}
示例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(¤t_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;
}
示例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;
}