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


C++ Column::GetLastMasterColumn方法代码示例

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


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

示例1: AccumulateMasterColumns

 void ColumnSet::AccumulateMasterColumns()
 {
     DCHECK(master_columns_.empty());
     for(std::vector<Column*>::iterator i=columns_.begin();
         i!=columns_.end(); ++i)
     {
         Column* column = *i;
         Column* master_column = column->GetLastMasterColumn();
         if(master_column && find(master_columns_.begin(),
             master_columns_.end(), master_column)==master_columns_.end())
         {
             master_columns_.push_back(master_column);
         }
         // At this point, GetLastMasterColumn may not == master_column
         // (may have to go through a few Columns)_. Reset master_column to
         // avoid hops.
         column->master_column_ = master_column;
     }
 }
开发者ID:abyvaltsev,项目名称:putty-nd3.x,代码行数:19,代码来源:grid_layout.cpp

示例2: CalculateMasterColumns

 void ColumnSet::CalculateMasterColumns()
 {
     for(std::vector<Column*>::iterator i=columns_.begin();
         i!=columns_.end(); ++i)
     {
         Column* column = *i;
         int same_size_column_index = column->same_size_column_;
         if(same_size_column_index != -1)
         {
             DCHECK(same_size_column_index>=0 &&
                 same_size_column_index<static_cast<int>(columns_.size()));
             Column* master_column = column->master_column_;
             Column* same_size_column = columns_[same_size_column_index];
             Column* same_size_column_master = same_size_column->master_column_;
             if(master_column == NULL)
             {
                 // Current column is not linked to any other column.
                 if(same_size_column_master == NULL)
                 {
                     // Both columns are not linked.
                     column->master_column_ = column;
                     same_size_column->master_column_ = column;
                     column->same_size_columns_.push_back(same_size_column);
                     column->same_size_columns_.push_back(column);
                 }
                 else
                 {
                     // Column to link to is linked with other columns.
                     // Add current column to list of linked columns in other columns
                     // master column.
                     same_size_column->GetLastMasterColumn()->
                         same_size_columns_.push_back(column);
                     // And update the master column for the current column to that
                     // of the same sized column.
                     column->master_column_ = same_size_column;
                 }
             }
             else
             {
                 // Current column is already linked with another column.
                 if(same_size_column_master == NULL)
                 {
                     // Column to link with is not linked to any other columns.
                     // Update it's master_column.
                     same_size_column->master_column_ = column;
                     // Add linked column to list of linked column.
                     column->GetLastMasterColumn()->same_size_columns_.
                         push_back(same_size_column);
                 }
                 else if(column->GetLastMasterColumn() !=
                     same_size_column->GetLastMasterColumn())
                 {
                     // The two columns are already linked with other columns.
                     std::vector<Column*>* same_size_columns =
                         &(column->GetLastMasterColumn()->same_size_columns_);
                     std::vector<Column*>* other_same_size_columns =
                         &(same_size_column->GetLastMasterColumn()->same_size_columns_);
                     // Add all the columns from the others master to current columns
                     // master.
                     same_size_columns->insert(same_size_columns->end(),
                         other_same_size_columns->begin(),
                         other_same_size_columns->end());
                     // The other master is no longer a master, clear its vector of
                     // linked columns, and reset its master_column.
                     other_same_size_columns->clear();
                     same_size_column->GetLastMasterColumn()->master_column_ = column;
                 }
             }
         }
     }
     AccumulateMasterColumns();
 }
开发者ID:abyvaltsev,项目名称:putty-nd3.x,代码行数:72,代码来源:grid_layout.cpp


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