MiniGUI API Reference (MiniGUI-Processes)  v5.0.6
A mature and proven cross-platform GUI system for embedded and smart IoT devices
Macros
Messages of treeview control

Macros

#define TVM_ADDITEM   0xF110
 Adds a new item in a treeview control. More...
 
#define TVM_INSERTITEM   0xF111
 The same as TVM_ADDITEM message. More...
 
#define TVM_GETROOT   0xF112
 Get the root item of a treeview control. More...
 
#define TVM_DELTREE   0xF113
 Removes an item and its descendant items for the treeview control. More...
 
#define TVM_SEARCHITEM   0xF114
 Searches an item matching a specified string in a subtree rooted by a specific item. More...
 
#define TVM_FINDCHILD   0xF115
 Finds a child item matching a specified string in children of a specific item. More...
 
#define TVM_GETSELITEM   0xF116
 Get the selected item. More...
 
#define TVM_SETSELITEM   0xF117
 Set the selected item. More...
 
#define TVM_GETITEMTEXTLEN   0xF118
 Retrives the text length of the specified item in TreeView control. More...
 
#define TVM_GETITEMTEXT   0xF119
 Retrives the text of the specified item in TreeView control. More...
 
#define TVM_GETITEMINFO   0xF11A
 Retrives the information of an item in TreeView control. More...
 
#define TVM_SETITEMINFO   0xF11B
 Changes the information of an item. More...
 
#define TVM_GETRELATEDITEM   0xF11C
 Retrives related item of specific item. More...
 
#define TVM_SETSTRCMPFUNC   0xF11D
 Set the STRCMP function used to sort items. More...
 

Detailed Description

Macro Definition Documentation

◆ TVM_ADDITEM

#define TVM_ADDITEM   0xF110

Adds a new item in a treeview control.

GHANDLE parent;
PTVITEMINFO newIteminfo;
wParam = (WPARAM)parent;
lParam = (LPARAM)newIteminfo;
Parameters
parentHandle to the item who is the parent of the new item.
newIteminfoPointer to the item info structure of the new item to be added.
Returns
The handle to the new item on success, otherwise return 0.

Definition at line 202 of file treeview.h.

◆ TVM_DELTREE

#define TVM_DELTREE   0xF113

Removes an item and its descendant items for the treeview control.

GHANDLE item;
wParam = (WPARAM)item;
lParam = 0;
Returns
Zero on success, otherwise -1.

Definition at line 239 of file treeview.h.

◆ TVM_FINDCHILD

#define TVM_FINDCHILD   0xF115

Finds a child item matching a specified string in children of a specific item.

GHNADLE item;
char* string;
wParam = (WPARAM)item;
lParam = (LPARAM)string;
Parameters
itemThe handle to the item. Zero means the root item.
stringThe specified string.
Returns
The handle to the item whose text matches the specified string on success, otherwise zero for not found or invalid parameters.

Definition at line 284 of file treeview.h.

◆ TVM_GETITEMINFO

#define TVM_GETITEMINFO   0xF11A

Retrives the information of an item in TreeView control.

GHANDLE item;
TVITEMINFO* tvii;
wParam = (WPARAM)item;
lParam = (LPARAM)tvii;
Parameters
itemThe handle to the item which we want to retrive.
tviiA pointer to a TVITEMINFO structure to receive the item information. Note that the text field of this structure should be large enough to get the item text.
Returns
Zero on success, otherwise -1.
See also
TVM_GETITEMTEXTLEN

Definition at line 382 of file treeview.h.

◆ TVM_GETITEMTEXT

#define TVM_GETITEMTEXT   0xF119

Retrives the text of the specified item in TreeView control.

GHANDLE item;
char* buffer;
wParam = (WPARAM)item;
lParam = (LPARAM)buffer;
Parameters
itemThe handle to the item which we want to retrive.
bufferThe pointer to a buffer to save the text of the item.
Returns
The length of the item text on success, otherwise -1.

Definition at line 357 of file treeview.h.

◆ TVM_GETITEMTEXTLEN

#define TVM_GETITEMTEXTLEN   0xF118

Retrives the text length of the specified item in TreeView control.

GHANDLE item;
wParam = (WPARAM)item;
lParam = (LPARAM)0;
Parameters
itemThe handle to the item which we want to retrive.
Returns
The length of the item text on success, otherwise -1.

Definition at line 336 of file treeview.h.

◆ TVM_GETRELATEDITEM

#define TVM_GETRELATEDITEM   0xF11C

Retrives related item of specific item.

int related;
GHANDLE item;
wParam = (WPARAM)related;
lParam = (LPARAM)item;
Parameters
relatedA integer which indicates the relationship between the item to retrive and the specified item, can be one of the following values:
  • TVIR_PARENT
    To retrive the parent item of the specified item.
  • TVIR_FIRSTCHILD
    To retrive the first child item of the specified item.
  • TVIR_NEXTSIBLING
    To retrive the next sibling item of the specified item.
  • TVIR_PREVSIBLING
    To retrive the previous sibling item of the specified item.
itemThe handle to the known item.
Returns
The handle to the related item on success, otherwise 0.

Definition at line 438 of file treeview.h.

◆ TVM_GETROOT

#define TVM_GETROOT   0xF112

Get the root item of a treeview control.

wParam = 0;
lParam = 0;
Returns
The handle to the root item.

Definition at line 223 of file treeview.h.

◆ TVM_GETSELITEM

#define TVM_GETSELITEM   0xF116

Get the selected item.

wParam = 0;
lParam = 0;
Returns
Handle to the selected item.

Definition at line 299 of file treeview.h.

◆ TVM_INSERTITEM

#define TVM_INSERTITEM   0xF111

The same as TVM_ADDITEM message.

Definition at line 208 of file treeview.h.

◆ TVM_SEARCHITEM

#define TVM_SEARCHITEM   0xF114

Searches an item matching a specified string in a subtree rooted by a specific item.

Note
This is a depth first search.
GHNADLE item;
char* string;
wParam = (WPARAM)item;
lParam = (LPARAM)string;
Parameters
foundThe handle to the item which is the root item of the subtree. Zero means the root item.
stringThe specified string.
Returns
The handle to the item whose text matches the specified string on success, otherwise zero for not found or invalid parameters.

Definition at line 263 of file treeview.h.

◆ TVM_SETITEMINFO

#define TVM_SETITEMINFO   0xF11B

Changes the information of an item.

TVM_SETITEMTEXT
GHANDLE item;
TVITEMINFO* tvii;
wParam = (WPARAM)id;
lParam = (LPARAM)tvii;
Parameters
itemThe handle of the item.
newTextPointer to a TVITEMINFO structure which include the new information of the item.
Returns
Zero on success, otherwise -1.

Definition at line 403 of file treeview.h.

◆ TVM_SETSELITEM

#define TVM_SETSELITEM   0xF117

Set the selected item.

GHANDLE item;
wParam = (WPARAM)item;
lParam = 0;
Parameters
itemThe handle to candicate item.
Returns
The handle to the old selected item on success, otherwise -1.

Definition at line 317 of file treeview.h.

◆ TVM_SETSTRCMPFUNC

#define TVM_SETSTRCMPFUNC   0xF11D

Set the STRCMP function used to sort items.

An application sends a TVM_SETSTRCMPFUNC message to set a new STRCMP function to sort items in the TreeView control.

Note that you should send this message before adding any item to the TreeView control.

static int my_strcmp (const char* s1, const char* s2, size_t n)
{
...
return 0;
}
wParam = 0;
lParam = (LPARAM) my_strcmp;
Parameters
my_strcmpYour own function to compare two strings.
Returns
One of the following values:
  • 0
    Success
  • -1
    Not an empty TreeView control

Definition at line 469 of file treeview.h.

TVM_DELTREE
#define TVM_DELTREE
Removes an item and its descendant items for the treeview control.
Definition: treeview.h:239
WPARAM
UINT_PTR WPARAM
A type definition for the first message paramter.
Definition: common.h:706
TVM_GETITEMTEXT
#define TVM_GETITEMTEXT
Retrives the text of the specified item in TreeView control.
Definition: treeview.h:357
GHANDLE
PVOID GHANDLE
General handle.
Definition: common.h:402
TVM_GETROOT
#define TVM_GETROOT
Get the root item of a treeview control.
Definition: treeview.h:223
TVM_SETSELITEM
#define TVM_SETSELITEM
Set the selected item.
Definition: treeview.h:317
_TVITEMINFO
Definition: treeview.h:103
TVM_FINDCHILD
#define TVM_FINDCHILD
Finds a child item matching a specified string in children of a specific item.
Definition: treeview.h:284
TVM_SEARCHITEM
#define TVM_SEARCHITEM
Searches an item matching a specified string in a subtree rooted by a specific item.
Definition: treeview.h:263
TVM_ADDITEM
#define TVM_ADDITEM
Adds a new item in a treeview control.
Definition: treeview.h:202
TVM_SETSTRCMPFUNC
#define TVM_SETSTRCMPFUNC
Set the STRCMP function used to sort items.
Definition: treeview.h:469
TVM_GETSELITEM
#define TVM_GETSELITEM
Get the selected item.
Definition: treeview.h:299
TVM_GETRELATEDITEM
#define TVM_GETRELATEDITEM
Retrives related item of specific item.
Definition: treeview.h:438
LPARAM
UINT_PTR LPARAM
A type definition for the second message paramter.
Definition: common.h:712
TVM_GETITEMTEXTLEN
#define TVM_GETITEMTEXTLEN
Retrives the text length of the specified item in TreeView control.
Definition: treeview.h:336
TVM_GETITEMINFO
#define TVM_GETITEMINFO
Retrives the information of an item in TreeView control.
Definition: treeview.h:382