# Object isn't fully displayed in DialogInput

Update: Here's a simper example to reproduce the issue:

DialogInput[Table[InputField[], {50}], WindowSize -> All]


On my 1366×768 screen only no more than 17 InputFields are displayed.

This happens at least when a Manipulate that owns a big enough image and an adequate number of controller is inside DialogInput. Try the following example:

picture = Rasterize[Table[i + j, {i, 40}, {j, 40}] // MatrixForm];
DialogInput[{Manipulate[picture, {a}, {a}, {a}, {a}, {a}],
DefaultButton@DialogReturn[]}, WindowSize -> All]


As one can see, the last line of the matrix and the DefaultButton aren't displayed, and the WindowSize -> All option doesn't work. What am I doing wrong here? Or it's a bug? Let alone whether it's a bug or not, how to fix it (in a general way if possible)?

The issue seems to be related to the screen resolution. (Mine is 1366×768.) If you own a better screen, you may need to make the picture larger to reproduce it.

I might not have understood the question correctly. But it seems to me that adding

WindowElements->"VerticalScrollBar" to the code should fix the problem. a simple code

DialogInput[Table[InputField[i], {i, 2000}], WindowElements -> "VerticalScrollBar"]


works real well.

Here's my screenshot of the last several InputField:

Still works for the original Dialog with Manipulate.

picture = Rasterize[Table[i + j, {i, 40}, {j, 40}] // MatrixForm];
DialogInput[{Manipulate[picture, {a}, {a}, {a}, {a}, {a}],
DefaultButton@DialogReturn[]}, WindowSize -> All,
WindowElements -> "VerticalScrollBar"]


• Oh, out of my expectation, but within understanding: DialogInput accepts WindowElements option! I think this is the most general solution for so long. – xzczd Oct 15 '15 at 2:10

Update: It appears that the Magnification option is available and can be used to scale whatever collection of objects is placed in the window so that everything fits. (This, of course, doesn't mean that everything will be readable.)

DialogInput[Table[InputField[i], {i, 50}], WindowSize -> All, Magnification -> 0.35]


End-of-update.

The issue is that Mathematica does not automatically change font size and line spacing to make things fit. It does the best it can with the default values. (If there was only one thing to change to make the desired scaling and everything would end up readable, then maybe it should do so. But because there are several choices to make things fit, I think Mathematica chooses the right path.)

If we have a larger array than what you presented above so that everything doesn't fit on my screen, then the following produces a window that fits everything:

picture = Rasterize[MatrixForm[Table[Style[i + j, FontSize -> 8], {i, 50}, {j, 50}],
TableSpacing -> {0.45, 0.5}]];
DialogInput[{Manipulate[picture, {a}, {a}, {a}, {a}, {a}], DefaultButton@DialogReturn[]},
WindowSize -> All]


which results in the following;

• Thanks for looking into this! Then it there a more general way to fix this issue (like a certain combination of options etc.)? – xzczd Oct 12 '15 at 2:20
• A combination of FontSize, TableSpacing, and a grid of objects should do it. Are you desiring scroll bars in a dialog box? – JimB Oct 12 '15 at 4:44
• I mean, the combination of FontSize and TableSpacingScroll does work, but one needs to adjust the option value carefully for every specific case, which is inconvenient and undesired. Scroll bars are acceptable, if it can be added to the dialog box. – xzczd Oct 12 '15 at 5:18
• I assume that there must be a special objective that would require to many, many input fields. (Generally there would be a bite-sized display to the user rather than hundreds of input fields.) If you would expand on that objective, then maybe better advice could be given. – JimB Oct 12 '15 at 5:51
• Well, to be honest, your approach already solves my problem 囧, but… I just feel unsatisfied. And as you've noticed in the comment above, the behavior of the dialog box seems to depend on computer (Maybe screen resolution, I guess?), actually, your specific option values don't work on my 1366×768 screen. Here's a screen shot. This can also be the reason for seeking a more general solution. – xzczd Oct 12 '15 at 6:30

Here are two functions that make the content of the DialogInput scrollable, if it's to big for the screen.
With Scrollbars:

screenFit1 :=
Pane[#, {Automatic,
Min[(# // Rasterize //
ImageDimensions)[[2]], ("ScreenArea" /.
SystemInformation["Devices", "ScreenInformation"])[[1, 2, 2]]*0.95]},
Scrollbars -> Automatic] &;


Without Scrollbars:

screenFit2 :=
Pane[#, {Automatic,
Min[(# // Rasterize //
ImageDimensions)[[2]], ("ScreenArea" /.
SystemInformation["Devices", "ScreenInformation"])[[1, 2, 2]]*0.95]},
ImageSizeAction -> "Scrollable"] &;


Usage examples:

DialogInput[
screenFit1@
Column@{Manipulate[picture, {a}, {a}, {a}, {a}, {a}], DefaultButton@DialogReturn[]}]



In a similar way one can make the use of the Magnification option, that is used in this answer, screen adaptive.

screenFitDialogInput =
Magnification ->
Min[1, Divide[("ScreenArea" /.
SystemInformation["Devices", "ScreenInformation"])[[1, 2, 2]],
(# // Rasterize // ImageDimensions)[[2]]]]] &;


• ImageSizeAction ->"Scrollable" doesn't work here, "ResizeToFit" works though. (Strangely the document contains examples for every possible option value of ImageSizeAction except for "Scrollable"!) – xzczd Oct 14 '15 at 2:39
• @xzczd There is an example in the Pane documentation. Did you have the mouse placed over the window and tried to use the mouse wheel for scrolling? – Karsten 7. Oct 14 '15 at 2:49
• @xzczd "ShrinkToFit" could also be useful here. – Karsten 7. Oct 14 '15 at 2:53
• Oh, I forgot to check the document of Pane… but the mouse wheel doesn't help, the example therein only scrolls when I press the left mouse button and drag down, and this doesn't work on the InputFields. – xzczd Oct 14 '15 at 3:09
• @xzczd Here is how "Scrollable" looks for me. Just using the mouse wheel. – Karsten 7. Oct 14 '15 at 16:23

This seems to work.

picture =
Rasterize[Table[i + j, {i, 100}, {j, 100}] // MatrixForm];