githubEdit

Other Advanced Control Class

Brief Introduction to Other Advanced Control Classes

The class of controls are mainly view series controls, mainly used to display list item information of different types.

Class inheritance relations of other advanced control classes are as below:

In the advanced control class, list item is managed as an object. Different controls use different list item objects, and the inheritance relations are as below:

Let’s firstly introduce the list item objects, and then concretely introduce the control classes.

mItem

mItem object is the basic class of all list items, providing a series of basic accessing methods. Control classes such as mListBox, mScrollView and mIconView etc. directly use this object.

Status of mItem

Status name

Explanation

NCSF_ITEM_NORMAL

Item status: normal

NCSF_ITEM_SELECTED

Item status: selected

NCSF_ITEM_DISABLED

Item status: banned

NCSF_ITEM_USEBITMAP

Item status: contain bit map, and mutually exclude with NCSF_ITEM_USEICON

NCSF_ITEM_USEICON

Item status: contain icon, and mutually exclude with NCSF_ITEM_USEBITMAP

Property of mItem

Property

Type

Authority

Explanation

NCSP_ITEM_HEIGHT

int

RW

Item current height

NCSP_ITEM_FLAGS

DWORD

RW

Item status

Method of mItem

It is inherited from the method of mObject

An item can contain multiple kinds of content information, such as text and image etc. Basic methods provided are:

  • isSelectedItem determines if the current item is in selected status.。

  • isEnabledItem determines if the current item is in enabled status.

  • setItemString sets item text.

  • getItemString gets item current text.

  • setItemHeight sets item height.

  • getItemHeight gets item height.

  • setItemFlags sets item status

  • getItemFlags gets item status.

  • setItemImage sets item icon.

  • getItemImage gets item icon.

  • setItemAddData sets item additional data.

  • getItemAddData gets item additional data.

  • setItemEditor sets item editor.

  • getItemEditor gets item editor.

mItemManager

Basic class manager managing mItem and its child class through linked list, providing methods of addling, removing and setting list items.

Status of mItemManager

It is inherited from the status of mItem.

Status name

Explanation

NCSF_ITMMNG_AUTOSORT

Automatic sorting when the item is inserted

NCSF_ITMMNG_FROZEN

Forbidden or enabled item refreshing function

Property of mItemManager

It is inherited from the property of mItem.

Property

Type

Authority

Explanation

NCSP_ITMMNG_ITEMCOUNT

int

RO

Item number contained

NCSP_ITMMNG_FLAGS

DWORD

RW

Item status

NCSP_ITMMNG_TOTALHEIGHT

int

RO

Total height of all the items

Method of mItemManager

It is inherited from the method of mItem.

Callback Method

mItemManager class supports the two callback methods of carrying out comparison according to list item or list item character string. The method of carrying out comparison according to list item prevails to the method of carrying out comparison according to list item character string.

  • setItemCmpFunc is used to set the callback method of carrying out comparison according to the list item itself, and at the same time, previous setting method is returned.

  • setStrCmpFunc is used to set the callback method of carrying out comparison according to the list item character string, and at the same time, the previous setting or default method is returned.

  • getStrCmpFunc is used to get the character string comparison method in current use.

Sorting Method

  • setAutoSortItem set or cancel sorting symbol before adding all the list items. After the sorting symbol setting is successful, all the list items added afterwards will be compared to the existing list items and insert location is determined.

  • sortItems sort all the list items again according to the specified list item comparison method.

Refreshing Method

  • freeze: freeze or recover refreshment to the list item.。

  • isFrozen: judge if it is in refreshable status currently.

  • adjustItemsHeight: adjust the list item total height change value. When the manager handles refreshable status, after the method adjusts the size, it will immediately reflect the changes to UI, otherwise UI will not be refreshed.

Create/Remove/Move List Items

When inserting the list item, firstly confirm if it is automatic sorting supported, if so, calculate the sorting insert location according the automatic sorting calculation method; otherwise, conduct insert tries by sequence according to front and back list items or specified index, if the try is successful, return to the correct location.

  • createItem: create a new list item and insert to the specified location, and at the same time, return to the inserted location through the final parameter.

  • insertItem: insert the created list item to the specified location of the manager, and at the same time, return to the inserted location through the final parameter.

  • moveItem: move the current list items and the list items of specified number afterwards to behind a certain list item location.

  • removeItem: remove a certain specified list item

  • removeAll: remove all the list items.

Traverse List Items

  • getQueue: get the list item column header of the manager.

  • getListEntry: get the list item pointer of the specified linked list item.

  • getFirstItem: get the first list item in the manager.

  • getNext: get the next list item of the specified list item.

  • getPrev: get the previous list item of the specified list item.

Get List Item Information

  • getItem: get the list item of the specified index.

  • indexOf: get index of the specified list item.

  • inItem: get list item under the specified mouse location, and return to the starting location of the list item.

  • getItemYPos: get starting vertical coordinate of the specified list item.

  • getTotalHeight: get total height of the list item manager.

  • getItemCount: get total number of the list items.。

  • isEmpty: judge if the list item is empty.

  • getSelectionCount: get number of the selected list items.

  • getSelection: get information of the selected list items of specified number.

Set/Get List Item Status

  • isEnabled: judge if the specified list item is in enabled status.。

  • enable: enable of forbid the specified list item.

  • isSelected: judge if the specified list item is in selected status.

  • select: select or deselect the specified list item.

  • selectAll: select all the list items.

  • deselectAll: Cancel the selected status of all the list items.

  • hilight: high light select the specified list item.

  • getHilight: get the current high light selected list item.

  • isHilight: judge if the specified list item is in high light status.

  • setHeight: set height of the list item.

  • getHeight: get height of the list item.

  • setAddData: set additional data of the list item.

  • getAddData: get additional data of the list item.

  • setImage: set bit map information of the list item.

  • getImage: get bit map information of the list item.

  • setFlags: set status symbol of the list item.

  • getFlags: get status symbol of the list item.

  • setText: set text character string of the list item.

  • getText: get text character string of the list item.

  • getTextLen: get length of the text character string of the list item.

mListItem

mListItem object is used to describe the row object of mListView control.

Status of mListItem

It is inherited from the status of mItemManger.

Status name

Explanation

NCSF_LSTITM_FOLD

Folded item

NCSF_LSTITM_PRIVBKCOL

The item contains private background color

NCSF_LSTITM_PRIVBKCOL

The item contains private foreground color

Property of mListItem

It is inherited from the property of mItemManager.

Property

Type

Authority

Explanation

NCSP_LSTITM_NRCHILD

int

RO

Child item number contained

NCSP_LSTITM_DEPTH

int

RO

Depth of the item

NCSP_LSTITM_RHEIGHT

int

RO

Actual height when the item is visible

Method of mListItem

It is inherited from the method of mItemManager.

mListItem object provides a series of operation methods:

  • setBackground: used to set unit background color. When the color is empty, empty the original setting; when the index is invalid, set default row background color, otherwise set the specified unit background color.

  • getBackground: used to get unit background color. When the index is invalid, return the default row background color through color, otherwise return the specified unit background color.

  • setForeground: used to set unit foreground color. When the color is empty, empty the original setting; when the index is invalid, set the default row foreground color, otherwise set the specified unit foreground color.

  • getForeground: used to get the unit foreground color. When the index is invalid, return the default row foreground color through color, otherwise return the specified unit foreground color.

  • addChild: add the specified child item.

  • delChild: delete the specified child item.

  • setFold: used to fold or unfold the specified item.

  • getParent: used to get the parent item of the specified item.

  • getChildCount: get the number of the child item contained.

  • getDepth: get the item depth.

  • isFold: judge if the item is in folded status.

mListColumn

mListColumn object is used to describe the column object of mListView control.

Status of mListColumn

It is inherited from the status of mItem.

Status name

Explanation

NCSF_LSTCLM_LEFTALIGN

Text alignment mode: left aligned

NCSF_LSTCLM_RIGHTALIGN

Text alignment mode: right aligned

NCSF_LSTCLM_CENTERALIGN

Text alignment mode: center aligned

Property of mListColumn

It is inherited from the property of mItem.

Property

Type

Authority

Explanation

NCSP_LSTCLM_POSX

int

RW

Column starting position horizontal coordinate

NCSP_LSTCLM_WIDTH

int

RW

Column width

NCSP_LSTCLM_SORTTYPE

ncsLstClmSortType

RW

List item sorting mode: the values are ascending, descending or not sorted

NCSP_LSTCLM_CMPFUNC

NCS_CB_LISTV_CMPCLM

RW

Callback method of comparison of the two list items

The following is the data structure definition involved in the property

mItemView

Basic class, direct use is not allowed.

Style of mItemView

It is inherited from the style of mScrollWidget.

Style name

mstudio property name

Explanation

NCSS_ITEMV_AUTOSORT

-

Item automatic sorting

NCSS_ITEMV_LOOP

-

Item circulative browsing

NCSS_ITEMV_SINGLE

-

Item single selection supported, default style

NCSS_ITEMV_MULTIPLE

-

Item multi selection supported

Property of mItemView

Inherited from the property of mScrollWidget.

Property ID

mstudio name

Type

Authority

Explanation

NCSP_ITEMV_DEFITEMHEIGHT

-

int

RW

Item default height

NCSP_ITEMV_ITEMCOUNT

-

int

RO

Item total number

Event of mItemView

It is inherited from the event of mScrollWidget.

Event notification code

Explanation

Parameter

NCSN_ITEMV_CLICKED

Mouse clicking event

Clicked item sentence handle

NCSN_ITEMV_SELCHANGING

Item changing selection

Item sentence handle in high light status

NCSN_ITEMV_SELCHANGED

The selected item has changed

New selected item sentence handle

NCSN_ITEMV_ENTER

Enter key is pressed down

-

NCSN_ITEMV_SETFOCUS

Get focus

-

NCSN_ITEMV_KILLFOCUS

Lose focus

-

Method of mItemView

It is inherited from the method of mScrollWidget.

Callback Method

mItemView provides three callback methods, initialization, drawing and destroying list item, at the same time, there is the callback method of comparing list items.

Sorting Method

  • setAutoSortItem: Set or cancel sorting symbol before adding all the list items. After the sorting symbol setting is successful, after comparing all the list items added afterwards and the existing list items, confirm the insert position.

  • sortItems: according to the specified list item comparison method, sort all the list items again.

Refreshing Method

  • freeze: freeze or recover refreshment to the list item.。

  • isFrozen: judge if it is in refreshable status currently.

  • adjustItemsHeight: adjust the list item total height change value. The method will immediately reflect the change to UI after the control adjusts the list item size, otherwise UI will not be refreshed.

Create/Remove/Move List Item

When inserting to the list item, firstly determine if it is automatic sorting supported, if so, calculate the sorting insert position according to the automatic sorting calculation method; otherwise conduct insert tries by sequence according to the front and back list item or specified index; after the try is successful, return to the correct position.

  • createItem: create a new list item and insert to the specified position, and at the same time, return to the inserted position according to the final parameter.

  • insertItem: insert the created list item to the specified position of the manager, and at the same time, return to the inserted position according to the final parameter.

  • removeItem: remove certain specified list item.

  • removeAll: remove all the list items.

Traverse List Item

  • getQueue: get the list item column header of the manager.。

  • getListEntry: get the list item pointer of the specified linked list item.

  • getFirstItem: get the first list item in the manager.

  • getNext: get the next list item of the specified list item.

  • getPrev: get the previous list item of the specified list item.

Get List Item Information

  • getItem: get list item of the specified index.

  • indexOf: get index of the specified list item.

  • inItem: get the list item under the specified mouse position, and return to the starting position of the list item.

  • getTotalHeight: get the total height of the list item manager.

  • getItemCount: get the total number of the list items.

  • isEmpty: judge if the list item is empty.

  • getSelectionCount: get number of the selected list items.

  • getSelection: get the selected list item information of specified number.

Set/Get List Item Status

  • isEnabled: judge if the specified list item is in enabled status.

  • enable: enable or forbid specified list item.

  • isSelected: judge if the specified list item is in selected status.

  • select: select specified list item.

  • deselect: deselect the specified list item.

  • selectAll: select all the list items.

  • deselectAll: cancel the selected status of all the list items.

  • hilight: high light select the specified list item.

  • getHilight: get the currently high light selected list item.

  • isHilight: judge if the specified list item is in high light status.

  • setItemHeight: set height of the list item.

  • getItemHeight: get height of the list item.

  • setAddData: set additional data of the list item.

  • getAddData: get additional data of the list item.

  • setImage: set bit map information of the list item.

  • getImage: get bit map information of the list item.

  • setFlags: set status symbol of the list item.

  • getFlags: get status symbol of the list item.

  • setText: set text character string of the list item.

  • getText: get text character string of the list item.

  • getTextLen: get length of the text character string of the list item.

Others

  • getFirstVisItem: get the first visible list item.

  • resetContent: remove all the list items, and reset all the information configuration to the initial value.

  • getRect: get the rectangular region of the specified list item, and decide if converting the coordinate to the coordinate relative to the screen through the final parameter.

  • getCurSel: get the currently selected list item index.

  • setCurSel: set the specified list item as selected item through index and display it, if it is successful, return 0; if it is failed, return -1.

  • refreshItem: refresh the specified region of the specified list item; if the specified region is empty, refresh the whole list item.

  • showItemByIdx: show the specified list item according to the index.

  • showItem: show the specified list item

mScrollView

  • Control window class: NCSCTRL_SCROLLVIEW

  • Control English name: ScrollView

  • Brief introduction: Used to show and handle list item, and content drawing of the list item is decided by the applications themselves.

  • Schematic diagram:

Style of mScrollView

It is inherited from mItemView.

Style name

mstudio property name

Explanation

NCSS_SCRLV_LOOP

-

Item circulative browsing

NCSS_SCRLV_SORT

-

Item automatic sorting

Property of mScrollView

it is inherited from the property of mItemView.

Event of mScrollView

It is inherited from the event of mItemView.

Event notification code

Explanation

Parameter

NCSN_SCRLV_CLICKED

Mouse clicking event

Clicked item sentence handle

NCSN_SCRLV_SELCHANGING

Item changing selection

Item sentence handle in high light status

NCSN_SCRLV_SELCHANGED

The selected item has changed

New selected item sentence handle

Method of mScrollView

It is inherited from the method of mItemView.

mScrollView in inherited from mItemView, which provides addItem method of the control itself. The method creates and inserts list item through list item information, and at the same time, returns the insert position to the interface caller.

Before adding list item content, carry out setting of some basic callback method, such as:

Instance of mScrollView

alt

Figure 1 Output of scrollview Program

List 1 scrollview.c

mListBox

  • Control window class: NCSCTRL_LISTBOX

  • Control English name: ListBox

  • Brief introduction: Display a series of options provided by the users in the child window that can scroll. Users can select certain item or multiple items through keyboard and mouse operation, and the selected list item is usually high light displayed. The most typical usage of list box is file opening dialog box.

  • Schematic diagram:

alt

Style of mListBox

It is inherited from the style of mItemView.

Style name

mstudio property name

Explanation

NCSS_LSTBOX_SINGLE

Multi->FALSE

Single selection list item supported

NCSS_LSTBOX_MULTIPLE

Multi->TRUE

Multi selection list item supported

NCSS_LSTBOX_SORT

AutoSort

List item sorting supported

NCSS_LSTBOX_MOUSEFOLLOW

MouseFollow

The list item supports mouse following

NCSS_LSTBOX_STRING

-

List item with character string

NCSS_LSTBOX_USEBITMAP

UseBitmap

The list item has bit map

NCSS_LSTBOX_CHECKBOX

Checkable

The list item contains checkbox

NCSS_LSTBOX_AUTOCHECK

AutoCheck

checkbox in the list item supports automatic selection

NCSS_LSTBOX_AUTOCHECKBOX

-

Simultaneously contain NCSS_LSTBOX_CHECKBOX and NCSS_LSTBOX_AUTOCHECK styles

Property of mListBox

It is inherited from mItemView.

Property ID

mstudio name

Type

Authority

Explanation

NCSP_LSTBOX_ITEMWIDTH

-

int

RO

Maximum width of the list item

NCSP_LSTBOX_ITEMCOUNT

-

int

RO

Total number of the list item

NCSP_LSTBOX_ITEMHEIGHT

-

int

RW

Height of the list item

NCSP_LSTBOX_TOPITEM

-

int

RW

The first visible list item index

NCSP_LSTBOX_HILIGHTEDITEM

-

int

RW

High light list item index

Event of mListBox

It is inherited from the event of mItemView.

Event notification code

Explanation

Parameter

NCSN_LSTBOX_CLICKED

Mouse clicking event

NCSN_LSTBOX_SELCHANGED

The selected item has changed

New selected item sentence handle

NCSN_LSTBOX_ENTER

Enter key is pressed down

-

NCSN_LSTBOX_SETFOCUS

Get focus

-

NCSN_LSTBOX_KILLFOCUS

Lose focus

-

NCSN_LSTBOX_ERRSPACE

Space is insufficient

-

NCSN_LSTBOX_DBCLK

Double click list item

-

NCSN_LSTBOX_SELCANCEL

Deselect the item

-

NCSN_LSTBOX_CLKCHKMARK

check mark is clicked

-

Method of mListBox

It is inherited from the method of mItemView.

Add the character string to the list box

After establishing listbox control, the next step is placing the character string in it, which can be completed through calling addString method. After adding is successful, the method will return the index value of the list item. The character string is usually quoted through the index number counting from 0, and 0 corresponds to the top item.

insertString can be used to appoint an index value, and insert the character string to the specified position in the list box. But under NCSS_LISTBOX_SORT style, it will insert to the corresponding position according to the sorting result, and index value setting will be ignored.

For Example:

If the added list item contains bit map etc. besides character string, it can be completed through addItems method.

For Example:

Remove List Box Item

List box control can remove the list item of specified index value through delString or removeItemByIdx method or the specified list item is removed through removeItem method; at the same time, all the content in the list box can be emptied through resetContent. Prototype of the function is as below:

For Example:

Select and Get Item

For single selection list box and multi selection list box, in the selected status of index list item, different methods need to be used, below let’s firstly look at the single selection list box. The selected item can control through setCurSel besides through mouse and keyboard operation.

On the contrary, currently selected index item can be obtained through getCurSel, if there is no selected item, -1 will be returned.

In addition, selected status can be set or canceled through selectByIdx or deselectByIdx.

For multi selection list box, setCurSel and getCurSel method can only be used to set and get current high light item, and all the items with selected status cannot be obtained. However, we can use setSel to set selection status of specific item without influencing other items, and value of flag has three meanings:

  • -1: carry out reversed operation to the specified list item, that is, if the original status is not selected, select it, otherwise cancel the selected status.

  • 0: cancel selection to the list item.

  • Others: select the list item.

Prototype of the method:

Example is as following:

On the contrary, we can use isSelected method to determine selection status of specific item:

In addition, for multi selection list box, we can get the currently selected item number through getSelectionCount method, and get index values of all the selected items through getSelection method.

Find Items Containing Character String

The list box provides the method to accurately or vaguely find list item containing certain specified character string within the specified range through findString method:

The following operation will start to accurately find the list item with character string as test from the third list item. If it is successful, the list item index found will be returned, otherwise -1 will be returned:

Set and get current status of the check box of certain item

Return the status of the check box of the item at the specified index. If corresponding item is not found, -1 will be returned. NCSF_LSTITEM_CMCHECKED represents that the check box of the item is in selected status. NCSF_LSTITEM_CMPARTCHECKED represents that the check box of the item is in partial selected status. NCSF_LSTITEM_CMBLANK represents that the check box of the item is in unselected status.

Set the status of the check box of the item at the index specified by index as the value specified in status. When the item specified by index is not found, FALSE will be returned, if it is successful, TRUE will be returned.

Set Certain List Box Item as Bold Display Status

The operation will carry out bold setting to the content of the specified index item.

Set or Get Selection Status of Certain List Box Item

The list box determines if a specific item is in forbid selected status through isEnabled method.

Item selected or forbid item selected can be supported through enableByIdx or enable method.

Set Character String Comparison Function

The list box control uses the sorting method set by the user to arrange the list items through setStrCmpFunc method.

Instance of mListBox

alt

Figure 1 Output of listbox Program

List 2 listbox.c

mIconView

  • Control window class: NCSCTRL_ICONVIEW

  • Control English name: IconView

  • Brief introduction: a series of options provided by the users is offered in the mode of icon plus label literal for browsing. Users can select certain item or multiple items through keyboard and mouse operation, and the selected item is usually high light displayed. The typical usage of icon control is as the display of the container of desktop icon and documents under the directory.

  • Schematic diagram:

alt

Style of mIconView

It is inherited from the style of mItemView.

Style name

mstudio property name

Explanation

NCSS_ICONV_LOOP

Loop

Item circulative browsing

NCSS_ICONV_SORT

AutoSort

Item automatic sorting

Property of mIconView

It is inherited from the property of mItemView.

Property ID

mstudio name

Type

Authority

Explanation

NCSP_ICONV_DEFICONHEIGHT

-

int

RW

Height of the list item

NCSP_ICONV_DEFICONWIDTH

-

int

RW

Width of the list item

Method of mIconView

It is inherited from the method of mItemView.

mIconview control initializes the size of the list item through setIconSize method, and adds list item according to list item information through addItem method.

Example code of adding list item are:

Instance of mIconView

alt

Figure 1 Output of iconview Program

List 3 iconview.c

mListView

  • Control window class: NCSCTRL_LISTVIEW

  • Control English name: ListView

  • Brief introduction:Display a series of data items (list items) in the list mode. Same type of child items of different list items are organized in the column mode, and content of the header of the list control usually reflect the meanings of different child items of the list item. List control is usually used as file browsing box, which can show many file properties including file name, file type, size and modification date in a region.

  • Schematic diagram:

alt

Style of mListView

It is inherited from the style of mItemView.

Style name

mstudio property name

Explanation

NCSS_LISTV_NOTIFY

Notify

Notification event supported

NCSS_LISTV_LOOP

Loop

Circulative browsing supported

NCSS_LISTV_MULTIPLE

Multi->TRUE

Multiple selection supported

NCSS_LISTV_SINGLE

Multi->FALSE

NCSS_LISTV_CHECKBOX

CheckBox

The list item contains checkbox

NCSS_LISTV_AUTOCHECK

AutoCheck

checkbox in the list item supports automatic selection

NCSS_LISTV_AUTOCHECKBOX

-

Contain NCSS_LSTBOX_CHECKBOX and NCSS_LSTBOX_AUTOCHECK styles simultaneously.

NCSS_LISTV_TREE

Tree

Support tree list

NCSS_LISTV_WITHICON

WithIcon

NCSS_LISTV_SORT

Sort

Sorting supported

Property of mListView

It is inherited from the property of mItemView

Property ID

mstudio name

Type

Authority

Explanation

NCSP_LISTV_DEFITEMHEIGHT

-

int

RW

Default height of the list item

NCSP_LISTV_ROWCOUNT

-

RO

int

Row number of the list item

NCSP_LISTV_HDRHEIGHT

HeadHeight

int

RW

height of the list header

NCSP_LISTV_HDRWIDTH

HeadWidth

int

RW

Total width of the list header

NCSP_LISTV_HDRVISIBLE

-

BOOL

RW

If the list header is visible

NCSP_LISTV_SORTCOLUMN

-

int

RW

Index of the sorted columns

NCSP_LISTV_GRIDLINEWIDTH

GridLineWidth

int

RW

Grid width

NCSP_LISTV_GRIDLINECOLOR

GridLineColor

int

RW

Grid color

NCSP_LISTV_COLCOUNT

-

int

RO

Column number of the list item

Event of mListView

It is inherited from the event of mItemView.

Event notification code

Explanation

Parameter

NCSN_LISTV_CLICKED

Mouse clicking event

NCSN_LISTV_SELCHANGED

The selected item has changed

New selection item sentence handle

NCSN_LISTV_ITEMRDOWN

The mouse right key presses down on the list item

Indexed by the clicked row

NCSN_LISTV_ITEMRUP

The mouse right key pops up on the list item

Indexed by the clicked row

NCSN_LISTV_HDRRDOWN

The mouse right key presses down on the header

Indexed by the clicked column

NCSN_LISTV_HDRRUP

The mouse right key pops up on the list item

Indexed by the clicked column

NCSN_LISTV_ITEMDBCLK

Double click the list item

-

NCSN_LISTV_FOLDITEM

The tree list item folds the child node

Clicked list item sentence handle

NCSN_LISTV_UNFOLDITEM

The tree list item opens the child node

Clicked list item sentence handle

Method of mListView

It is inherited from the style of mItemView.

Column Operation

before adding list item to the control, it is necessary to firstly add column through addColumn method:

lstv_clminfo is a NCS_LISTV_CLMINFO structure, which contains the column information of the list control. After adding column, if it is necessary to set or get information related to column, it can be completed through the following method:

In addition, deleting specified column can be realized through delColumn:

List Item Operation

List control is composed of many vertically arranged list items, and each list item is divided into many child items by the column. List item can contain additional data defined by specific applications. Applications can add, modify, set and remove list item or get property information of the list item through corresponding method.

After the control creates and adds column, there is no list item, and now it is necessary to add list item to it through addItem:

Each list item includes one or multiple child item, and number of the child items is the same as the column number of the list control. A child item includes character string and image, and the following method can be used to get and set the information of child item:

Find List Item

findItem is used to find a specific list item in the list control. If the finding is successful, list item sentence handle is returned.

Comparison and Sorting

Besides the sorting function inherited from the basic class is supported, the control can appoint certain column as the accordance column of the sorting, and at the same time, it can set the sorting type as ascending, descending, or unsorted (not arranged).

Callback Method

Drawing of the list header includes drawing of background color and content, and control provides callback method for the upper layer application to process drawing of header. Method:

Operations of tree node

Operation of tree node includes getting related nodes and folding a node, and the related method is:

  • getRelatedItem is used to get the related tree nodes of a node, such as parent node, brother node or the first child node. ncsListVIRType appoints the relations between the related nodes and the objective nodes, including:

  • NCSID_LISTV_IR_PARENT:parent node

  • NCSID_LISTV_IR_FIRSTCHILD:first child node

  • NCSID_LISTV_IR_LASTCHILD:last node

  • NCSID_LISTV_IR_NEXTSIBLING:next brother node

  • NCSID_LISTV_IR_PREVSIBLING:previous brother node

  • foldItem is used to fold or unfold a node item containing child node.

  • getChildItem: used to get the child nodes under the specified parent node.

  • getChildCount: used to get the number of the child nodes of the specified node.

Instance of mListView

alt

Figure 1 Output of listview Program

List 4 listview.c


<< Animation Control Class | Table of Contents | Invisible Control Class >>

Last updated