Message Boards Message Boards

Change width of input control in FormLayoutFunction?

Posted 8 years ago

I know that this should be very easy, but I can't seem to find the answer searching the docs or the discussions. Sorry.

How do I limit the width of input boxes in codes such as below? I only want each box to be about 4 characters wide.

FormPage[{"x1" -> "Number", "x2" -> "Number", "x3" -> "Number",  "y1" -> "Number", "y2" -> "Number", "y3" -> "Number"}, fn, 
 FormLayoutFunction -> Function[Grid[
    {{"dependent", #["x1", "Control"], #["x2", "Control"], #["x3",  "Control"]},
     {"independent", #["y1", "Control"], #["y2", "Control"], #["y3",   "Control"]}}]]]

Currently it looks like this:

enter image description here

Thanks in advance,

Mark Greenberg

POSTED BY: Mark Greenberg
4 Replies

...delete...

(one day there will be a way to delete one's post from the forum... ;-) )

POSTED BY: David Reiss
Posted 8 years ago
POSTED BY: Mark Greenberg
POSTED BY: David Reiss

Something like this perhaps:

FormPage[{"x1" -> <|"Interpreter" -> "Number", 
    "Control" -> Function[InputField[##, ImageSize -> 25]]|>, 
  "x2" -> <|"Interpreter" -> "Number", 
    "Control" -> Function[InputField[##, ImageSize -> 25]]|>, 
  "x3" -> <|"Interpreter" -> "Number", 
    "Control" -> Function[InputField[##, ImageSize -> 25]]|>, 
  "y1" -> <|"Interpreter" -> "Number", 
    "Control" -> Function[InputField[##, ImageSize -> 25]]|>, 
  "y2" -> <|"Interpreter" -> "Number", 
    "Control" -> Function[InputField[##, ImageSize -> 25]]|>, 
  "y3" -> <|"Interpreter" -> "Number", 
    "Control" -> Function[InputField[##, ImageSize -> 25]]|>}, fn, 
 FormLayoutFunction -> 
  Function[Grid[{{"dependent", #["x1", "Control"], #["x2", 
       "Control"], #["x3", "Control"]}, {"independent", #["y1", 
       "Control"], #["y2", "Control"], #["y3", "Control"]}}]]]
POSTED BY: David Reiss
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract