本文整理汇总了C++中MainWindow::Activate方法的典型用法代码示例。如果您正苦于以下问题:C++ MainWindow::Activate方法的具体用法?C++ MainWindow::Activate怎么用?C++ MainWindow::Activate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MainWindow
的用法示例。
在下文中一共展示了MainWindow::Activate方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: screen
void
PadView::MouseMoved(BPoint where, uint32 transit, const BMessage* dragMessage)
{
MainWindow* window = dynamic_cast<MainWindow*>(Window());
if (window == NULL)
return;
if (fDragging) {
window->MoveTo(ConvertToScreen(where) - fDragOffset);
} else if (window->AutoRaise()) {
where = ConvertToScreen(where);
BScreen screen(window);
BRect frame = screen.Frame();
BRect windowFrame = window->Frame();
if (where.x == frame.left || where.x == frame.right
|| where.y == frame.top || where.y == frame.bottom) {
BPoint position = window->ScreenPosition();
bool raise = false;
if (fabs(0.5 - position.x) > fabs(0.5 - position.y)) {
// left or right border
if (where.y >= windowFrame.top
&& where.y <= windowFrame.bottom) {
if (position.x < 0.5 && where.x == frame.left)
raise = true;
else if (position.x > 0.5 && where.x == frame.right)
raise = true;
}
} else {
// top or bottom border
if (where.x >= windowFrame.left && where.x <= windowFrame.right) {
if (position.y < 0.5 && where.y == frame.top)
raise = true;
else if (position.y > 0.5 && where.y == frame.bottom)
raise = true;
}
}
if (raise)
window->Activate();
}
}
}