<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: JSL Layout Alignment in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/JSL-Layout-Alignment/m-p/415257#M66443</link>
    <description>&lt;P&gt;Without giving it any size, I feel like the border box borders disappear, but this can be handled most likely fairly easily with padding&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names default to here(1);
nw = New Window("Example",
	bp = Border Box(Left(10), Right(10), Top(10), Bottom(10), Sides(15),
	&amp;lt;&amp;lt; Padding(Left(5), Top(0), Right(5), Bottom(5)),
		vlb = V List Box(
			Spacer Box(size(1200,0)),
			H List Box(
				V List Box(TextBox("test"), TextBox("test2")),
				sb = Spacer Box(),
				logo = Icon Box("JMPLogo")
			)
		)
	)
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 03 Sep 2021 14:49:08 GMT</pubDate>
    <dc:creator>jthi</dc:creator>
    <dc:date>2021-09-03T14:49:08Z</dc:date>
    <item>
      <title>JSL Layout Alignment</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-Layout-Alignment/m-p/415168#M66430</link>
      <description>&lt;P&gt;Is there was way to align an item to either the LHS or RHS of a HListBox.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Basically I want to make a template for Applications with a 'V List Box' Nested inside a 'H List Box'&amp;nbsp;&lt;/P&gt;&lt;P&gt;The VListBox (Red Text) Defaults to align to the Left side. If I add my logo it will naturally align to the left side also as shown.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="thickey_1-1630671476472.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/35521iB49A67A0D0F4ADB7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="thickey_1-1630671476472.png" alt="thickey_1-1630671476472.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, I want the logo to Align to the RHS within the Parent HLISTBOX.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="thickey_0-1630671310850.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/35520iB25726C84AD4BDE1/image-size/medium?v=v2&amp;amp;px=400" role="button" title="thickey_0-1630671310850.png" alt="thickey_0-1630671310850.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Note, to maintain the Application Width I am using a &lt;EM&gt;SpacerBox(size(1200, 0))&lt;/EM&gt; right above the HListBox.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cheers, Troy&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2023 19:55:54 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-Layout-Alignment/m-p/415168#M66430</guid>
      <dc:creator>thickey</dc:creator>
      <dc:date>2023-06-09T19:55:54Z</dc:date>
    </item>
    <item>
      <title>Re: JSL Layout Alignment</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-Layout-Alignment/m-p/415190#M66433</link>
      <description>&lt;P&gt;I think I did something similar inspired by your presentation &lt;A href="https://community.jmp.com/t5/Discovery-Summit-Europe-2019/A-Structured-Approach-to-Programming-With-JSL-for-Building-Real/ta-p/110075" target="_blank" rel="noopener"&gt;A Structured Approach to Programming With JSL for Building Real World, Scalable Applications ( 2019-EU-30MP-098 )&lt;/A&gt;&amp;nbsp; and in the end I did resort into using spacer box and updating the size of it based on logo width:&lt;CODE class=" language-jsl"&gt;&lt;/CODE&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);
New Window("Example",
	Border Box(Left(10), Right(10), Top(10), Bottom(10), Sides(15),
		vlb = V List Box(
			Spacer Box(size(1200,0)),
			H List Box(
				V List Box(TextBox("test"), TextBox("test2")),
				sb = Spacer Box(Size(0,0)),
				logo = Icon Box("JMPLogo")
			);
		)
	)
);
nw = New Window("Example",
	Border Box(Left(10), Right(10), Top(10), Bottom(10), Sides(15),
		vlb = V List Box(
			Spacer Box(size(1200,0)),
			H List Box(
				V List Box(TextBox("test"), TextBox("test2")),
				sb = Spacer Box(Size(0,0)),
				logo = Icon Box("JMPLogo")
			);
		)
	)
);
borderBoxoffset = 24;
sb &amp;lt;&amp;lt; Set Size(1200-borderBoxoffset-(logo &amp;lt;&amp;lt; get size)[1],0);
Show(nw &amp;lt;&amp;lt; get width());

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;CODE class=" language-jsl"&gt;&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Sep 2021 13:04:35 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-Layout-Alignment/m-p/415190#M66433</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2021-09-03T13:04:35Z</dc:date>
    </item>
    <item>
      <title>Re: JSL Layout Alignment</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-Layout-Alignment/m-p/415240#M66440</link>
      <description>&lt;P&gt;If you just don't give a size to spacerbox, you don't have to resize it.&amp;nbsp; It just tries to fill as much space as it can.&amp;nbsp; With multiple spacerboxes in the same parent, I think it just splits it evenly.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names default to here(1);
nw = New Window("Example",
	Border Box(Left(10), Right(10), Top(10), Bottom(10), Sides(15),
		vlb = V List Box(
			Spacer Box(size(1200,0)),
			H List Box(
				V List Box(TextBox("test"), TextBox("test2")),
				sb = Spacer Box(),
				logo = Icon Box("JMPLogo")
			);
		)
	)
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Sep 2021 14:38:30 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-Layout-Alignment/m-p/415240#M66440</guid>
      <dc:creator>vince_faller</dc:creator>
      <dc:date>2021-09-03T14:38:30Z</dc:date>
    </item>
    <item>
      <title>Re: JSL Layout Alignment</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-Layout-Alignment/m-p/415257#M66443</link>
      <description>&lt;P&gt;Without giving it any size, I feel like the border box borders disappear, but this can be handled most likely fairly easily with padding&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names default to here(1);
nw = New Window("Example",
	bp = Border Box(Left(10), Right(10), Top(10), Bottom(10), Sides(15),
	&amp;lt;&amp;lt; Padding(Left(5), Top(0), Right(5), Bottom(5)),
		vlb = V List Box(
			Spacer Box(size(1200,0)),
			H List Box(
				V List Box(TextBox("test"), TextBox("test2")),
				sb = Spacer Box(),
				logo = Icon Box("JMPLogo")
			)
		)
	)
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 03 Sep 2021 14:49:08 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-Layout-Alignment/m-p/415257#M66443</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2021-09-03T14:49:08Z</dc:date>
    </item>
    <item>
      <title>Re: JSL Layout Alignment</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-Layout-Alignment/m-p/416289#M66554</link>
      <description>&lt;P&gt;Hi Jarmo, I tried calculating the spacerbox size also. However, given the Title Width can change ('Boilerplate Template' in this case) I need to take that into account. This involves knowing the number of characters in the title name as well as the font size and figuring out the width. I use a general Height to Width Ratio of .6 or 0.7 and it generally pushes the logo sufficiently to the right....but not 'cleanly' and consistently to the same spot and not 'Right' Aligned&lt;/P&gt;&lt;P&gt;It is however, good enough for a range of Title Widths.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was hoping for a simpler set of 'Alignment' Options similar to those that exist in say CSS.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'll also try Vince's Suggestion of using 'Valueless' Spacer Boxes to see how this works.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the replies folks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;myToolWidth = 800;
myFontScale = 0.7;
myHeading1 = textBox(myScriptName, &amp;lt;&amp;lt; fontColor("red"), &amp;lt;&amp;lt; setFontSize(24), &amp;lt;&amp;lt; setFontStyle("bold"), &amp;lt;&amp;lt;setWrap(myToolWidth));
myHeading1Width = length(myHeading1 &amp;lt;&amp;lt; getText) * (myHeading1 &amp;lt;&amp;lt; getFontSize) * myFontScale;

spacerBox(size((myToolWidth - (myHeading1Width + myLogoWidth)), 0)))&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Examples of various Title Widths and Calculating the Sacerbox based on Font Size and Number of Characters in Title.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="thickey_0-1631098845815.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/35573i3A3BB8B279DEBAF7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="thickey_0-1631098845815.png" alt="thickey_0-1631098845815.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Sep 2021 11:04:39 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-Layout-Alignment/m-p/416289#M66554</guid>
      <dc:creator>thickey</dc:creator>
      <dc:date>2021-09-08T11:04:39Z</dc:date>
    </item>
    <item>
      <title>Re: JSL Layout Alignment</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-Layout-Alignment/m-p/416290#M66555</link>
      <description>&lt;P&gt;Awesome Vince. This worked perfect for all Title Widths.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Sep 2021 11:08:34 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-Layout-Alignment/m-p/416290#M66555</guid>
      <dc:creator>thickey</dc:creator>
      <dc:date>2021-09-08T11:08:34Z</dc:date>
    </item>
  </channel>
</rss>

