<?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[Styling BitmapButtons]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">I'm hoping to add some <a href="https://developers.maxon.net/docs/py/2023_2/modules/c4d.gui/BaseCustomGui/BitmapButtonCustomGui/index.html#" target="_blank" rel="noopener noreferrer nofollow ugc">Bitmap Buttons</a> to a project I'm working on, but I'm having difficulty styling them (and initially: <a href="https://developers.maxon.net/forum/topic/11462/understanding-setcommanddragid/2" target="_blank" rel="noopener noreferrer nofollow ugc">creating them</a>).</p>
<pre><code class="language-python">    def AddIconButton(self, button_id, title, icon_id, tooltip, border=c4d.BORDER_ROUND):
        """
        Reference: https://developers.maxon.net/forum/topic/11462/understanding-setcommanddragid/2
        """

        bc = c4d.BaseContainer()
        bc.SetBool(c4d.BITMAPBUTTON_BUTTON, True)
        bc.SetInt32(c4d.BITMAPBUTTON_ICONID1, icon_id)
        bc.SetInt32(c4d.BITMAPBUTTON_OUTBORDER, border)
        bc.SetString(c4d.BITMAPBUTTON_TOOLTIP, tooltip)
        bc.SetString(c4d.BITMAPBUTTON_STRING, title)
        icon_width_height = 24
        bc.SetInt32(c4d.BITMAPBUTTON_FORCE_SIZE, icon_width_height)
        button = self.AddCustomGui(button_id, c4d.CUSTOMGUI_BITMAPBUTTON, title, c4d.BFH_LEFT, 0, 0, bc)

        return button
</code></pre>
<p dir="auto">A lot of the styling flags seem to have no impact. Specifically:</p>
<ul>
<li><code>BITMAPBUTTON_BORDER</code></li>
<li><code>BITMAPBUTTON_STRING</code></li>
</ul>
<p dir="auto">I created some simple test code to show each of the styles and the buttons looked identical:</p>
<pre><code class="language-python">
        bitmapbutton_border_styles = [("BORDER_NONE", c4d.BORDER_NONE),
        ("BORDER_THIN_IN", c4d.BORDER_THIN_IN),
        ("BORDER_THIN_OUT", c4d.BORDER_THIN_OUT),
        ("BORDER_IN", c4d.BORDER_IN),
        ("BORDER_OUT", c4d.BORDER_OUT),
        ("BORDER_GROUP_IN", c4d.BORDER_GROUP_IN),
        ("BORDER_GROUP_OUT", c4d.BORDER_GROUP_OUT),
        ("BORDER_OUT2", c4d.BORDER_OUT2),
        ("BORDER_OUT3", c4d.BORDER_OUT3),
        ("BORDER_BLACK", c4d.BORDER_BLACK),
        ("BORDER_ACTIVE_1", c4d.BORDER_ACTIVE_1),
        ("BORDER_ACTIVE_2", c4d.BORDER_ACTIVE_2),
        ("BORDER_ACTIVE_3", c4d.BORDER_ACTIVE_3),
        ("BORDER_ACTIVE_4", c4d.BORDER_ACTIVE_4),
        ("BORDER_GROUP_TOP", c4d.BORDER_GROUP_TOP),
        ("BORDER_ROUND", c4d.BORDER_ROUND),
        ("BORDER_SCHEME_EDIT", c4d.BORDER_SCHEME_EDIT),
        ("BORDER_SCHEME_EDIT_NUMERIC", c4d.BORDER_SCHEME_EDIT_NUMERIC),
        ("BORDER_OUT3l", c4d.BORDER_OUT3l),
        ("BORDER_OUT3r", c4d.BORDER_OUT3r),
        ("BORDER_THIN_INb", c4d.BORDER_THIN_INb),
        ("BORDER_MASK", c4d.BORDER_MASK),
        ("BORDER_TEXT_DOTTED", c4d.BORDER_TEXT_DOTTED),
        ("BORDER_WITH_TITLE_MONO", c4d.BORDER_WITH_TITLE_MONO),
        ("BORDER_WITH_TITLE_BOLD", c4d.BORDER_WITH_TITLE_BOLD),
        ("BORDER_WITH_TITLE", c4d.BORDER_WITH_TITLE)]

        for border_id_name, border_id in bitmapbutton_border_styles:
            self.AddIconButton(0, border_id_name, ICON_NEW_PROJECT, border_id_name, border=border_id)
</code></pre>
<p dir="auto">Ideally, I'd love a button that matches the look/feel of docked icons w/ text:<br />
<img src="https://developers.maxon.net/forum/assets/uploads/files/1569022533712-69f1aaa2-626f-4699-9e3e-ef2e4290bff1-image.png" alt="69f1aaa2-626f-4699-9e3e-ef2e4290bff1-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">Any suggestions?</p>
<p dir="auto">Also, FWIW, some sample code for how to add BitmapButtons inside of the BitmapButton class would be really helpful. I struggled for quite a while trying to create a button using <code>c4d.gui.BitmapButtonCustomGui()</code> but was stumped when I couldn't figure out how to add it to a dialog.<br />
Thank you,</p>
<p dir="auto">Donovan</p>
]]></description><link>http://developers.maxon.net/forum/topic/11818/styling-bitmapbuttons</link><generator>RSS for Node</generator><lastBuildDate>Thu, 12 Nov 2026 07:00:27 GMT</lastBuildDate><atom:link href="http://developers.maxon.net/forum/topic/11818.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 20 Sep 2019 23:38:38 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Styling BitmapButtons on Wed, 04 Dec 2019 13:27:02 GMT]]></title><description><![CDATA[<p dir="auto">Hi, this is fixed in R21.1 SP1.</p>
<p dir="auto">Cheers,<br />
Maxime.</p>
]]></description><link>http://developers.maxon.net/forum/post/60547</link><guid isPermaLink="true">http://developers.maxon.net/forum/post/60547</guid><dc:creator><![CDATA[m_adam]]></dc:creator><pubDate>Wed, 04 Dec 2019 13:27:02 GMT</pubDate></item><item><title><![CDATA[Reply to Styling BitmapButtons on Fri, 04 Oct 2019 09:03:58 GMT]]></title><description><![CDATA[<p dir="auto">Hi sorry to not replied earlier.<br />
BITMAPBUTTON_STRING works fine, but if BITMAPBUTTON_FORCE_SIZE is defined to a very small size, then the string will be hidden (since you force to clip the size of the button).</p>
<p dir="auto">BITMAPBUTTON_OUTBORDER didn't work at all and BITMAPBUTTON_BORDER partially works (only one border supported).</p>
<p dir="auto">So I've reported the issue. I will bump the topic when the issue will be fixed.</p>
<p dir="auto">Thanks a lot for reporting.</p>
<p dir="auto">Cheers,<br />
Maxime.</p>
]]></description><link>http://developers.maxon.net/forum/post/59764</link><guid isPermaLink="true">http://developers.maxon.net/forum/post/59764</guid><dc:creator><![CDATA[m_adam]]></dc:creator><pubDate>Fri, 04 Oct 2019 09:03:58 GMT</pubDate></item><item><title><![CDATA[Reply to Styling BitmapButtons on Mon, 23 Sep 2019 18:57:05 GMT]]></title><description><![CDATA[<p dir="auto">@zipit said in <a href="https://developers.maxon.net/forum/post/59516" target="_blank" rel="noopener noreferrer nofollow ugc">Styling BitmapButtons</a>:</p>
<blockquote>
<p dir="auto">While I cannot say much about your problem, here are some bits that you might (or might not) find useful.</p>
</blockquote>
<p dir="auto">Thank you for taking the time to respond!</p>
<blockquote>
<ol>
<li>Have you tried / is it possible for your task to define your dialog resource as a file system rather than by code?</li>
</ol>
</blockquote>
<p dir="auto">My interface includes a large list of dynamic elements. I'm not sure that I'll be able to give each a unique ID unless I create them with code. But I'll see if I can restructure at least some of this.</p>
<blockquote>
<p dir="auto">Although I cannot find the exact passage right now, it says somewhere in the docs, that you should use files, since it is the only way to get all features, except for menus, which are only constructable by code.</p>
</blockquote>
<p dir="auto">Gotcha. Good to know. The docs have really improved, but there's lots of little tidbits like this that you'll only see if you read every page of every parent class rather than seeing all of the relevant info in the method definition.</p>
<blockquote>
<ol start="3">
<li>I came to the (unconfirmed) conclusion, that some of the more exotic <code>CustomGui</code> data types are apparently not fully supported for dialog resources (the same definition for a <code>SPLINE</code> gadget worked just fine in a description resource) and wrote my own little thing.</li>
</ol>
</blockquote>
<p dir="auto">Ah. That makes sense as well. I think for now I'll live with the stylistic limitations of the current BitmapButton as it's easier than writing my own.<br />
Thanks!</p>
<p dir="auto">Donovan</p>
]]></description><link>http://developers.maxon.net/forum/post/59567</link><guid isPermaLink="true">http://developers.maxon.net/forum/post/59567</guid><dc:creator><![CDATA[dskeithbuck]]></dc:creator><pubDate>Mon, 23 Sep 2019 18:57:05 GMT</pubDate></item><item><title><![CDATA[Reply to Styling BitmapButtons on Sat, 21 Sep 2019 08:36:20 GMT]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<blockquote>
<p dir="auto">Any suggestions?</p>
</blockquote>
<p dir="auto">While I cannot say much about your problem, here are some bits that you might (or might not) find useful.</p>
<ol>
<li>Have you tried / is it possible for your task to define your dialog resource as a file system rather than by code?</li>
<li>Because I did encounter a similar problem a while ago with the <code>SPLINE</code> gadget type, which refused to register its flags to show its embedded interface for numerical inputs in a dialog ressource. But I came from the other direction. I had my resource defined on disk and then did some tests in code; just to find out, that even more things were not working there.<br />
Although I cannot find the exact passage right now, it says somewhere in the docs, that you should use files, since it is the only way to get all features, except for menus, which are only constructable by code.</li>
<li>I came to the (unconfirmed) conclusion, that some of the more exotic <code>CustomGui</code> data types are apparently not fully supported for dialog resources (the same definition for a <code>SPLINE</code> gadget worked just fine in a description resource) and wrote my own little thing.</li>
</ol>
<p dir="auto">Cheers<br />
zipit</p>
]]></description><link>http://developers.maxon.net/forum/post/59516</link><guid isPermaLink="true">http://developers.maxon.net/forum/post/59516</guid><dc:creator><![CDATA[ferdinand]]></dc:creator><pubDate>Sat, 21 Sep 2019 08:36:20 GMT</pubDate></item></channel></rss>