MiniGUI API Reference (MiniGUI-Threads)  v3.2.0
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
 Gets 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
 Gets the selected item. More...
 
#define TVM_SETSELITEM   0xF117
 Sets 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
 Sets the STRCMP function used to sort items. More...
 

Detailed Description

Macro Definition Documentation

#define TVM_ADDITEM   0xF110

Adds a new item in a treeview control.

1 TVM_ADDITEM
2 GHANDLE parent;
3 PTVITEMINFO newIteminfo;
4 
5 wParam = (WPARAM)parent;
6 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 190 of file treeview.h.

#define TVM_DELTREE   0xF113

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

1 TVM_DELTREE
2 GHANDLE item;
3 
4 wParam = (WPARAM)item;
5 lParam = 0;
Returns
Zero on success, otherwise -1.

Definition at line 227 of file treeview.h.

#define TVM_FINDCHILD   0xF115

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

1 TVM_FINDCHILD
2 GHNADLE item;
3 char* string;
4 
5 wParam = (WPARAM)item;
6 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 272 of file treeview.h.

#define TVM_GETITEMINFO   0xF11A

Retrives the information of an item in TreeView control.

1 TVM_GETITEMINFO
2 
3 GHANDLE item;
4 TVITEMINFO* tvii;
5 
6 wParam = (WPARAM)item;
7 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 370 of file treeview.h.

#define TVM_GETITEMTEXT   0xF119

Retrives the text of the specified item in TreeView control.

1 TVM_GETITEMTEXT
2 
3 GHANDLE item;
4 char* buffer;
5 
6 wParam = (WPARAM)item;
7 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 345 of file treeview.h.

#define TVM_GETITEMTEXTLEN   0xF118

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

1 TVM_GETITEMTEXTLEN
2 
3 GHANDLE item;
4 
5 wParam = (WPARAM)item;
6 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 324 of file treeview.h.

#define TVM_GETRELATEDITEM   0xF11C

Retrives related item of specific item.

1 TVM_GETRELATEDITEM
2 int related;
3 GHANDLE item;
4 
5 wParam = (WPARAM)related;
6 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 426 of file treeview.h.

#define TVM_GETROOT   0xF112

Gets the root item of a treeview control.

1 TVM_GETROOT
2 
3 wParam = 0;
4 lParam = 0;
Returns
The handle to the root item.

Definition at line 211 of file treeview.h.

#define TVM_GETSELITEM   0xF116

Gets the selected item.

1 TVM_GETSELITEM
2 
3 wParam = 0;
4 lParam = 0;
Returns
Handle to the selected item.

Definition at line 287 of file treeview.h.

#define TVM_INSERTITEM   0xF111

The same as TVM_ADDITEM message.

Definition at line 196 of file treeview.h.

#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.
1 TVM_SEARCHITEM
2 GHNADLE item;
3 char* string;
4 
5 wParam = (WPARAM)item;
6 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 251 of file treeview.h.

#define TVM_SETITEMINFO   0xF11B

Changes the information of an item.

1 TVM_SETITEMTEXT
2 GHANDLE item;
3 TVITEMINFO* tvii;
4 
5 wParam = (WPARAM)id;
6 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 391 of file treeview.h.

#define TVM_SETSELITEM   0xF117

Sets the selected item.

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

Definition at line 305 of file treeview.h.

#define TVM_SETSTRCMPFUNC   0xF11D

Sets 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.

1 static int my_strcmp (const char* s1, const char* s2, size_t n)
2 {
3  ...
4  return 0;
5 }
6 
7 TVM_SETSTRCMPFUNC
8 
9 wParam = 0;
10 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 457 of file treeview.h.