-
首页
-
C4D R23.110 C++ SDK
SimpleListView Class Reference
#include <c4d_listview.h>
详细描述
A class for simple list views. See
ListView.cpp
SDK example.
公共成员函数
|
|
SimpleListView
()
|
virtual
|
~SimpleListView
()
|
Bool
|
SetLayout
(
Int32
columns, const
BaseContainer
&data)
|
Bool
|
SetItem
(
Int32
id, const
BaseContainer
&data)
|
Bool
|
GetItem
(
Int32
id,
BaseContainer
*data)
|
Int32
|
GetItemCount
(void)
|
Bool
|
GetItemLine
(
Int32
num,
Int32
*id,
BaseContainer
*data)
|
Bool
|
RemoveItem
(
Int32
id)
|
Int32
|
GetSelection
(
BaseSelect
*selection)
|
Bool
|
SetSelection
(
BaseSelect
*selection)
|
Int32
|
GetProperty
(
Int32
id)
|
Bool
|
SetProperty
(
Int32
id,
Int32
val)
|
virtual void
|
LvCallBack
(
Int32
&res_type, void *&result, void *secret,
Int32
cmd,
Int32
line,
Int32
col, void *data1)
|
void
|
ShowCell
(
Int32
line,
Int32
col)
|
|
GeListView
()
|
virtual
|
~GeListView
()
|
Int
|
LvCallBackLong
(void *secret,
Int32
cmd,
Int32
line,
Int32
col, void *data1)
|
void
|
LvSuperCall
(
Int32
&res_type, void *&result, void *secret,
Int32
cmd,
Int32
line,
Int32
col)
|
void
|
Redraw
(void)
|
void
|
DataChanged
(void)
|
Bool
|
SendParentMessage
(const
BaseContainer
&msg)
|
Int32
|
GetId
(void)
|
Bool
|
ExtractMouseInfo
(void *secret,
MouseDownInfo
&info,
Int32
size)
|
Bool
|
ExtractDrawInfo
(void *secret,
DrawInfo
&info,
Int32
size)
|
Bool
|
AttachListView
(
GeDialog
*
cd
,
Int32
id)
|
void
|
ShowCell
(
Int32
line,
Int32
col)
|
构造函数 & 析构函数文档编制
◆
SimpleListView()
Constructor. Creates the list view, but does not attach it to any dialog.
-
另请参阅
-
GeListView::AttachListView
◆
~SimpleListView()
Destructor. Destroys the list view.
成员函数文档编制
◆
SetLayout()
Sets the current column layout.
The data is layed out linearly in the supplied container, i.e. the order of the columns is specified by the order in which the items are added to the container.
Each item in the container represents one column. The ID of the element is the column ID. The value of the item (of type
Int32
) should be one of the following:
-
LV_COLUMN_TEXT
-
LV_COLUMN_CHECKBOX
-
LV_COLUMN_BUTTON
Here is an example:
#define COL_CHECK 'chck'
#define COL_NAME 'name'
#define COL_BUTTON 'bttn'
BaseContainer
layout;
layout.
SetInt32
(COL_CHECK,
LV_COLUMN_CHECKBOX
);
layout.
SetInt32
(COL_NAME,
LV_COLUMN_TEXT
);
layout.
SetInt32
(COL_BUTTON,
LV_COLUMN_BUTTON
);
listview.SetLayout(3, layout);
-
参数
-
[in]
|
columns
|
The number of columns.
|
[in]
|
data
|
The column data.
|
-
返回
-
true
if successful, otherwise
false
.
◆
SetItem()
Sets the data for a list view line, inserting a new one if it is not found.
The container should be filled with proper values for each column ID that needs to be changed/set.
Here is an example:
BaseContainer
data;
data.
SetBool
(COL_CHECK, obj.GetChecked());
data.
SetString
(COL_NAME, obj.
GetName
());
listview.SetItem(obj.GetID(), data);
-
参数
-
[in]
|
id
|
The ID of the line.
|
[in]
|
data
|
The data for the line.
|
-
返回
-
true
if successful, otherwise
false
.
◆
GetItem()
Retrieves the data for a list view line.
-
参数
-
[out]
|
id
|
The ID of the line.
|
[out]
|
data
|
For each column of the line an item with the column ID is inserted into
data
.
|
-
返回
-
true
if successful, otherwise
false
.
◆
GetItemCount()
Int32
GetItemCount
|
(
|
void
|
|
)
|
|
Gets the number of lines.
-
返回
-
The number of lines in the list view.
◆
GetItemLine()
Like
GetItem()
, but with the line number instead of line ID.
-
参数
-
[in]
|
num
|
The number of the line.
|
[out]
|
id
|
Assigned the line ID.
|
[out]
|
data
|
For each column of the line an item with the column ID is inserted into
data
.
|
-
返回
-
true
if successful, otherwise
false
.
◆
RemoveItem()
Removes a line from the list view.
-
参数
-
[in]
|
id
|
The ID of the line.
|
-
返回
-
true
if successful, otherwise
false
.
◆
GetSelection()
Retrieves the current selection.
-
参数
-
[out]
|
selection
|
Filled with the current selection. Multiple selections are possible (see
SLV_MULTIPLESELECTION
). The caller owns the pointed container.
|
-
返回
-
The number of selected items.
◆
SetSelection()
Sets the current selection.
-
参数
-
[in]
|
selection
|
The selection to set. Multiple selections are possible (see
SLV_MULTIPLESELECTION
). The caller owns the pointed container.
|
-
返回
-
true
if successful, otherwise
false
.
◆
GetProperty()
Retrieves a property for the list view.
-
参数
-
[in]
|
id
|
The ID of the property:
SLV
|
-
返回
-
The property value.
◆
SetProperty()
Sets a property for the list view.
-
参数
-
-
返回
-
true
if successful, otherwise
false
.
◆
LvCallBack()
virtual void LvCallBack
|
(
|
Int32
&
|
res_type
,
|
|
|
void *&
|
result
,
|
|
|
void *
|
secret
,
|
|
|
Int32
|
cmd
,
|
|
|
Int32
|
line
,
|
|
|
Int32
|
col
,
|
|
|
void *
|
data1
|
|
)
|
|
|
|
virtual
|
Internal
.
Reimplemented from
GeListView
.
◆
ShowCell()
Scrolls to the cell specified by
line
and
col
.
-
参数
-
[in]
|
line
|
The line of the cell.
|
[in]
|
col
|
The column of the cell.
|
@ LV_COLUMN_BUTTON
Button.
定义:
ge_prepass.h:5132
void SetInt32(Int32 id, Int32 l)
定义:
c4d_basecontainer.h:505
void SetString(Int32 id, const maxon::String &s)
定义:
c4d_basecontainer.h:569
void SetBool(Int32 id, Bool b)
定义:
c4d_basecontainer.h:498
@ LV_COLUMN_CHECKBOX
Checkbox.
定义:
ge_prepass.h:5131
String GetName() const
定义:
c4d_baselist.h:2318
@ LV_COLUMN_TEXT
Text.
定义:
ge_prepass.h:5128
定义:
c4d_basecontainer.h:46