mirror of
https://github.com/Immediate-Mode-UI/Nuklear.git
synced 2026-11-30 16:48:10 +01:00
175 lines
10 KiB
HTML
175 lines
10 KiB
HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
|
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
|
|
<meta name="generator" content="Doxygen 1.15.0"/>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
|
<title>Nuklear: Tree</title>
|
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
|
<script type="text/javascript" src="jquery.js"></script>
|
|
<script type="text/javascript" src="dynsections.js"></script>
|
|
<script type="text/javascript" src="clipboard.js"></script>
|
|
<link href="navtree.css" rel="stylesheet" type="text/css"/>
|
|
<script type="text/javascript" src="navtreedata.js"></script>
|
|
<script type="text/javascript" src="navtree.js"></script>
|
|
<script type="text/javascript" src="cookie.js"></script>
|
|
<link href="search/search.css" rel="stylesheet" type="text/css"/>
|
|
<script type="text/javascript" src="search/searchdata.js"></script>
|
|
<script type="text/javascript" src="search/search.js"></script>
|
|
<script type="text/javascript">
|
|
$(function() { init_search(); });
|
|
</script>
|
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
|
<link href="doxygen-awesome.css" rel="stylesheet" type="text/css"/>
|
|
</head>
|
|
<body>
|
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
|
<div id="titlearea">
|
|
<table cellspacing="0" cellpadding="0">
|
|
<tbody>
|
|
<tr id="projectrow">
|
|
<td id="projectalign">
|
|
<div id="projectname">Nuklear
|
|
</div>
|
|
<div id="projectbrief">Minimal-state, immediate-mode graphical user interface toolkit written in ANSI C.</div>
|
|
</td>
|
|
<td> <div id="MSearchBox" class="MSearchBoxInactive">
|
|
<span class="left">
|
|
<span id="MSearchSelect" class="search-icon" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()"><span class="search-icon-dropdown"></span></span>
|
|
<input type="text" id="MSearchField" value="" placeholder="Search" accesskey="S"
|
|
onfocus="searchBox.OnSearchFieldFocus(true)"
|
|
onblur="searchBox.OnSearchFieldFocus(false)"
|
|
onkeyup="searchBox.OnSearchFieldChange(event)"/>
|
|
</span><span class="right">
|
|
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><div id="MSearchCloseImg" class="close-icon"></div></a>
|
|
</span>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<!-- end header part -->
|
|
<!-- Generated by Doxygen 1.15.0 -->
|
|
<script type="text/javascript">
|
|
var searchBox = new SearchBox("searchBox", "search/",'.html');
|
|
</script>
|
|
<script type="text/javascript">
|
|
$(function() { codefold.init(); });
|
|
</script>
|
|
</div><!-- top -->
|
|
<div id="side-nav" class="ui-resizable side-nav-resizable">
|
|
<div id="nav-tree">
|
|
<div id="nav-tree-contents">
|
|
<div id="nav-sync" class="sync"></div>
|
|
</div>
|
|
</div>
|
|
<div id="splitbar" style="-moz-user-select:none;"
|
|
class="ui-resizable-handle">
|
|
</div>
|
|
</div>
|
|
<script type="text/javascript">
|
|
$(function(){initNavTree('Tree.html','',''); });
|
|
</script>
|
|
<div id="container">
|
|
<div id="doc-content">
|
|
<!-- window showing the filter options -->
|
|
<div id="MSearchSelectWindow"
|
|
onmouseover="return searchBox.OnSearchSelectShow()"
|
|
onmouseout="return searchBox.OnSearchSelectHide()"
|
|
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
|
</div>
|
|
|
|
<!-- iframe showing the search results (closed by default) -->
|
|
<div id="MSearchResultsWindow">
|
|
<div id="MSearchResults">
|
|
<div class="SRPage">
|
|
<div id="SRIndex">
|
|
<div id="SRResults"></div>
|
|
<div class="SRStatus" id="Loading">Loading...</div>
|
|
<div class="SRStatus" id="Searching">Searching...</div>
|
|
<div class="SRStatus" id="NoMatches">No Matches</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div><div class="header">
|
|
<div class="headertitle"><div class="title">Tree </div></div>
|
|
</div><!--header-->
|
|
<div class="contents">
|
|
<div class="textblock"><p>Trees represent two different concept.</p>
|
|
<p>First the concept of a collapsible UI section that can be either in a hidden or visible state. They allow the UI user to selectively minimize the current set of visible UI to comprehend. The second concept are tree widgets for visual UI representation of trees.<br />
|
|
<br />
|
|
</p>
|
|
<p>Trees thereby can be nested for tree representations and multiple nested collapsible UI sections. All trees are started by calling of the <span class="tt">nk_tree_xxx_push_tree</span> functions and ended by calling one of the <span class="tt">nk_tree_xxx_pop_xxx()</span> functions. Each starting functions takes a title label and optionally an image to be displayed and the initial collapse state from the nk_collapse_states section.<br />
|
|
<br />
|
|
</p>
|
|
<p>The runtime state of the tree is either stored outside the library by the caller or inside which requires a unique ID. The unique ID can either be generated automatically from <span class="tt">__FILE__</span> and <span class="tt">__LINE__</span> with function <span class="tt">nk_tree_push</span>, by <span class="tt">__FILE__</span> and a user provided ID generated for example by loop index with function <span class="tt">nk_tree_push_id</span> or completely provided from outside by user with function <span class="tt">nk_tree_push_hashed</span>.</p>
|
|
<h1 class="doxsection"><a class="anchor" id="autotoc_md87"></a>
|
|
Usage</h1>
|
|
<p>To create a tree you have to call one of the seven <span class="tt">nk_tree_xxx_push_xxx</span> functions to start a collapsible UI section and <span class="tt">nk_tree_xxx_pop</span> to mark the end. Each starting function will either return <span class="tt">false(0)</span> if the tree is collapsed or hidden and therefore does not need to be filled with content or <span class="tt">true(1)</span> if visible and required to be filled.</p>
|
|
<dl class="section note"><dt>Note</dt><dd>The tree header does not require and layouting function and instead calculates a auto height based on the currently used font size</dd></dl>
|
|
<p>The tree ending functions only need to be called if the tree content is actually visible. So make sure the tree push function is guarded by <span class="tt">if</span> and the pop call is only taken if the tree is visible.</p>
|
|
<div class="fragment"><div class="line"><span class="keywordflow">if</span> (nk_tree_push(ctx, NK_TREE_TAB, <span class="stringliteral">"Tree"</span>, NK_MINIMIZED)) {</div>
|
|
<div class="line"> nk_layout_row_dynamic(...);</div>
|
|
<div class="line"> nk_widget(...);</div>
|
|
<div class="line"> nk_tree_pop(ctx);</div>
|
|
<div class="line">}</div>
|
|
</div><!-- fragment --><h1 class="doxsection"><a class="anchor" id="autotoc_md88"></a>
|
|
Reference</h1>
|
|
<table class="markdownTable">
|
|
<tr class="markdownTableHead">
|
|
<th class="markdownTableHeadNone">Function </th><th class="markdownTableHeadNone">Description </th></tr>
|
|
<tr class="markdownTableRowOdd">
|
|
<td class="markdownTableBodyNone">nk_tree_push </td><td class="markdownTableBodyNone">Start a collapsible UI section with internal state management </td></tr>
|
|
<tr class="markdownTableRowEven">
|
|
<td class="markdownTableBodyNone">nk_tree_push_id </td><td class="markdownTableBodyNone">Start a collapsible UI section with internal state management callable in a look </td></tr>
|
|
<tr class="markdownTableRowOdd">
|
|
<td class="markdownTableBodyNone">nk_tree_push_hashed </td><td class="markdownTableBodyNone">Start a collapsible UI section with internal state management with full control over internal unique ID use to store state </td></tr>
|
|
<tr class="markdownTableRowEven">
|
|
<td class="markdownTableBodyNone">nk_tree_image_push </td><td class="markdownTableBodyNone">Start a collapsible UI section with image and label header </td></tr>
|
|
<tr class="markdownTableRowOdd">
|
|
<td class="markdownTableBodyNone">nk_tree_image_push_id </td><td class="markdownTableBodyNone">Start a collapsible UI section with image and label header and internal state management callable in a look </td></tr>
|
|
<tr class="markdownTableRowEven">
|
|
<td class="markdownTableBodyNone">nk_tree_image_push_hashed </td><td class="markdownTableBodyNone">Start a collapsible UI section with image and label header and internal state management with full control over internal unique ID use to store state </td></tr>
|
|
<tr class="markdownTableRowOdd">
|
|
<td class="markdownTableBodyNone">nk_tree_pop </td><td class="markdownTableBodyNone">Ends a collapsible UI section </td></tr>
|
|
<tr class="markdownTableRowEven">
|
|
<td class="markdownTableBodyNone">nk_tree_state_push </td><td class="markdownTableBodyNone">Start a collapsible UI section with external state management </td></tr>
|
|
<tr class="markdownTableRowOdd">
|
|
<td class="markdownTableBodyNone">nk_tree_state_image_push </td><td class="markdownTableBodyNone">Start a collapsible UI section with image and label header and external state management </td></tr>
|
|
<tr class="markdownTableRowEven">
|
|
<td class="markdownTableBodyNone">nk_tree_state_pop </td><td class="markdownTableBodyNone">Ends a collapsible UI section </td></tr>
|
|
</table>
|
|
<h1 class="doxsection"><a class="anchor" id="autotoc_md89"></a>
|
|
nk_tree_type</h1>
|
|
<table class="markdownTable">
|
|
<tr class="markdownTableHead">
|
|
<th class="markdownTableHeadNone">Flag </th><th class="markdownTableHeadNone">Description </th></tr>
|
|
<tr class="markdownTableRowOdd">
|
|
<td class="markdownTableBodyNone">NK_TREE_NODE </td><td class="markdownTableBodyNone">Highlighted tree header to mark a collapsible UI section </td></tr>
|
|
<tr class="markdownTableRowEven">
|
|
<td class="markdownTableBodyNone">NK_TREE_TAB </td><td class="markdownTableBodyNone">Non-highlighted tree header closer to tree representations </td></tr>
|
|
</table>
|
|
</div></div><!-- contents -->
|
|
</div><!-- PageDoc -->
|
|
</div><!-- doc-content -->
|
|
<div id="page-nav" class="page-nav-panel">
|
|
<div id="page-nav-resize-handle"></div>
|
|
<div id="page-nav-tree">
|
|
<div id="page-nav-contents">
|
|
</div><!-- page-nav-contents -->
|
|
</div><!-- page-nav-tree -->
|
|
</div><!-- page-nav -->
|
|
</div><!-- container -->
|
|
<!-- start footer part -->
|
|
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
|
<ul>
|
|
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.15.0 </li>
|
|
</ul>
|
|
</div>
|
|
</body>
|
|
</html>
|