<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[TreeView Menu]]></title><description><![CDATA[<p dir="auto">Hello,<br />
Is there a TreeView example to create a similar tree view menu like as the Cinema 4D help dialog?</p>
<p dir="auto"><img src="https://developers.maxon.net/forum/assets/uploads/files/1601660849129-tree_view.png" alt="tree_view.png" class=" img-fluid img-markdown" /><br />
Thanks.</p>
]]></description><link>http://developers.maxon.net/forum/topic/12920/treeview-menu</link><generator>RSS for Node</generator><lastBuildDate>Sat, 18 Jul 2026 21:27:22 GMT</lastBuildDate><atom:link href="http://developers.maxon.net/forum/topic/12920.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 02 Oct 2020 17:54:28 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to TreeView Menu on Mon, 04 Jan 2021 08:09:39 GMT]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">without further feedback, we will consider this thread as solved by Wednesday and flag it accordingly.</p>
<p dir="auto">Cheers,<br />
Ferdinand</p>
]]></description><link>http://developers.maxon.net/forum/post/65484</link><guid isPermaLink="true">http://developers.maxon.net/forum/post/65484</guid><dc:creator><![CDATA[ferdinand]]></dc:creator><pubDate>Mon, 04 Jan 2021 08:09:39 GMT</pubDate></item><item><title><![CDATA[Reply to TreeView Menu on Thu, 08 Oct 2020 12:45:51 GMT]]></title><description><![CDATA[<p dir="auto">Hi <a class="plugin-mentions-user plugin-mentions-a" href="/forum/user/mfersaoui">@<bdi>mfersaoui</bdi></a> sorry for the delay, I overlooked your reply.</p>
<p dir="auto">Regarding your initial question, I would say it was just a simple example without children in mind.<br />
But if you are interested you can find in <a href="https://developers.maxon.net/forum/topic/12123/insert-object-in-treeview/3" target="_blank" rel="noopener noreferrer nofollow ugc">Insert object in Treeview</a> an example that uses children or even in <a href="https://developers.maxon.net/forum/topic/12238/no-multiple-selection-in-treeview-not-working/6" target="_blank" rel="noopener noreferrer nofollow ugc">No multiple selection in Treeview not working?</a> where each entry can also be a root.</p>
<p dir="auto">In the end, how you structure your internal data is up to you I can't really judge what's the best for you. <img src="http://developers.maxon.net/forum/assets/plugins/nodebb-plugin-emoji/emoji/android/1f609.png?v=0b8ddba251d" class="not-responsive emoji emoji-android emoji--wink" style="height:23px;width:auto;vertical-align:middle" title=":wink:" alt="😉" /></p>
<p dir="auto">For your second point correct, or you can simply store a reference to your GeDialog in your treeview and use this reference to do the synchronization.</p>
<p dir="auto">Hope this helps and if you have a question, please let me know.<br />
Cheers,<br />
Maxie.</p>
]]></description><link>http://developers.maxon.net/forum/post/64601</link><guid isPermaLink="true">http://developers.maxon.net/forum/post/64601</guid><dc:creator><![CDATA[m_adam]]></dc:creator><pubDate>Thu, 08 Oct 2020 12:45:51 GMT</pubDate></item><item><title><![CDATA[Reply to TreeView Menu on Tue, 06 Oct 2020 15:53:10 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/forum/user/mfersaoui">@<bdi>mfersaoui</bdi></a> said in <a href="https://developers.maxon.net/forum/post/64576" target="_blank" rel="noopener noreferrer nofollow ugc">TreeView Menu</a>:</p>
<blockquote>
<p dir="auto">GroupBegin</p>
</blockquote>
<p dir="auto">For my second question I found this function to interact with the htmlViewer area.</p>
<pre><code>c4d.SpecialEventAdd(ACTION_ID)
</code></pre>
]]></description><link>http://developers.maxon.net/forum/post/64581</link><guid isPermaLink="true">http://developers.maxon.net/forum/post/64581</guid><dc:creator><![CDATA[mfersaoui]]></dc:creator><pubDate>Tue, 06 Oct 2020 15:53:10 GMT</pubDate></item><item><title><![CDATA[Reply to TreeView Menu on Tue, 06 Oct 2020 11:03:27 GMT]]></title><description><![CDATA[<p dir="auto">Hi <a class="plugin-mentions-user plugin-mentions-a" href="/forum/user/m_adam">@<bdi>m_adam</bdi></a> ,</p>
<p dir="auto">Thank you so much, I have two questions:</p>
<p dir="auto">The first is What the right way to rewriting the following code and obtain same result:</p>
<pre><code>class ListView(c4d.gui.TreeViewFunctions):

    def __init__(self):
        self.listOfTexture = list() # Store all objects we need to display in this list
</code></pre>
<pre><code>def CreateLayout(self):

    self.GroupBegin(0, c4d.BFH_SCALEFIT | c4d.BFV_SCALEFIT, 2, 0)
    self.GroupBorderSpace(5, 5, 5, 5)

    self.GroupBegin(0, flags=c4d.BFH_LEFT | c4d.BFV_SCALEFIT, cols=1, rows=1, initw=400, inith=0)

    # Create the TreeView GUI.
    customgui = c4d.BaseContainer()
    customgui.SetBool(c4d.TREEVIEW_BORDER, c4d.BORDER_THIN_IN)
    customgui.SetBool(c4d.TREEVIEW_HAS_HEADER, False) # True if the tree view may have a header line.
    customgui.SetBool(c4d.TREEVIEW_HIDE_LINES, False) # True if no lines should be drawn.
    customgui.SetBool(c4d.TREEVIEW_MOVE_COLUMN, True) # True if the user can move the columns.
    customgui.SetBool(c4d.TREEVIEW_RESIZE_HEADER, True) # True if the column width can be changed by the user.
    customgui.SetBool(c4d.TREEVIEW_FIXED_LAYOUT, True) # True if all lines have the same height.
    customgui.SetBool(c4d.TREEVIEW_ALTERNATE_BG, False) # Alternate background per line.
    customgui.SetBool(c4d.TREEVIEW_CURSORKEYS, True) # True if cursor keys should be processed.
    customgui.SetBool(c4d.TREEVIEW_NOENTERRENAME, False) # Suppresses the rename popup when the user presses enter.
    customgui.SetBool(c4d.TREEVIEW_NO_MULTISELECT, True)

    self._treegui = self.AddCustomGui( 1000, c4d.CUSTOMGUI_TREEVIEW, "", c4d.BFH_SCALEFIT | c4d.BFV_SCALEFIT, 0, 0, customgui)
    if not self._treegui:
        print "[ERROR]: Could not create TreeView"
        return False

    self.GroupEnd()

    self.GroupBegin(0, flags=c4d.BFH_SCALEFIT | c4d.BFV_SCALEFIT, cols=1, rows=1)
    html_file = "file.html"
    htmlViewer = self.AddCustomGui(1000001, c4d.CUSTOMGUI_HTMLVIEWER, "Viewer", c4d.BFH_SCALEFIT | c4d.BFV_SCALEFIT, 0, 0)
    htmlViewer.SetUrl(html_file, c4d.URL_ENCODING_UTF16)
    self.GroupEnd()

    return True
    
def InitValues(self):
    # Initialize the column layout for the TreeView.
    layout = c4d.BaseContainer()
    layout.SetLong(ID_NAME, c4d.LV_TREE)
    self._treegui.SetLayout(1, layout)

    mdata = {
        "Menu 01": {
            "Item 01": ["sub-item 01", "sub-item 02", "sub-item 03"],
            "Item 02": ["sub-item 01", "sub-item 02"],
            "Item 03": [],
            },
        "Menu 02": [],
        "Menu 03": ["sub-item 01", "sub-item 02"],
        "Menu 04": ["sub-item 01"]
    }
    res = []
    for m in m_data:
        m1 = TextureObject(m)
        res.append(m1)
        m1_items = m_data[m]
        if len(m1_items):
            for m1_name in m1_items:
                m1_item = TextureObject(m1_name)
                m1.AddChild(m1_item)
                if isinstance(m1_items, dict):
                    m2_items = m1_items[m1_name]
                    if len(m2_items):
                        for m2_name in m2_items:
                            m2_item = TextureObject(m2_name)
                            m1_item.AddChild(m2_item)

    self._listView.listOfTexture.extend(res)

    # Set TreeViewFunctions instance used by our CUSTOMGUI_TREEVIEW
    self._treegui.SetRoot(self._treegui, self._listView, None)

    return True
</code></pre>
<p dir="auto"><strong>Result:</strong><br />
<img src="https://developers.maxon.net/forum/assets/uploads/files/1601977649035-tree_view_menu.jpg" alt="tree_view_menu.jpg" class=" img-fluid img-markdown" /></p>
<p dir="auto">The second question is How to interact with the htmlViewer area at the right of dialog from the my TreeView menu (Changing the htmlViewer file when clicking on a menu items).</p>
<pre><code>def Select(self, root, userdata, obj, mode):
    """
    Called when the user selects an element.
    """
    if mode == c4d.SELECTION_NEW:
        html_file = "file.html"
        #TestDialog()
        for tex in TextureObjectIterator(self.listOfTexture):
            tex.Deselect()
        obj.Select()
</code></pre>
<p dir="auto">Thanks</p>
]]></description><link>http://developers.maxon.net/forum/post/64576</link><guid isPermaLink="true">http://developers.maxon.net/forum/post/64576</guid><dc:creator><![CDATA[mfersaoui]]></dc:creator><pubDate>Tue, 06 Oct 2020 11:03:27 GMT</pubDate></item><item><title><![CDATA[Reply to TreeView Menu on Mon, 05 Oct 2020 13:47:10 GMT]]></title><description><![CDATA[<p dir="auto">Hi <a class="plugin-mentions-user plugin-mentions-a" href="/forum/user/mfersaoui">@<bdi>mfersaoui</bdi></a> as a first introduction you can read <a href="https://developers.maxon.net/forum/topic/10654/14102_using-customgui-listview/2" target="_blank" rel="noopener noreferrer nofollow ugc">using customgui listview</a> then if you have more specific questions about treeview I would suggest to either search on plugincafe or directly ask the questions.</p>
<p dir="auto">Cheers,<br />
Maxime.</p>
]]></description><link>http://developers.maxon.net/forum/post/64565</link><guid isPermaLink="true">http://developers.maxon.net/forum/post/64565</guid><dc:creator><![CDATA[m_adam]]></dc:creator><pubDate>Mon, 05 Oct 2020 13:47:10 GMT</pubDate></item></channel></rss>