本文整理汇总了C++中View::IsVisible方法的典型用法代码示例。如果您正苦于以下问题:C++ View::IsVisible方法的具体用法?C++ View::IsVisible怎么用?C++ View::IsVisible使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类View
的用法示例。
在下文中一共展示了View::IsVisible方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Layout
void SingleSplitView::Layout()
{
if(GetChildViewCount() != 2)
{
return;
}
View* leading = GetChildViewAt(0);
View* trailing = GetChildViewAt(1);
if(!leading->IsVisible() && !trailing->IsVisible())
{
return;
}
if(width()==0 || height()==0)
{
// We are most likely minimized - do not touch divider offset.
return;
}
else if(!trailing->IsVisible())
{
leading->SetBounds(0, 0, width(), height());
}
else if(!leading->IsVisible())
{
trailing->SetBounds(0, 0, width(), height());
}
else
{
if(divider_offset_ < 0)
{
divider_offset_ = (GetPrimaryAxisSize() - kDividerSize) / 2;
}
else
{
divider_offset_ = std::min(divider_offset_,
GetPrimaryAxisSize()-kDividerSize);
}
if(is_horizontal_)
{
leading->SetBounds(0, 0, divider_offset_, height());
trailing->SetBounds(divider_offset_+kDividerSize, 0,
width()-divider_offset_-kDividerSize, height());
}
else
{
leading->SetBounds(0, 0, width(), divider_offset_);
trailing->SetBounds(0, divider_offset_+kDividerSize,
width(), height()-divider_offset_-kDividerSize);
}
}
SchedulePaint();
// Invoke super's implementation so that the children are layed out.
View::Layout();
}
示例2: GetPreferredSize
gfx::Size BoxLayout::GetPreferredSize(View* host)
{
gfx::Rect bounds;
int position = 0;
for(int i=0; i<host->GetChildViewCount(); ++i)
{
View* child = host->GetChildViewAt(i);
if(child->IsVisible())
{
gfx::Size size(child->GetPreferredSize());
if(orientation_ == kHorizontal)
{
gfx::Rect child_bounds(position, 0, size.width(), size.height());
bounds = bounds.Union(child_bounds);
position += size.width();
}
else
{
gfx::Rect child_bounds(0, position, size.width(), size.height());
bounds = bounds.Union(child_bounds);
position += size.height();
}
position += between_child_spacing_;
}
}
gfx::Insets insets(host->GetInsets());
return gfx::Size(
bounds.width()+insets.width()+2*inside_border_horizontal_spacing_,
bounds.height()+insets.height()+2*inside_border_vertical_spacing_);
}
示例3: Layout
void BoxLayout::Layout(View* host)
{
gfx::Rect childArea(gfx::Rect(host->size()));
childArea.Inset(host->GetInsets());
childArea.Inset(inside_border_horizontal_spacing_,
inside_border_vertical_spacing_);
int x = childArea.x();
int y = childArea.y();
for(int i=0; i<host->GetChildViewCount(); ++i)
{
View* child = host->GetChildViewAt(i);
if(child->IsVisible())
{
gfx::Rect bounds(x, y, childArea.width(), childArea.height());
gfx::Size size(child->GetPreferredSize());
if(orientation_ == kHorizontal)
{
bounds.set_width(size.width());
x += size.width() + between_child_spacing_;
}
else
{
bounds.set_height(size.height());
y += size.height() + between_child_spacing_;
}
// Clamp child view bounds to |childArea|.
child->SetBounds(bounds.Intersect(childArea));
}
}
}
示例4: RenderViews
void ViewOwner::RenderViews()
{
for (auto i = _views.rbegin(); i != _views.rend(); ++i)
{
View* view = *i;
if (view->IsVisible())
view->Render();
}
}
示例5: Layout
// LayoutManager overrides:
virtual void Layout(View* host)
{
gfx::Rect bounds(host->GetContentsBounds());
for(int i=0; i<host->child_count(); ++i)
{
View* child = host->child_at(i);
// We only layout visible children, since it may be expensive.
if(child->IsVisible() && child->bounds()!=bounds)
{
child->SetBoundsRect(bounds);
}
}
}
示例6: oldBounds
void
View::ResizeBy(int32 x, int32 y, BRegion* dirtyRegion)
{
if (x == 0 && y == 0)
return;
fFrame.right += x;
fFrame.bottom += y;
if (fVisible && dirtyRegion) {
IntRect oldBounds(Bounds());
oldBounds.right -= x;
oldBounds.bottom -= y;
BRegion* dirty = fWindow->GetRegion();
if (!dirty)
return;
dirty->Set((clipping_rect)Bounds());
dirty->Include((clipping_rect)oldBounds);
if (!(fFlags & B_FULL_UPDATE_ON_RESIZE)) {
// the dirty region is just the difference of
// old and new bounds
dirty->Exclude((clipping_rect)(oldBounds & Bounds()));
}
InvalidateScreenClipping();
if (dirty->CountRects() > 0) {
if ((fFlags & B_DRAW_ON_CHILDREN) == 0) {
// exclude children, they are expected to
// include their own dirty regions in ParentResized()
for (View* child = FirstChild(); child;
child = child->NextSibling()) {
if (!child->IsVisible())
continue;
IntRect previousChildVisible(
child->Frame() & oldBounds & Bounds());
if (dirty->Frame().Intersects(previousChildVisible)) {
dirty->Exclude((clipping_rect)previousChildVisible);
}
}
}
ConvertToScreen(dirty);
dirtyRegion->Include(dirty);
}
fWindow->RecycleRegion(dirty);
}
// layout the children
for (View* child = FirstChild(); child; child = child->NextSibling())
child->ParentResized(x, y, dirtyRegion);
// view bitmap
resize_frame(fBitmapDestination, fBitmapResizingMode, x, y);
// at this point, children are at their new locations,
// so we can rebuild the clipping
// TODO: when the implementation of Hide() and Show() is
// complete, see if this should be avoided
RebuildClipping(false);
}