YSTest  PreAlpha_b400_20130424
The YSLib Test Project
 全部  命名空间 文件 函数 变量 类型定义 枚举 枚举值 友元 宏定义  
YSLib::UI::GSequenceViewer< _tContainer > 模板类 参考

序列视图类模板。 更多...

#include <viewer.hpp>

Public 类型

typedef _tContainer ContainerType
 容器类型。
 
typedef _tContainer::size_type SizeType
 项目索引类型。
 
typedef
_tContainer::difference_type 
DifferenceType
 项目索引差值类型。
 

Public 成员函数

 GSequenceViewer (ContainerType &con)
 构造:使用指定容器。
 
GSequenceVieweroperator++ ()
 
GSequenceVieweroperator-- ()
 
GSequenceVieweroperator++ (int)
 
GSequenceVieweroperator-- (int)
 
bool IsSelected () const ynothrow
 判断是否为选中状态。
 
bool Contains (SizeType i) const
 判断是否在有效范围内包含指定项目索引。
 
SizeType GetTotal () const ynothrow
 取容器中项目个数。
 
SizeType GetLength () const ynothrow
 
SizeType GetHeadIndex () const ynothrow
 
SizeType GetSelectedIndex () const ynothrow
 
DifferenceType GetOffset () const ynothrow
 取选中的项目相对于视图中首个项目的的索引偏移(未选中时为 -1 )。
 
SizeType GetValid () const ynothrow
 取当前视图中有效项目个数。
 
void SetContainer (ContainerType &con)
 设置容器。
 
bool SetHeadIndex (SizeType t)
 设置视图中首个项目的索引。
 
bool SetLength (SizeType l)
 设置长度。
 
bool SetSelectedIndex (SizeType t)
 设置选中项目的索引。
 
bool AdjustForContent ()
 按序列内容大小依次调整选中和首个项目的索引。
 
void ClearSelected ()
 取消选中状态。
 
GSequenceViewerDecreaseHead (DifferenceType d)
 
GSequenceViewerDecreaseSelected (DifferenceType d)
 
GSequenceViewerIncreaseHead (DifferenceType d)
 按偏移设置视图中首个项目的索引。
 
GSequenceViewerIncreaseSelected (DifferenceType d)
 按偏移设置选中项目的索引。
 
bool MoveViewerToBegin ()
 移动视图至序列起始。
 
bool MoveViewerToEnd ()
 移动视图至序列结尾。
 
void Reset ()
 复位视图。
 
bool RestrictSelected ()
 约束被选中的元素在视图内。
 
bool RestrictView ()
 约束视图包含被选中的元素。
 

Private 属性

_tContainer * pContainer
 序列容器指针。
 
SizeType head
 视图中首个项目的索引,大于等于 GetTotal() 时无效。
 
SizeType selected
 选中项目的索引,大于等于 GetTotal() 时无效。
 
SizeType length
 视图长度:最大可视项目数。
 
bool is_selected
 选中状态。
 

详细描述

template<class _tContainer>
class YSLib::UI::GSequenceViewer< _tContainer >

序列视图类模板。

自从
build 147

在文件 viewer.hpp43 行定义.

成员类型定义说明

template<class _tContainer>
typedef _tContainer YSLib::UI::GSequenceViewer< _tContainer >::ContainerType

容器类型。

自从
build 292

在文件 viewer.hpp50 行定义.

template<class _tContainer>
typedef _tContainer::difference_type YSLib::UI::GSequenceViewer< _tContainer >::DifferenceType

项目索引差值类型。

在文件 viewer.hpp53 行定义.

template<class _tContainer>
typedef _tContainer::size_type YSLib::UI::GSequenceViewer< _tContainer >::SizeType

项目索引类型。

在文件 viewer.hpp51 行定义.

构造及析构函数说明

template<class _tContainer>
YSLib::UI::GSequenceViewer< _tContainer >::GSequenceViewer ( ContainerType con)
inlineexplicit

构造:使用指定容器。

后置条件
GetHeadIndex() == 0 && GetSelectedIndex() == 0 && GetLength() == 1 && !IsSelected()

在文件 viewer.hpp81 行定义.

成员函数说明

template<class _tContainer>
bool YSLib::UI::GSequenceViewer< _tContainer >::AdjustForContent ( )
inline

按序列内容大小依次调整选中和首个项目的索引。

后置条件
(GetTotal() == 0 && !IsSelected()) || (GetSelectedIndex() < GetTotal() && GetHeadIndex() < GetTotal())
返回
是否改变了视图中首个项目的索引。
自从
build 393

在文件 viewer.hpp188 行定义.

template<class _tContainer>
void YSLib::UI::GSequenceViewer< _tContainer >::ClearSelected ( )
inline

取消选中状态。

在文件 viewer.hpp207 行定义.

template<class _tContainer>
bool YSLib::UI::GSequenceViewer< _tContainer >::Contains ( SizeType  i) const
inline

判断是否在有效范围内包含指定项目索引。

在文件 viewer.hpp105 行定义.

template<class _tContainer>
GSequenceViewer& YSLib::UI::GSequenceViewer< _tContainer >::DecreaseHead ( DifferenceType  d)
inline
参数
d视图中首个项目的索引减少 d 。

在文件 viewer.hpp212 行定义.

template<class _tContainer>
GSequenceViewer& YSLib::UI::GSequenceViewer< _tContainer >::DecreaseSelected ( DifferenceType  d)
inline
参数
d选中项目的索引减少 d 。

在文件 viewer.hpp216 行定义.

template<class _tContainer>
SizeType YSLib::UI::GSequenceViewer< _tContainer >::GetHeadIndex ( ) const
inline

在文件 viewer.hpp114 行定义.

template<class _tContainer>
SizeType YSLib::UI::GSequenceViewer< _tContainer >::GetLength ( ) const
inline

在文件 viewer.hpp113 行定义.

template<class _tContainer>
DifferenceType YSLib::UI::GSequenceViewer< _tContainer >::GetOffset ( ) const
inline

取选中的项目相对于视图中首个项目的的索引偏移(未选中时为 -1 )。

在文件 viewer.hpp117 行定义.

template<class _tContainer>
SizeType YSLib::UI::GSequenceViewer< _tContainer >::GetSelectedIndex ( ) const
inline

在文件 viewer.hpp115 行定义.

template<class _tContainer>
SizeType YSLib::UI::GSequenceViewer< _tContainer >::GetTotal ( ) const
inline

取容器中项目个数。

在文件 viewer.hpp111 行定义.

template<class _tContainer>
SizeType YSLib::UI::GSequenceViewer< _tContainer >::GetValid ( ) const
inline

取当前视图中有效项目个数。

在文件 viewer.hpp120 行定义.

template<class _tContainer>
GSequenceViewer& YSLib::UI::GSequenceViewer< _tContainer >::IncreaseHead ( DifferenceType  d)
inline

按偏移设置视图中首个项目的索引。

参数
d增加的索引偏移值。

在文件 viewer.hpp225 行定义.

template<class _tContainer>
GSequenceViewer& YSLib::UI::GSequenceViewer< _tContainer >::IncreaseSelected ( DifferenceType  d)
inline

按偏移设置选中项目的索引。

参数
d增加的索引偏移值。

在文件 viewer.hpp239 行定义.

template<class _tContainer>
bool YSLib::UI::GSequenceViewer< _tContainer >::IsSelected ( ) const
inline

判断是否为选中状态。

在文件 viewer.hpp99 行定义.

template<class _tContainer>
bool YSLib::UI::GSequenceViewer< _tContainer >::MoveViewerToBegin ( )
inline

移动视图至序列起始。

在文件 viewer.hpp252 行定义.

template<class _tContainer>
bool YSLib::UI::GSequenceViewer< _tContainer >::MoveViewerToEnd ( )
inline

移动视图至序列结尾。

在文件 viewer.hpp266 行定义.

template<class _tContainer>
GSequenceViewer& YSLib::UI::GSequenceViewer< _tContainer >::operator++ ( )
inline

在文件 viewer.hpp85 行定义.

template<class _tContainer>
GSequenceViewer& YSLib::UI::GSequenceViewer< _tContainer >::operator++ ( int  )
inline

在文件 viewer.hpp89 行定义.

template<class _tContainer>
GSequenceViewer& YSLib::UI::GSequenceViewer< _tContainer >::operator-- ( )
inline

在文件 viewer.hpp87 行定义.

template<class _tContainer>
GSequenceViewer& YSLib::UI::GSequenceViewer< _tContainer >::operator-- ( int  )
inline

在文件 viewer.hpp92 行定义.

template<class _tContainer>
void YSLib::UI::GSequenceViewer< _tContainer >::Reset ( )
inline

复位视图。

自从
build 298

在文件 viewer.hpp279 行定义.

template<class _tContainer>
bool YSLib::UI::GSequenceViewer< _tContainer >::RestrictSelected ( )
inline

约束被选中的元素在视图内。

后置条件
GetTotal() == 0 || (!(GetSelectedIndex() < GetHeadIndex()) && GetSelectedIndex() < GetHeadIndex() + GetLength())
返回
是否改变了视图中选中项目的索引。

在文件 viewer.hpp291 行定义.

template<class _tContainer>
bool YSLib::UI::GSequenceViewer< _tContainer >::RestrictView ( )
inline

约束视图包含被选中的元素。

后置条件
GetTotal() == 0 || (!(GetSelectedIndex() < GetHeadIndex()) && GetSelectedIndex() < GetHeadIndex() + GetLength())
返回
是否改变了视图中首个项目的索引。

在文件 viewer.hpp311 行定义.

template<class _tContainer>
void YSLib::UI::GSequenceViewer< _tContainer >::SetContainer ( ContainerType con)
inline

设置容器。

注解
若容器和之前不同则重置视图。
自从
build 292

在文件 viewer.hpp128 行定义.

template<class _tContainer>
bool YSLib::UI::GSequenceViewer< _tContainer >::SetHeadIndex ( SizeType  t)
inline

设置视图中首个项目的索引。

在文件 viewer.hpp137 行定义.

template<class _tContainer>
bool YSLib::UI::GSequenceViewer< _tContainer >::SetLength ( SizeType  l)
inline

设置长度。

在文件 viewer.hpp155 行定义.

template<class _tContainer>
bool YSLib::UI::GSequenceViewer< _tContainer >::SetSelectedIndex ( SizeType  t)
inline

设置选中项目的索引。

在文件 viewer.hpp168 行定义.

类成员变量说明

template<class _tContainer>
SizeType YSLib::UI::GSequenceViewer< _tContainer >::head
private

视图中首个项目的索引,大于等于 GetTotal() 时无效。

在文件 viewer.hpp69 行定义.

template<class _tContainer>
bool YSLib::UI::GSequenceViewer< _tContainer >::is_selected
private

选中状态。

在文件 viewer.hpp72 行定义.

template<class _tContainer>
SizeType YSLib::UI::GSequenceViewer< _tContainer >::length
private

视图长度:最大可视项目数。

在文件 viewer.hpp71 行定义.

template<class _tContainer>
_tContainer* YSLib::UI::GSequenceViewer< _tContainer >::pContainer
private

序列容器指针。

自从
build 392
build 392
注解
非空。
自从
build 292

在文件 viewer.hpp57 行定义.

template<class _tContainer>
SizeType YSLib::UI::GSequenceViewer< _tContainer >::selected
private

选中项目的索引,大于等于 GetTotal() 时无效。

在文件 viewer.hpp70 行定义.


该类的文档由以下文件生成: