<?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: Need help with scripting Panel Box in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Need-help-with-scripting-Panel-Box/m-p/474024#M71887</link>
    <description>&lt;P&gt;One other method is using Spacer Box() with size in one direction as 0, you can see it used here&amp;nbsp;&lt;LI-MESSAGE title="A Structured Approach to Programming With JSL for Building Real World, Scalable Applications ( 2019-EU-30MP-098 )" uid="110075" url="https://community.jmp.com/t5/Discovery-Summit-Europe-2019/A-Structured-Approach-to-Programming-With-JSL-for-Building-Real/m-p/110075#U110075" discussion_style_icon_css="lia-mention-container-editor-message lia-img-icon-tkb-thread lia-fa-icon lia-fa-tkb lia-fa-thread lia-fa"&gt;&lt;/LI-MESSAGE&gt;&amp;nbsp;. I think it was the section which starts at 22:00.&lt;/P&gt;
&lt;LI-SPOILER&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

notReadyTablesText = "Need to join tables";
readyTableText = "I have the table";
selectorOptions = Eval List({notReadyTablesText, readyTableText});

new window("",		
	Panel Box("Select tables",
		stVLB = V List Box(
			readyTablesSelector = Combo Box(
				selectorOptions,
				selector = readyTablesSelector &amp;lt;&amp;lt; Get Selected();
				Show(selector);
				If(
					selector == notReadyTablesText,
						notReadyTables &amp;lt;&amp;lt; Set(1);
						readyTables &amp;lt;&amp;lt; Set(0);,
					selector == readyTableText,
						notReadyTables &amp;lt;&amp;lt; Set(0);
						readyTables &amp;lt;&amp;lt; Set(1);
				)
			),
			H List Box(Spacer Box(Size(0,75)),
				notReadyTables = If Box(
					1,
					V List Box(
						Button Box("Table 1", t1Open),
						Button Box("Table 2", t2Open),
						join = Button Box("Join Tables",
							notImplemented;
						)
					)
				),
				readyTables = If Box(0, Button Box("Load Tables", loadTable))
			)
		)	
	)
)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;/LI-SPOILER&gt;</description>
    <pubDate>Tue, 29 Mar 2022 04:58:06 GMT</pubDate>
    <dc:creator>jthi</dc:creator>
    <dc:date>2022-03-29T04:58:06Z</dc:date>
    <item>
      <title>Need help with scripting Panel Box</title>
      <link>https://community.jmp.com/t5/Discussions/Need-help-with-scripting-Panel-Box/m-p/473955#M71876</link>
      <description>&lt;P&gt;I have a Panel Box with V List Box that has Combo box and two If Boxes with content of different size. Depending on Combo Box selection I show either smaller If Box or Bigger If Box.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;notReadyTablesText = "Need to join tables";
readyTableText = "I have the table";
selectorOptions = Eval List( {notReadyTablesText, readyTableText} );
					
Panel Box( "Select tables",
	stVLB = V List Box(
		readyTablesSelector = Combo Box(
			selectorOptions,
			selector = readyTablesSelector &amp;lt;&amp;lt; Get Selected();
			Show( selector );
			If(
				selector == notReadyTablesText,
					notReadyTables &amp;lt;&amp;lt; Set( 1 );
					readyTables &amp;lt;&amp;lt; Set( 0 );,
				selector == readyTableText,
					notReadyTables &amp;lt;&amp;lt; Set( 0 );
					readyTables &amp;lt;&amp;lt; Set( 1 );
			)
								
			;
		),
		notReadyTables = If Box(
			1,
			V List Box(
				Button Box( "Table 1", t1Open ),
				Button Box( "Table 2", t2Open ),
				join = Button Box( "Join Tables",
					notImplemented;
								
				)
			)
		),
		readyTables = If Box( 0, Button Box( "Load Tables", loadTable ) )
	)	
		
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I switch the combo box, the size of the Panel Box changes and everything that is below that Panel Box is jumping. How do I keep the same size of the Panel Box?&lt;/P&gt;&lt;P&gt;I tried Set Height, Set Auto Stretching, Set Min Size() etc.&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2023 18:14:40 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Need-help-with-scripting-Panel-Box/m-p/473955#M71876</guid>
      <dc:creator>miguello</dc:creator>
      <dc:date>2023-06-09T18:14:40Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with scripting Panel Box</title>
      <link>https://community.jmp.com/t5/Discussions/Need-help-with-scripting-Panel-Box/m-p/474012#M71880</link>
      <description>&lt;P&gt;It can be a little difficult to manually set &lt;CODE class=" language-jsl"&gt;Button Box()&lt;/CODE&gt; sizes (I usually use a &lt;CODE class=" language-jsl"&gt;H Splitter&amp;nbsp; Box()&lt;/CODE&gt; and &lt;CODE class=" language-jsl"&gt;Lineup Box()&lt;/CODE&gt; to have JMP auto-size everything), but the best method I've found is to send the message &lt;CODE class=" language-jsl"&gt;&amp;lt;&amp;lt;Set Min Size( width, 25 ) &amp;lt;&amp;lt; Set Max Size( width, 25 )&lt;/CODE&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;notReadyTablesText = "Need to join tables";
readyTableText = "I have the table";
selectorOptions = Eval List( {notReadyTablesText, readyTableText} );
					
pb = Panel Box( "Select tables",
	stVLB = V List Box(
		readyTablesSelector = Combo Box(
			selectorOptions,
			selector = readyTablesSelector &amp;lt;&amp;lt; Get Selected();
			Show( selector );
			If(
				selector == notReadyTablesText,
					notReadyTables &amp;lt;&amp;lt; Set( 1 );
					readyTables &amp;lt;&amp;lt; Set( 0 );,
				selector == readyTableText,
					notReadyTables &amp;lt;&amp;lt; Set( 0 );
					readyTables &amp;lt;&amp;lt; Set( 1 );
			)
								
			;
		),
		notReadyTables = If Box(
			1,
			V List Box(
				bb1 = Button Box( "Table 1", t1Open ),
				bb2 = Button Box( "Table 2", t2Open ),
				join = Button Box( "Join Tables",
					notImplemented;
								
				)
			)
		),
		readyTables = If Box( 1, bb3 = Button Box( "Load Tables (really long button name)", loadTable ) )
	)	
		
);

new window( "test",
	pb
);

boxes = {bb1, bb2, bb3, join};

max size =  Max( {readytables, notReadyTables} &amp;lt;&amp;lt; Get Width );
boxes &amp;lt;&amp;lt; Set Min Size( max size, 25 ) &amp;lt;&amp;lt; set Max Size( max size, 25 );
readyTables &amp;lt;&amp;lt; Set( 0 );&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 29 Mar 2022 02:29:23 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Need-help-with-scripting-Panel-Box/m-p/474012#M71880</guid>
      <dc:creator>ErraticAttack</dc:creator>
      <dc:date>2022-03-29T02:29:23Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with scripting Panel Box</title>
      <link>https://community.jmp.com/t5/Discussions/Need-help-with-scripting-Panel-Box/m-p/474015#M71882</link>
      <description>&lt;P&gt;Here is an example of using &lt;CODE class=" language-jsl"&gt;H Splitter Box()&lt;/CODE&gt; and &lt;CODE class=" language-jsl"&gt;Lineup Box()&lt;/CODE&gt; to do this.&amp;nbsp; Note that this also scopes everything into an anonymous namespace to prevent cross-talk if multiple windows are opened at the same time from this script.&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 );

self = New Namespace();

self:notReadyTablesText = "Need to join tables";
self:readyTableText = "I have the table";
self:selectorOptions = Eval List( {self:notReadyTablesText, self:readyTableText} );

Eval( Eval Expr(
self:button generator = Function( {title, callback},
	{Default Local},
	self = Namespace( Expr( self &amp;lt;&amp;lt; Get Name ) );
	Eval( Parse( Eval Insert( JSL Quote(
	box = Button Box( title, &amp;lt;&amp;lt;Set Function(
		Function( {this},
			{Default Local},
			self = Namespace( "^self &amp;lt;&amp;lt; Get Name^" );
			Eval( Parse( "self:^callback^" ) )
		)
	) ) ) );
	) );
	box
);

New Window( "test",
	&amp;lt;&amp;lt;On Close(
		self = Namespace( Expr( self &amp;lt;&amp;lt; Get Name() ) );
		self &amp;lt;&amp;lt; Remove( self &amp;lt;&amp;lt; Get Keys );
		Delete Namespaces( Force( 1 ), self )
	)
,
	H Splitter box(
		Lineup Box( N Col( 1 ), Spacing( 0 ),
			Spacer Box( &amp;lt;&amp;lt;Set Auto Stretching( 1, 0 ) )
		,
			self:readyTableSelector = Combo Box(
				self:selectorOptions,
				&amp;lt;&amp;lt;Set Function( Function( {this},
					{Default Local},
					self = Namespace( Expr( self &amp;lt;&amp;lt; Get Name ) );
					self:handle selector choice;
				) )
			)
		,
			self:not ready tables = If Box( 1,
				Lineup Box( N Col( 1 ), Spacing( 0 ),
					Spacer Box( &amp;lt;&amp;lt;Set Auto Stretching( 1, 0 ) )
				,
					self:button generator( "Table 1", "open button( this )" )
				,
					self:button generator( "Table 2", "open button( this )" )
				,
					self:button generator( "Join Tables", "handle join" )
				)
			)
		,
			self:ready tables = If Box( 0,
				Lineup Box( N Col( 1 ), Spacing( 0 ),
					Spacer Box( &amp;lt;&amp;lt;Set Auto Stretching( 1, 0 ) )
				,
					self:button generator( "Load Tables", "load tables" )
				)
			)
		)
	,
		Spacer Box( &amp;lt;&amp;lt;Set Auto Stretching( 1, 0 ) )
	,
		&amp;lt;&amp;lt;Set Sizes( {0.01, 0.99} )
	)
);

self:handle selector choice = Function( {},
	{Default Local},
	self = Namespace( Expr( self &amp;lt;&amp;lt; Get Name() ) );
	selector = self:readyTableSelector &amp;lt;&amp;lt; Get Selected;
	If(
		selector == self:notReadyTablesText,
			self:notReadyTables &amp;lt;&amp;lt; Set( 1 );
			self:readyTables &amp;lt;&amp;lt; Set( 0 );,
		selector == self:readyTableText,
			self:notReadyTables &amp;lt;&amp;lt; Set( 0 );
			self:readyTables &amp;lt;&amp;lt; Set( 1 );
	)
);

self:open button = Function( {this},
	{Default Local},
	self = Namespace( Expr( self &amp;lt;&amp;lt; Get Name() ) );
	Print( "Open table '" || (this &amp;lt;&amp;lt; Get Button Name) || "'" );
);

self:handle join = Function( {},
	Print( "Not Implemented" )
);

self:load tables = Function( {},
	Print( "Not Implemented" )
);

self &amp;lt;&amp;lt; Get Name
) );&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 29 Mar 2022 02:49:57 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Need-help-with-scripting-Panel-Box/m-p/474015#M71882</guid>
      <dc:creator>ErraticAttack</dc:creator>
      <dc:date>2022-03-29T02:49:57Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with scripting Panel Box</title>
      <link>https://community.jmp.com/t5/Discussions/Need-help-with-scripting-Panel-Box/m-p/474019#M71884</link>
      <description>&lt;P&gt;I'm talking about size in X, I'm talking about size in Y.&lt;/P&gt;&lt;P&gt;In your example the height of the Panel Box is changing.&lt;/P&gt;&lt;P&gt;This:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2022-03-28 20_11_00-Clipboard.png" style="width: 232px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/41240iD2BCE0392B55A7D2/image-size/large?v=v2&amp;amp;px=999" role="button" title="2022-03-28 20_11_00-Clipboard.png" alt="2022-03-28 20_11_00-Clipboard.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;vs. this:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2022-03-28 20_11_50-Clipboard.png" style="width: 232px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/41241iA3DBCF38323E64D4/image-size/large?v=v2&amp;amp;px=999" role="button" title="2022-03-28 20_11_50-Clipboard.png" alt="2022-03-28 20_11_50-Clipboard.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have other panel boxes below this one - and they start jumping.&lt;/P&gt;&lt;P&gt;Anyways, I gave up and implemented it as a Line Up Box for now.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Mar 2022 03:14:23 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Need-help-with-scripting-Panel-Box/m-p/474019#M71884</guid>
      <dc:creator>miguello</dc:creator>
      <dc:date>2022-03-29T03:14:23Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with scripting Panel Box</title>
      <link>https://community.jmp.com/t5/Discussions/Need-help-with-scripting-Panel-Box/m-p/474024#M71887</link>
      <description>&lt;P&gt;One other method is using Spacer Box() with size in one direction as 0, you can see it used here&amp;nbsp;&lt;LI-MESSAGE title="A Structured Approach to Programming With JSL for Building Real World, Scalable Applications ( 2019-EU-30MP-098 )" uid="110075" url="https://community.jmp.com/t5/Discovery-Summit-Europe-2019/A-Structured-Approach-to-Programming-With-JSL-for-Building-Real/m-p/110075#U110075" discussion_style_icon_css="lia-mention-container-editor-message lia-img-icon-tkb-thread lia-fa-icon lia-fa-tkb lia-fa-thread lia-fa"&gt;&lt;/LI-MESSAGE&gt;&amp;nbsp;. I think it was the section which starts at 22:00.&lt;/P&gt;
&lt;LI-SPOILER&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

notReadyTablesText = "Need to join tables";
readyTableText = "I have the table";
selectorOptions = Eval List({notReadyTablesText, readyTableText});

new window("",		
	Panel Box("Select tables",
		stVLB = V List Box(
			readyTablesSelector = Combo Box(
				selectorOptions,
				selector = readyTablesSelector &amp;lt;&amp;lt; Get Selected();
				Show(selector);
				If(
					selector == notReadyTablesText,
						notReadyTables &amp;lt;&amp;lt; Set(1);
						readyTables &amp;lt;&amp;lt; Set(0);,
					selector == readyTableText,
						notReadyTables &amp;lt;&amp;lt; Set(0);
						readyTables &amp;lt;&amp;lt; Set(1);
				)
			),
			H List Box(Spacer Box(Size(0,75)),
				notReadyTables = If Box(
					1,
					V List Box(
						Button Box("Table 1", t1Open),
						Button Box("Table 2", t2Open),
						join = Button Box("Join Tables",
							notImplemented;
						)
					)
				),
				readyTables = If Box(0, Button Box("Load Tables", loadTable))
			)
		)	
	)
)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;/LI-SPOILER&gt;</description>
      <pubDate>Tue, 29 Mar 2022 04:58:06 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Need-help-with-scripting-Panel-Box/m-p/474024#M71887</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2022-03-29T04:58:06Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with scripting Panel Box</title>
      <link>https://community.jmp.com/t5/Discussions/Need-help-with-scripting-Panel-Box/m-p/474247#M71898</link>
      <description>&lt;P&gt;Thanks a lot!&lt;/P&gt;&lt;P&gt;I'm not that good with expressions etc. I need to read on that first to be able to&amp;nbsp; understand your code :)&lt;/img&gt;&lt;/P&gt;&lt;P&gt;For instance, I don't understand, why do I have to say&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Eval(Eval Expr(self = Namespace(Expr(self &amp;lt;&amp;lt; Get Name)););)&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;when I can just say&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;self = Namespace(self &amp;lt;&amp;lt; Get Name);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;and then, why do I even have to say that? Why can't I just use the namespace by referring to it by "self"?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Mar 2022 20:02:59 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Need-help-with-scripting-Panel-Box/m-p/474247#M71898</guid>
      <dc:creator>miguello</dc:creator>
      <dc:date>2022-03-29T20:02:59Z</dc:date>
    </item>
  </channel>
</rss>

