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

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

#include <viewer.hpp>

Public 类型

using ContainerType = _tCon
 容器类型。 更多...
 
using SizeType = typename _tCon::size_type
 项目索引类型。 更多...
 
using DifferenceType = typename _tCon::difference_type
 项目索引差值类型。 更多...
 

Public 成员函数

 GSequenceViewer (ContainerType &con)
 构造:使用指定容器。 更多...
 
 PDefHOp (GSequenceViewer &,++,) ImplRet(IncreaseSelected(1)) PDefHOp(GSequenceViewer &
 
 ImplRet (IncreaseSelected(-1)) PDefHOp(GSequenceViewer &
 < 选中项目的索引自减。 更多...
 
int ImplRet (IncreaseHead(1)) PDefHOp(GSequenceViewer &
 < 视图中首个项目的索引自增。 更多...
 
int int ImplRet (IncreaseHead(-1)) DefPred(const ynothrow
 < 视图中首个项目的索引自减。 更多...
 
int int is_selected bool Contains (SizeType i) const
 判断是否在有效范围内包含指定项目索引。 更多...
 
 DefGetter (const ynothrow, SizeType, Total, p_con->size()) DefGetter(const ynothrow
 
length DefGetter (const ynothrow, SizeType, HeadIndex, head) DefGetter(const ynothrow
 
length selected DefGetter (const ynothrow, DifferenceType, Offset, IsSelected()?GetSelectedIndex()-GetHeadIndex():-1) DefGetter(const ynothrow
 
length selected min (GetTotal()-GetHeadIndex(), GetLength())) void SetContainer(ContainerType &con)
 < 取当前视图中有效项目个数。 更多...
 
bool SetHeadIndex (SizeType t)
 设置视图中首个项目的索引。 更多...
 
bool SetLength (SizeType l)
 设置长度。 更多...
 
bool SetSelectedIndex (SizeType t)
 设置选中项目的索引。 更多...
 
bool AdjustForContent ()
 按序列内容大小依次调整选中和首个项目的索引。 更多...
 

Public 属性

int int Selected
 
 SizeType
 
 Length
 
length SizeType
 
length SelectedIndex
 
length selected SizeType
 
length selected Valid
 

Private 属性

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

详细描述

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

序列视图类模板。

自从
build 147

在文件 viewer.hpp46 行定义.

成员类型定义说明

template<class _tCon >
using YSLib::UI::GSequenceViewer< _tCon >::ContainerType = _tCon

容器类型。

自从
build 292

在文件 viewer.hpp53 行定义.

template<class _tCon >
using YSLib::UI::GSequenceViewer< _tCon >::DifferenceType = typename _tCon::difference_type

项目索引差值类型。

在文件 viewer.hpp56 行定义.

template<class _tCon >
using YSLib::UI::GSequenceViewer< _tCon >::SizeType = typename _tCon::size_type

项目索引类型。

在文件 viewer.hpp54 行定义.

构造及析构函数说明

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

构造:使用指定容器。

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

在文件 viewer.hpp84 行定义.

成员函数说明

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

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

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

在文件 viewer.hpp191 行定义.

参考 platform_ex::Reset(), YSLib::UI::GSequenceViewer< _tCon >::selected , 以及 ytest::timing::total().

函数调用图:

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

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

在文件 viewer.hpp108 行定义.

template<class _tCon >
YSLib::UI::GSequenceViewer< _tCon >::DefGetter ( const ynothrow  ,
SizeType  ,
Total  ,
p_con->  size() 
) const
参数
size取容器中项目个数。
template<class _tCon >
length YSLib::UI::GSequenceViewer< _tCon >::DefGetter ( const ynothrow  ,
SizeType  ,
HeadIndex  ,
head   
) const
template<class _tCon >
length selected YSLib::UI::GSequenceViewer< _tCon >::DefGetter ( const ynothrow  ,
DifferenceType  ,
Offset  ,
IsSelected()?GetSelectedIndex()-GetHeadIndex():-  1 
) const
参数
1取选中的项目相对于视图中首个项目的的索引偏移(未选中时为 -1 )。
template<class _tCon >
YSLib::UI::GSequenceViewer< _tCon >::ImplRet ( IncreaseSelected(-1)  )

< 选中项目的索引自减。

template<class _tCon >
int YSLib::UI::GSequenceViewer< _tCon >::ImplRet ( IncreaseHead(1)  )

< 视图中首个项目的索引自增。

template<class _tCon >
int int YSLib::UI::GSequenceViewer< _tCon >::ImplRet ( IncreaseHead(-1)  ) const

< 视图中首个项目的索引自减。

判断是否为选中状态。

template<class _tCon >
length selected YSLib::UI::GSequenceViewer< _tCon >::min ( GetTotal()-GetHeadIndex()  ,
GetLength()   
)
inline

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

设置容器。

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

在文件 viewer.hpp122 行定义.

template<class _tCon >
YSLib::UI::GSequenceViewer< _tCon >::PDefHOp ( GSequenceViewer< _tCon > &  ,
++   
)
template<class _tCon >
bool YSLib::UI::GSequenceViewer< _tCon >::SetHeadIndex ( SizeType  t)
inline

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

在文件 viewer.hpp140 行定义.

参考 YSLib::UI::GSequenceViewer< _tCon >::head , 以及 YSLib::UI::GSequenceViewer< _tCon >::length.

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

设置长度。

在文件 viewer.hpp158 行定义.

参考 platform_ex::Windows::l , 以及 YSLib::UI::GSequenceViewer< _tCon >::length.

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

设置选中项目的索引。

在文件 viewer.hpp171 行定义.

参考 YSLib::UI::GSequenceViewer< _tCon >::is_selected , 以及 YSLib::UI::GSequenceViewer< _tCon >::selected.

参考自 YSLib::UI::SelectFirst() , 以及 YSLib::UI::SelectLast().

这是这个函数的调用关系图:

类成员变量说明

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

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

在文件 viewer.hpp72 行定义.

参考自 YSLib::UI::GSequenceViewer< _tCon >::SetHeadIndex().

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

选中状态。

在文件 viewer.hpp75 行定义.

参考自 YSLib::UI::GSequenceViewer< _tCon >::SetSelectedIndex().

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

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

在文件 viewer.hpp74 行定义.

参考自 YSLib::UI::GSequenceViewer< _tCon >::SetHeadIndex() , 以及 YSLib::UI::GSequenceViewer< _tCon >::SetLength().

template<class _tCon >
YSLib::UI::GSequenceViewer< _tCon >::Length

在文件 viewer.hpp116 行定义.

template<class _tCon >
_tCon* YSLib::UI::GSequenceViewer< _tCon >::p_con
private

序列容器指针。

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

在文件 viewer.hpp60 行定义.

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

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

在文件 viewer.hpp73 行定义.

参考自 YSLib::UI::GSequenceViewer< _tCon >::AdjustForContent() , 以及 YSLib::UI::GSequenceViewer< _tCon >::SetSelectedIndex().

template<class _tCon >
int int YSLib::UI::GSequenceViewer< _tCon >::Selected

在文件 viewer.hpp102 行定义.

template<class _tCon >
length YSLib::UI::GSequenceViewer< _tCon >::SelectedIndex

在文件 viewer.hpp118 行定义.

template<class _tCon >
YSLib::UI::GSequenceViewer< _tCon >::SizeType

在文件 viewer.hpp116 行定义.

template<class _tCon >
length YSLib::UI::GSequenceViewer< _tCon >::SizeType

在文件 viewer.hpp118 行定义.

template<class _tCon >
length selected YSLib::UI::GSequenceViewer< _tCon >::SizeType

在文件 viewer.hpp122 行定义.

template<class _tCon >
length selected YSLib::UI::GSequenceViewer< _tCon >::Valid

在文件 viewer.hpp122 行定义.


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