<?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[Right aligned button]]></title><description><![CDATA[<p dir="auto">Hi,<br />
I'd like to place one button at the right side of a row of the window, and the rest of the buttons to the left side of the same row.<br />
like this:</p>
<pre><code>__________________________________________
| b1 b2 b3 b4 .... bn-1                bn|
|                                        |
|                                        |
|                                        |
</code></pre>
<p dir="auto">I put the first n-1 buttons to a group, and the last button the another group, and I thought applying <strong>BFH_RIGHT</strong> flag to the right group and the last button could help me get the expected result, however, I found the  <em>button n</em>  is always right after  <em>button n-1</em>  instead of at the very right side of the row.<br />
The actual result is as below:</p>
<pre><code>__________________________________________
| b1 b2 b3 b4 .... bn-1  bn              |
|                                        |
|                                        |
|                                        |
</code></pre>
<p dir="auto">The code I used is similar to below:</p>
<pre><code>// parent group
GroupBegin(100, BFH_SCALEFIT, &lt;n&gt;, 0, ""_s, 0, 0, 0);

// group at the left side
GroupBegin(200,BFH_LEFT|BFV_FIT,&lt;n-1&gt;,0,""_s,0);
AddCustomGui(201, CUSTOMGUI_BITMAPBUTTON, "b1",  BFH_FIT|BFV_FIT, minw, 0,customdata);
AddCustomGui(201, CUSTOMGUI_BITMAPBUTTON, "b2",  BFH_FIT|BFV_FIT, minw, 0,customdata);
AddCustomGui(201, CUSTOMGUI_BITMAPBUTTON, "b3",  BFH_FIT|BFV_FIT, minw, 0,customdata);
AddCustomGui(201, CUSTOMGUI_BITMAPBUTTON, "b4",  BFH_FIT|BFV_FIT, minw, 0,customdata);
...
AddCustomGui(201, CUSTOMGUI_BITMAPBUTTON, "bn-1", BFH_FIT|BFV_FIT, minw, 0,customdata);
GroupEnd()

// group at the right side
GroupBegin(300, BFH_RIGHT | BFV_FIT, 1, 0, ""_s, 0);
AddCustomGui(201, CUSTOMGUI_BITMAPBUTTON, "bn", BFH_RIGHT|BFV_FIT, minw, 0,customdata);
GroupEnd()

GroupEnd()
</code></pre>
<p dir="auto">Could you please help me find out what's going wrong?<br />
Note: I need the last button always at the right side of the row after user resizes the window width.</p>
]]></description><link>http://developers.maxon.net/forum/topic/15653/right-aligned-button</link><generator>RSS for Node</generator><lastBuildDate>Mon, 09 Nov 2026 19:58:07 GMT</lastBuildDate><atom:link href="http://developers.maxon.net/forum/topic/15653.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 22 Aug 2024 05:46:33 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Right aligned button on Thu, 29 Aug 2024 07:34:40 GMT]]></title><description><![CDATA[<p dir="auto">This works! Thank you very much, @i_mazlov.</p>
]]></description><link>http://developers.maxon.net/forum/post/74848</link><guid isPermaLink="true">http://developers.maxon.net/forum/post/74848</guid><dc:creator><![CDATA[BruceC]]></dc:creator><pubDate>Thu, 29 Aug 2024 07:34:40 GMT</pubDate></item><item><title><![CDATA[Reply to Right aligned button on Tue, 27 Aug 2024 07:11:43 GMT]]></title><description><![CDATA[<p dir="auto">Hi <a class="plugin-mentions-user plugin-mentions-a" href="/forum/user/brucec">@<bdi>BruceC</bdi></a>,</p>
<p dir="auto">The layout options in our API can sometimes be a little counter-intuitive. However, in your scenario (assuming you're talking about normal window layout, not the toolbar scope), the solution would be in adding an empty static text, which scale-fits the empty space and pushes the last button to the right. For this you'd need to use BFH_SCALEFIT on the static text.</p>
<p dir="auto">Note: in this case you also need to use BFH_SCALEFIT on the parent group of the buttons.  Also note, that grouping left buttons (as well as right ones) is not necessary, but if you do so, you shouldn't use BFH_SCALEFIT there.</p>
<p dir="auto">It can look for example something like the code snippet below.</p>
<p dir="auto">Cheers,<br />
Ilia</p>
<p dir="auto">The C++ code snippet for layouting:</p>
<pre><code class="language-c++">// parent group
GroupBegin(100, BFH_SCALEFIT, 0, 1, ""_s, 0, 0, 0);

// group at the left side
GroupBegin(200, BFH_LEFT, 0, 1, ""_s, 0);
AddCustomGui(201, CUSTOMGUI_BITMAPBUTTON, "b1",  BFH_FIT | BFV_FIT, minw, 0, customdata);
AddCustomGui(202, CUSTOMGUI_BITMAPBUTTON, "b2",  BFH_FIT | BFV_FIT, minw, 0, customdata);
AddCustomGui(203, CUSTOMGUI_BITMAPBUTTON, "b3",  BFH_FIT | BFV_FIT, minw, 0, customdata);
AddCustomGui(204, CUSTOMGUI_BITMAPBUTTON, "b4",  BFH_FIT | BFV_FIT, minw, 0, customdata);
GroupEnd() // group left side

// add the hidden stretching static text
AddStaticText(0, BFH_SCALEFIT, 0, 0, ""_s, 0);

// group at the right side
GroupBegin(300, BFH_RIGHT | BFV_FIT, 0, 1, ""_s, 0);
AddCustomGui(301, CUSTOMGUI_BITMAPBUTTON, "bn", BFH_RIGHT | BFV_FIT, minw, 0, customdata);
GroupEnd() // group right side

GroupEnd() // parent group
</code></pre>
]]></description><link>http://developers.maxon.net/forum/post/74834</link><guid isPermaLink="true">http://developers.maxon.net/forum/post/74834</guid><dc:creator><![CDATA[i_mazlov]]></dc:creator><pubDate>Tue, 27 Aug 2024 07:11:43 GMT</pubDate></item></channel></rss>