Difference between revisions of "Talk:CudaText API"

From Lazarus wiki
Jump to navigationJump to search
Line 2: Line 2:
 
=tree_proc to-do=
 
=tree_proc to-do=
  
  tree_proc(id_tree, id_action, id_item, index, text, image_index)
+
  tree_proc(id_tree, id_action, id_item=0, index=0, text='', image_index=-1)
  
 
Controls treeview-control.  
 
Controls treeview-control.  

Revision as of 14:18, 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.

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.
  • TREE_ITEM_DELETE: Deletes item (with all subitems). Param id_item.
  • TREE_ITEM_SET_NAME: Sets new item name. Params: id_item, text.
  • TREE_ITEM_SET_ICON: Sets new item icon. Params: id_item, image_index.
  • TREE_ICON_ADD: Adds icon to icon list. Param text: path to 16x16 png 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.