Difference between revisions of "Talk:CudaText API"

From Free Pascal wiki
Jump to navigationJump to search
Line 7: Line 7:
  
 
* Param id_tree is int handle of treeview.  
 
* Param id_tree is int handle of treeview.  
* Param id_item is int handle of treeview item. Can be 0 for invisible root-item, e.g. you can remove all using root-item.
+
* Param id_item is int handle of treeview item. Can be 0 for invisible root-item, e.g. you can remove all using root-item, enumerate root level using root-item.
  
 
Possible values of id_action:
 
Possible values of id_action:

Revision as of 15:50, 24 January 2016

tree_proc to-do

tree_proc(id_tree, id_action, id_item=0, index=0, text="", image_index=-1)

Controls treeview-control.

  • Param id_tree is int handle of treeview.
  • Param id_item is int handle of treeview item. Can be 0 for invisible root-item, e.g. you can remove all using root-item, enumerate root level using root-item.

Possible values of id_action:

  • TREE_ITEM_ENUM: Gets list of subitems of item, or None. Param id_item. Gets list of 2-tuples: (int_handle, str_caption).
  • TREE_ITEM_ADD: Adds subitem as item's child. Param id_item. Param index: at which subitem index to insert (0..child_count-1), or -1 to append. Param text: caption of item. Param image_index: index in tree's icon list or -1 to not show icon. Gets int handle of subitem.
  • TREE_ITEM_DELETE: Deletes item (with all subitems). Param id_item.
  • TREE_ITEM_SET_TEXT: Sets item's text. Params: id_item, text.
  • TREE_ITEM_SET_ICON: Sets item's icon. Params: id_item, image_index.
  • TREE_ICON_ADD: Adds icon to icon list. Param text: path to 16x16 bmp file. Gets icon index or -1 if cannot add.
  • TREE_ICON_DELETE: Deletes icon from icon list (note: icons after this index will shift, will have less index). Param image_index. Gets bool: index existed before.