cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
The Discovery Summit 2025 Call for Content is open! Submit an abstract today to present at our premier analytics conference.
Choose Language Hide Translation Bar
View Original Published Thread

What property would make window automatically stretch if I change size of display boxes within window?

miguello
Level VI

I have GUI with multiple display boxes, some of them are Col List boxes that user can resize.

When they do that, window would make scroll bars. I don't want scroll bars. I want window to resize automatically to fit everything. Just like any platform (Fit Y by X for instance, does).

I can't find a combination of messages that would do that work... Can somebody point me in right direction?

 

Update:

Here is an illustration.

If you run this script:

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
bb = Border Box( Left( 10 ), Right( 10 ), Top( 5 ), Bottom( 10 ), Sides( 15 ),
clb = Col List Box( all, width( 250 ), maxSelected( 1 ) ),
);
nw = New Window( "Col List Box Example",
	bb

);

you'll get a window with a Col List Box.

If you try to resize this Col List Box beyond window, the window will expand.

But if you try to change the window size even a tiny bit - it won't respond to Col List Box changing size beyond window size. It will produce sliders.

 

In my Add-In my content for some reason does not fit vertically in the window.

The only way to fix that I was able to find was to change the size of the window. But now that we've changed the size of the window - it does not respond to changes in size of the content.

Is it a bug? Or is it expected behavior? Any way to fix that?

 

 

 

 

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
jthi
Super User

Re: What property would make window automatically stretch if I change size of display boxes within window?

As you are now resizing window and not the col list box, simplify your demo.

Names Default To Here(1); 

dt = open("$SAMPLE_DATA/Big Class.jmp");

nw = New Window("",
	vlb = V List Box(
		tb = Text Box("Text"),	
		hlb1 = H List Box(
			pb = Panel Box("Cast LUB",
				lub = Lineup Box(N Col(2),
					Button Box("Responses"),
					clb = Col List Box(dt
						, << Set N Lines(2)
						
					)
				)
			)
		)
	)
);

Now start figuring out what is going on and why setting stretching here and there won't work and hopefully (by accident most likely, like I did) you come across that you have to remember set max size (and potentially min).

Names Default To Here(1); 

dt = open("$SAMPLE_DATA/Big Class.jmp");

nw = New Window("",
	vlb = V List Box(
		tb = Text Box("Text"),	
		hlb1 = H List Box(
			pb = Panel Box("Cast LUB",
				lub = Lineup Box(N Col(2),
					Button Box("Responses"),
					clb = Col List Box(dt
						, << Set N Lines(2)
						
					)
				)
			)
		)
	)
);

show(clb << Get Stretch, clb << Get Min Size, clb << Get Max Size);

clb << Set Stretch("Window", "Neutral");
clb << Set Max Size(10000, 100)

Maybe this is what you are looking for? Combination of Set Stretch with Fill/Window and Set Max/Min Size?

-Jarmo

View solution in original post

7 REPLIES 7
jthi
Super User


Re: What property would make window automatically stretch if I change size of display boxes within window?

Very difficult to say as I'm not sure what issues you are having (adding scroll boxes isn't really a problem, they have a reason for being there most of the time). You do have << Set Stretch (or << Set Auto Stretching) which might work in some cases but it will also depend on how you have built your GUI.

 

I'm not exactly sure what you mean by Fit Y by X platform (report) automatically resizing to fit everything as in my opinion it doesn't do that. It does add scroll boxes when it is necessary. They are there for a purpose, if content doesn't fit inside the window let user still browse the content AND let them know something isn't shown. And if you mean launchers and how their col list box resizing resizes the window, it is most likely related to how you have built the GUI and they will also add scroll boxes if needed.

 

Edit:

For example "basic" launcher is much more dynamic if you use Lineup Box instead of V List Box + H List Box for button box and col list box combinations. And Lineup Box box generally makes your UI much cleaner due to it auto-sizing elements in each column and you can even control size over multiple lineup boxes by using Lineup Ruler Box.

Names Default To Here(1); 

dt = open("$SAMPLE_DATA/Big Class.jmp");

nw = New Window("",
	H List Box(
		Panel Box("Select",
			Filter Col Selector(dt),
		),
		Panel Box("Cast VLB + HLB",
			V List Box(
				H List Box(
					Button Box("Responses"),
					Col List Box(dt, << Set N Lines(2)),
				),
				H List Box(
					Button Box("Features"),
					Col List Box(dt, << Set N Lines(10))
				)
			)
		),
		Panel Box("Cast LUB",
			Lineup Box(N Col(2),
				Button Box("Responses"),
				Col List Box(dt, << Set N Lines(2)),
				Button Box("Features"),
				Col List Box(dt, << Set N Lines(10))
			)
		),
		Panel Box("Actions",
			Lineup Box(N Col(1),
				Button Box("OK"),
				Button Box("Recall"),
				Button Box("Close"),
				Button Box("Help")
			)
		)
	)
);

jthi_0-1738393281856.png

 

-Jarmo
miguello
Level VI


Re: What property would make window automatically stretch if I change size of display boxes within window?

Sorry for not being very clear. I was referring to the launch window of the Fit Y by X platform. Launch the platform, the window where you cast columns in roles. If you resize any of the Col List Boxes - window will resize accordingly without adding scroll bars.

My Add-In has a very similar launching platform, which would add scroll bars when I resize Col List Boxes.

 

Also, please check out an update on the question. The script i posted shows similar behavior.

 

On top of that, I found that it has something to do with the Taskbar autohiding on Windows: If I turn it ON, and my taskbar is hidden, my Add-In window opens up perfectly fitting all content. But as soon as I turn the autohiding off - window resizes to hide the bottom of content and vertical scroll bar appears. On top of that the bottom part of AddIn window doesn't even touch the taskbar. This is definitely a bug.

 

miguello
Level VI


Re: What property would make window automatically stretch if I change size of display boxes within window?

Here's the bottom part of my window with this page as the background. I have Taskbar autohiding ON. Everything is as I would expect.

2025-01-31 23_26_39-.png

 

As soon as I go to Windows Taskbar settings, and turn autohiding OFF, my window resizes so that a vertical scrollbar appears:

2025-01-31 23_27_28-What property would make window automatically stretch if I change size of displa.png

Screenshot positions are identical to the pixel. The only thing I did between them was unchecking the "Automatically hide the taskbar" in Windows settings. If I check it back in - it will revert to the first screenshot. Not that window isn't even touching the taskbar.

 

So, to solve this issue I had to explicitly set the window size. And this broke automatic window stretching when changing Col List Box just like in the script above.

 

 

 

miguello
Level VI


Re: What property would make window automatically stretch if I change size of display boxes within window?

This script has exactly the same problem as my small script in the update to the first message.

2025-01-31 23_34_34-What property would make window automatically stretch if I change size of displa.png

When you just run it and try to change Col List Boxes beyond the size of the window - the window stretches perfectly. But as soon as you try to change the size of the window itself by grabbing that corner with dots marked with red circle on the screenshot and move it even a couple of pixels - window stops responding to change is size of Col List Boxes and stops stretching, making scrollbars instead.

jthi
Super User

Re: What property would make window automatically stretch if I change size of display boxes within window?

As you are now resizing window and not the col list box, simplify your demo.

Names Default To Here(1); 

dt = open("$SAMPLE_DATA/Big Class.jmp");

nw = New Window("",
	vlb = V List Box(
		tb = Text Box("Text"),	
		hlb1 = H List Box(
			pb = Panel Box("Cast LUB",
				lub = Lineup Box(N Col(2),
					Button Box("Responses"),
					clb = Col List Box(dt
						, << Set N Lines(2)
						
					)
				)
			)
		)
	)
);

Now start figuring out what is going on and why setting stretching here and there won't work and hopefully (by accident most likely, like I did) you come across that you have to remember set max size (and potentially min).

Names Default To Here(1); 

dt = open("$SAMPLE_DATA/Big Class.jmp");

nw = New Window("",
	vlb = V List Box(
		tb = Text Box("Text"),	
		hlb1 = H List Box(
			pb = Panel Box("Cast LUB",
				lub = Lineup Box(N Col(2),
					Button Box("Responses"),
					clb = Col List Box(dt
						, << Set N Lines(2)
						
					)
				)
			)
		)
	)
);

show(clb << Get Stretch, clb << Get Min Size, clb << Get Max Size);

clb << Set Stretch("Window", "Neutral");
clb << Set Max Size(10000, 100)

Maybe this is what you are looking for? Combination of Set Stretch with Fill/Window and Set Max/Min Size?

-Jarmo
miguello
Level VI


Re: What property would make window automatically stretch if I change size of display boxes within window?

Well, it appears to be working in this simple case.

However, I tried exactly that and it didn't work in my way more complex GUI.

In any case this seems to be the solution, and I'll mark it as such, I just need to figure out how to apply it to my case.

jthi
Super User


Re: What property would make window automatically stretch if I change size of display boxes within window?

You can skip the simple case if you think you can solve massive problem without first solving multiple smaller problems, most of the time it is impossible or will take unnecessary amount of time when compared to solving few small /simple problems which help you understand the problem.

 

How stretching works is heavily dependent on the structure you have built your GUI with. Again simple example even though I'm not sure how much you think they have value in them:

 

Both col list box will scale at the same time when using Lineup box and just setting stretching to one of them:

 

Names Default To Here(1); 

dt = open("$SAMPLE_DATA/Big Class.jmp");

nw = New Window("",
	vlb = V List Box(
		tb = Text Box("Text"),	
		hlb1 = H List Box(
			pb = Panel Box("Cast LUB",
				lub = Lineup Box(N Col(2),
					Button Box("Responses"),
					clb = Col List Box(dt,
						, << Set N Lines(2)
					),
					Button Box("Responses"),
					Col List Box(dt,
						, << Set N Lines(2)
					)
				)
			)
		)
	)
);

clb << Set Stretch("Window", "Neutral");
clb << Set Max Size(10000, 100)

Same thing won't happen when using V List Box + H List Box

 

 

Names Default To Here(1); 

dt = open("$SAMPLE_DATA/Big Class.jmp");

nw = New Window("",
	vlb = V List Box(
		tb = Text Box("Text"),	
		hlb1 = H List Box(
			pb = Panel Box("Cast LUB",
				V List Box(
					H List Box(
						Button Box("Responses"),
						clb = Col List Box(dt,
							, << Set N Lines(2)
						)
					),
					H List Box(
						Button Box("Responses"),
						Col List Box(dt,
							, << Set N Lines(2)
						)
					)
				)
			)
		)
	)
);

clb << Set Stretch("Window", "Neutral");
clb << Set Max Size(10000, 100)

If you had modified parent display box (panel box in this example) to not stretch, the child elements won't be stretching either

Names Default To Here(1); 

dt = open("$SAMPLE_DATA/Big Class.jmp");

nw = New Window("",
	vlb = V List Box(
		tb = Text Box("Text"),	
		hlb1 = H List Box(
			pb = Panel Box("Cast LUB",
				lub = Lineup Box(N Col(2),
					Button Box("Responses"),
					clb = Col List Box(dt,
						, << Set N Lines(2)
					),
					Button Box("Responses"),
					Col List Box(dt,
						, << Set N Lines(2)
					)
				)
			)
		)
	)
);

pb << Set Max Size(100, 10);
pb << Set Stretch("Off", "Off");
clb << Set Stretch("Window", "Neutral");
clb << Set Max Size(10000, 100)

 

-Jarmo