Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / [nuclear-doc] About Trees

Author
Message
MadBit
VIP Member
Gold Codemaster
15
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 17th Oct 2020 06:27 Edited at: 17th Oct 2020 06:31
About Trees

In the normal case only 3 - 4 commands are needed to build a tree structure. The commands TreeElement...Push... have an additional value parameter to mark an element as selected.
These functions return 1 when this node is open and 0 when it is closed. If the return value is 1 then the content should be drawn. So it is recommended to include these commands in an if query. After the content has been drawn an open node must be closed with 'TreeStatePop'.

The original documentation about Trees can be found here.

Funktionsübersicht (Plugin - .DLL/.SO)
  • Integer TreePush(type as Integer, title as String, state as Integer)
  • Integer TreePushID(type as Integer, title as String ,state as Integer, id as Integer)
  • Integer TreePushHashed(type as Integer, title as String, state as Integer, hash as String, len as Integer, seed as Integer)
  • Integer TreeImagePush(type as Integer, image_slot as Integer, title as String, state as Integer)
  • Integer TreeImagePush(type as Integer, image_name as String, title as String, state as Integer)
  • Integer TreeImagePushID(type as Integer, image_slot as Integer, title as String, state as Integer, id as Integer)
  • Integer TreeImagePushID( type as Integer, image_name as String, title as String, state as Integer, id as Integer)
  • Integer TreeImagePushHashed(type as Integer, image_slot as Integer, title as String, state as Integer, hash as String, len as Integer, seed as Integer)
  • Integer TreeImagePushHashed(type as Integer, image_name as String, title as String, state as Integer, hash as String, len as Integer, seed as Integer)
  • Integer TreeStatePush(type as Integer, title as String, state as Integer)
  • Integer TreeStateImagePush(type as Integer, image_name as String, title as String, state as Integer)
  • TreeStatePop()
  • Integer TreeElementPushID(type as Integer, title as String, state as Integer, value as Integer, id as Integer)
  • Integer TreeElementPushHashed(type as Integer, title as String, state as Integer, value as Integer, hash as String, len as Integer, seed as Integer)
  • Integer TreeElementImagePushID(type as Integer, image_slot as Integer, title as String, state as Integer, value as Integer, id as Integer)
  • Integer TreeElementImagePushID(type as Integer, image_name as String, title as String, state as Integer, value as Integer, id as Integer)
  • Integer TreeElementImagePushHashed(type as Integer, image_slot as Integer, title as String, state as Integer, value as Integer, hash as String ,len as Integer, seed as Integer)
  • Integer TreeElementImagePushHashed(type as Integer, image_name as String, title as String, state as Integer, value as Integer, hash as String, len as Integer, seed as Integer)
  • Integer TreeGetLastElementValue()


Parameter (Plugin)
  • type
    A value either NK_TREE_NODE or NK_TREE_TAB. As a highlighted collapsible UI section (NK_TREE_TAB) or as a tree node (NK_TREE_NODE).
  • title
    Text in the tree header.
  • state
    Initial value of the tree state, either NK_MINIMIZED or NK_MAXIMIZED.
  • id
    Loop counter, if this function is called in a loop.
  • hash
    String to generate the ID.
  • len
    Size of the passed string in hash.
  • seed
    Seed, if this function is called in a loop. Otherwise it can be 0.
  • image_slot
    A previously created image slot.
  • image_name
    A previously created connection to an image.
  • value
    A value 0 or 1, whether the header is selected


In the example you can see that the tree nodes can also be used to create submenus for the menu bar.

Previous topic (About Menus) ———— Table of contents

Example:

Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)

Login to post a reply

Server time is: 2024-11-21 23:14:44
Your offset time is: 2024-11-21 23:14:44