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


C++ View::IsVisible方法代码示例

本文整理汇总了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();
    }
开发者ID:Strongc,项目名称:Chrome_Library,代码行数:59,代码来源:single_split_view.cpp

示例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_);
 }
开发者ID:Strongc,项目名称:Chrome_Library,代码行数:30,代码来源:box_layout.cpp

示例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));
         }
     }
 }
开发者ID:Strongc,项目名称:Chrome_Library,代码行数:30,代码来源:box_layout.cpp

示例4: RenderViews

void ViewOwner::RenderViews()
{
	for (auto i = _views.rbegin(); i != _views.rend(); ++i)
	{
		View* view = *i;
		if (view->IsVisible())
			view->Render();
	}
}
开发者ID:openwar,项目名称:openwar,代码行数:9,代码来源:View.cpp

示例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);
         }
     }
 }
开发者ID:leer168,项目名称:x-framework,代码行数:14,代码来源:native_tabbed_pane_win.cpp

示例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);
}
开发者ID:mmanley,项目名称:Antares,代码行数:65,代码来源:View.cpp


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