Multi-line text fields?

Posted on
Tue Jun 23, 2015 12:16 pm
FlyingDiver offline
User avatar
Posts: 7215
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Multi-line text fields?

Is there a way in the ConfigUI section of Action.xml to define a multi-line textfield? Here's what I have now:
Code: Select all
         <Field id="emailMessage" type="textfield">
            <Label>Message:</Label>
         </Field>

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Tue Jun 23, 2015 1:53 pm
jay (support) offline
Site Admin
User avatar
Posts: 18219
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Multi-line text fields?

Not at the moment, but it's on the feature request list.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Tue Jun 23, 2015 2:07 pm
FlyingDiver offline
User avatar
Posts: 7215
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Multi-line text fields?

jay (support) wrote:
Not at the moment, but it's on the feature request list.


I think you must have a macro for that sentence. ;)

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Tue Jun 23, 2015 3:50 pm
jay (support) offline
Site Admin
User avatar
Posts: 18219
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Multi-line text fields?

Heh. We have well over 250 such requests.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Tue Jun 23, 2015 3:51 pm
FlyingDiver offline
User avatar
Posts: 7215
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Multi-line text fields?

jay (support) wrote:
Heh. We have well over 250 such requests.


I think that's called a "target rich environment". :lol:

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Mon Jan 23, 2017 2:33 pm
FlyingDiver offline
User avatar
Posts: 7215
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Multi-line text fields?

Turns out this is very easy. Tip of the hat to forum user krissh , who sent me this in a pull request for the BetterEmail plugin.

Forcing the Label for the text field to multiple lines also causes the input text box to be multiple lines.

Code: Select all
            <Field id="emailMessage" type="textfield">
                <Label>Message:
             
             
             
             
             
             
             
             
             
             
             
             
             </Label>
            </Field>

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Mon Jan 23, 2017 9:31 pm
DaveL17 offline
User avatar
Posts: 6753
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: Multi-line text fields?

Dig it.

Device config:
Screen Shot 2017-01-23 at 9.18.50 PM.png
Screen Shot 2017-01-23 at 9.18.50 PM.png (24.93 KiB) Viewed 3578 times

Result:
chart_multiline.png
chart_multiline.png (11.11 KiB) Viewed 3578 times

Note that for my example, you still need something that's capable of outputting multiline text (matplotlib plugin in this case). This text was also run through the textwrap module and came out unscathed (that is, still multiline output). It appears that the textfield height is controlled by the number of lines not only between the <label> tags but also including the tag's lines (8 in my example).

ETA - Scratch that. The formatting does not survive the textwrap module.
Last edited by DaveL17 on Tue Jan 24, 2017 10:08 am, edited 1 time in total.

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Posted on
Tue Jan 24, 2017 2:28 am
krissh offline
Posts: 105
Joined: Nov 18, 2012
Location: Norway

Re: Multi-line text fields?

The "trick" can also be used for UI field labels. As the width of UI dialogs is fixed and I often find them a bit narrow, I have some times used line breaks in labels to get wider text boxes etc. Some examples here

Posted on
Tue Jan 24, 2017 6:45 am
DaveL17 offline
User avatar
Posts: 6753
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: Multi-line text fields?

krissh wrote:
The "trick" can also be used for UI field labels. As the width of UI dialogs is fixed and I often find them a bit narrow, I have some times used line breaks in labels to get wider text boxes etc. Some examples here

Nice. I have been using multiline labels for a while, but never thought to try it with labels for fields.

Great tip.

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Posted on
Tue Jan 24, 2017 10:00 am
jay (support) offline
Site Admin
User avatar
Posts: 18219
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Multi-line text fields?

While these hacks are clever, I just want to point out that they are an unintentional byproduct of how we implemented the rendering using the Cocoa APIs. Should we ever have a client that's not Mac-based it seems likely that they will not work. Nor is it guaranteed to continue to work in future revs of the Mac client (though we have no current plans to change the Mac client in this respect).

So, just a warning that these are likely not future proof. :wink:

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Tue Jan 24, 2017 12:53 pm
RogueProeliator offline
User avatar
Posts: 2501
Joined: Nov 13, 2012
Location: Baton Rouge, LA

Re: Multi-line text fields?

So, just a warning that these are likely not future proof. :wink:

Half the sh!t we do isn't future proof -- where is the fun in hacking the implementation if it was published and sure to last?!?

I do like the ideas from the other plugin devs and appreciate everyone sharing their work-arounds!

Adam

Posted on
Tue Jan 24, 2017 2:13 pm
jalves offline
Posts: 744
Joined: Jun 16, 2013

Re: Multi-line text fields?

Did Jay just (not) announce plans for a future Indigo client that isn't mac-based? :shock:

Running Indigo 2023.2 on a 24" iMac M1), OS X 14.4
Jeff

Posted on
Tue Jan 24, 2017 4:54 pm
DaveL17 offline
User avatar
Posts: 6753
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: Multi-line text fields?

I feel like we've had this conversation before.

I distinctly remember Matt and Jay saying that the future path was Cobol 60 because, and I quote, "FLOW-MATIC is too pedantic."

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Posted on
Tue Jan 24, 2017 6:19 pm
jay (support) offline
Site Admin
User avatar
Posts: 18219
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Multi-line text fields?

RogueProeliator wrote:
I do like the ideas from the other plugin devs and appreciate everyone sharing their work-arounds!


We do too - you guys can be so clever. I just periodically want to remind everyone of reality... ;)

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Tue Jan 24, 2017 6:19 pm
jay (support) offline
Site Admin
User avatar
Posts: 18219
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Multi-line text fields?

jalves wrote:
Did Jay just (not) announce plans for a future Indigo client that isn't mac-based? :shock:


No comment.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Who is online

Users browsing this forum: No registered users and 1 guest

cron