Input window appearance

Thoughts, Help, Feature Requests, Bug Reports, Developing code for...

Moderators: dorpond, trevor, Azhrei

Forum rules
PLEASE don't post images of your entire desktop, attach entire campaign files when only a single file is needed, or generally act in some other anti-social behavior. :)
Post Reply
User avatar
Sylphia
Dragon
Posts: 306
Joined: Thu Dec 18, 2008 1:13 pm

Input window appearance

Post by Sylphia »

1) Is there a way to move an input list under the prompt text like this:
PopUp.JPG
PopUp.JPG (8.78 KiB) Viewed 967 times


2) Is there a way to make the TEXT box bigger like this:

PopUp2.JPG
PopUp2.JPG (7.82 KiB) Viewed 961 times
System Info:
MapTool version: 1.3b48
Sun Java (build 1.6.0_11-b03)
WinXP Professional, V. 2002, SP 2
Intel Pentium Dual CPU, T3200 @ 2GHz, 2GB RAM

User avatar
Azhrei
Site Admin
Posts: 12061
Joined: Mon Jun 12, 2006 1:20 pm
Location: Tampa, FL

Re: Input window appearance

Post by Azhrei »

Have you tried embedding the HTML <br> element into the string?

User avatar
Sylphia
Dragon
Posts: 306
Joined: Thu Dec 18, 2008 1:13 pm

Re: Input window appearance

Post by Sylphia »

I did this:

Code: Select all

[h:status=input("AP|Spend,Gain|Spend or Gain an Action Point on this token<br>|RADIO|ORIENT=H SELECT=0")]
[h:abort(status)]


and got this:
PopUp3.JPG
PopUp3.JPG (9.01 KiB) Viewed 935 times
System Info:
MapTool version: 1.3b48
Sun Java (build 1.6.0_11-b03)
WinXP Professional, V. 2002, SP 2
Intel Pentium Dual CPU, T3200 @ 2GHz, 2GB RAM

User avatar
plothos
Great Wyrm
Posts: 1890
Joined: Sat Jun 21, 2008 1:07 am

Re: Input window appearance

Post by plothos »

Have you tried:

Code: Select all

[h:status=input("AP|Spend,Gain|Spend or Gain an Action Point on this token"+<br>+"|RADIO|ORIENT=H SELECT=0")]
[h:abort(status)]
?
Or:

Code: Select all

[h:status=input("AP|"+<br>+"Spend,Gain|Spend or Gain an Action Point on this token|RADIO|ORIENT=H SELECT=0")]
[h:abort(status)]
?

User avatar
Azhrei
Site Admin
Posts: 12061
Joined: Mon Jun 12, 2006 1:20 pm
Location: Tampa, FL

Re: Input window appearance

Post by Azhrei »

Nope, his first attempt was correct:

Code: Select all

[h:status=input("AP|Spend,Gain|Spend or Gain an Action Point on this token<br>|RADIO|ORIENT=H SELECT=0")]
[h:abort(status)]

But try adding the <html> tag at the beginning. It would look like:

Code: Select all

[h:status=input("AP|Spend,Gain|<html>Spend or Gain an Action Point on this token<br>|RADIO|ORIENT=H SELECT=0")]
[h:abort(status)]

Btw, plothos, the <br> is straight text and would always be inside quotes of some kind when used in a macro.

User avatar
Sylphia
Dragon
Posts: 306
Joined: Thu Dec 18, 2008 1:13 pm

Re: Input window appearance

Post by Sylphia »

plothos wrote:Have you tried:

Code: Select all

[h:status=input("AP|Spend,Gain|Spend or Gain an Action Point on this token"+<br>+"|RADIO|ORIENT=H SELECT=0")]
[h:abort(status)]
?
Or:

Code: Select all

[h:status=input("AP|"+<br>+"Spend,Gain|Spend or Gain an Action Point on this token|RADIO|ORIENT=H SELECT=0")]
[h:abort(status)]
?



Using

Code: Select all

[h:status=input("AP|Spend,Gain|Spend or Gain an Action Point on this token"+<br>+"|RADIO|ORIENT=H SELECT=0")]
[h:abort(status)]


makes the macro think the line is actually
[h:status=input("AP|Spend,Gain|Spend or Gain an Action Point on this token"

It reads the quote as the end of the input field instead of the quote that follows SELECT=0

I even tried

Code: Select all

[h:Test="Spend or Gain an Action Point on this token<br>"]
[h:status=input("AP|Spend,Gain|"+Test+"|RADIO|ORIENT=H SELECT=0")]
[h:abort(status)]


And I also tried wrapping it in a table. Nothing has worked. Hence I am hoping the demigods of MT know of a solution.
System Info:
MapTool version: 1.3b48
Sun Java (build 1.6.0_11-b03)
WinXP Professional, V. 2002, SP 2
Intel Pentium Dual CPU, T3200 @ 2GHz, 2GB RAM

Craig
Great Wyrm
Posts: 2107
Joined: Sun Jun 22, 2008 7:53 pm
Location: Melbourne, Australia

Re: Input window appearance

Post by Craig »

Azhrei wrote:Nope, his first attempt was correct:

Code: Select all

[h:status=input("AP|Spend,Gain|Spend or Gain an Action Point on this token<br>|RADIO|ORIENT=H SELECT=0")]
[h:abort(status)]

But try adding the <html> tag at the beginning. It would look like:

Code: Select all

[h:status=input("AP|Spend,Gain|<html>Spend or Gain an Action Point on this token<br>|RADIO|ORIENT=H SELECT=0")]
[h:abort(status)]

Btw, plothos, the <br> is straight text and would always be inside quotes of some kind when used in a macro.


This would place a line break at the end of the label, but this won't push down the text input control.
The only way to get some flexibility about placing the input where you want it is to use a form in a [dialog(): ]. One problem though is carriage returns are not handled correctly in text areas yet...

User avatar
Sylphia
Dragon
Posts: 306
Joined: Thu Dec 18, 2008 1:13 pm

Re: Input window appearance

Post by Sylphia »

Azhrei wrote:Nope, his first attempt was correct:

Code: Select all

[h:status=input("AP|Spend,Gain|Spend or Gain an Action Point on this token<br>|RADIO|ORIENT=H SELECT=0")]
[h:abort(status)]

But try adding the <html> tag at the beginning. It would look like:

Code: Select all

[h:status=input("AP|Spend,Gain|<html>Spend or Gain an Action Point on this token<br>|RADIO|ORIENT=H SELECT=0")]
[h:abort(status)]

Btw, plothos, the <br> is straight text and would always be inside quotes of some kind when used in a macro.

PopUp4.JPG
PopUp4.JPG (8.3 KiB) Viewed 909 times


ROFL well it did change SOMETHING :)


The good thing is, this solves the problem I am having on one of my macros where the input prompt text is way too long, making the macro window HUGE. The bad thing is, it doesnt actually fix what I am trying to do here.

I even tried putting the <br> and the <html><br> in the slot next to RADIO, and wound up with a very ticked off macro :shock: (it didnt work)
System Info:
MapTool version: 1.3b48
Sun Java (build 1.6.0_11-b03)
WinXP Professional, V. 2002, SP 2
Intel Pentium Dual CPU, T3200 @ 2GHz, 2GB RAM

User avatar
Sylphia
Dragon
Posts: 306
Joined: Thu Dec 18, 2008 1:13 pm

Re: Input window appearance

Post by Sylphia »

OK...since the radio button relocation project seems to be a no-go...how about the resized text window?
System Info:
MapTool version: 1.3b48
Sun Java (build 1.6.0_11-b03)
WinXP Professional, V. 2002, SP 2
Intel Pentium Dual CPU, T3200 @ 2GHz, 2GB RAM

DeviantNull
Dragon
Posts: 685
Joined: Wed Sep 03, 2008 12:34 pm
Location: The Junkyard

Re: Input window appearance

Post by DeviantNull »

Just roll your own input. Over in user creations I put my stuff if you want a deeper look at how I did it. But basically just use Dialog() and HTML.

Dialog() and Frame() accepts all the regular HTML input options such as radio, checkboxes, selection lists, and even textareas (though they're a bit broken). It submits all the values inside the macro.args property as a string with the props as the input names and the values as the input.

So real quickly you could have...

Code: Select all

[Dialog("ActionPoints"):{
<html>
    <head><meta name="input" content = "true"></head>
<body>
    <form name="Action Points" action="[r: macroLinkText('[email protected]:Token', 'none', '', currentToken())]">
Spend or Gain an Action Point on this token<br>
<input type="radio" name="AP" value="1"></input>Spend <input type="radio" name="AP" value="-1"></input>Gain

<input type="submit" name="save" value="Ok"></input>
    </form>
</body>
</html>
}]


Then you'd have an ActionPoint macro on the Lib:Token (or on the same token and just change the macroLink). That looks something like this...

Code: Select all

[ActionPoints = ActionPoints + getStrProp(macro.args, "AP")]


For better formatting throw the stuff inside a table.

knizia.fan
Giant
Posts: 197
Joined: Wed Jul 30, 2008 3:43 pm

Re: Input window appearance

Post by knizia.fan »

Sylphia wrote:1) Is there a way to move an input list under the prompt text like this:
Image


Use the SPAN=TRUE option to suppress the control's prompt text (see the input() documentation):

Code: Select all

[h: input(
    "dummyVariable|Spend or Gain an Action Point on this token:||LABEL|SPAN=TRUE",
    "choice|Spend,Gain|Action point:|RADIO|ORIENT=H SPAN=TRUE"
)]

Image

Since the radio button group's prompt is embedded in the border when you use SPAN=TRUE, you could possibly eliminate the LABEL entirely.

There isn't a way to make a multiline TEXT control in input().

User avatar
lmarkus001
Great Wyrm
Posts: 1865
Joined: Sat Mar 29, 2008 12:30 am
Location: Layfayette Hill, PA

Re: Input window appearance

Post by lmarkus001 »

Hummm... you can put a table into an input() to format your text... the Cancel in the image is just a table with borders.

Image

Code: Select all

[H: bgImage = macro.args]

[ok = input(
   "variableName| " + bgImage + "|<html><head><style type='text/css'> table{ float:center; border-width: 1px; border-spacing: 1px; border-collapse: collapse; }</style></head><body>Press <table><tr><td>Cancel</tr></td></table> if you see a red ? image - - ></body></html> |LABEL|ICON=TRUE",
   "junk| (Press Ok if the image is rendered correctly.) | | LABEL | SPAN=TRUE",
   "junk| Note that this is a workaround for an image loading bug. | | LABEL | SPAN=TRUE"
)]

User avatar
Azhrei
Site Admin
Posts: 12061
Joined: Mon Jun 12, 2006 1:20 pm
Location: Tampa, FL

Re: Input window appearance

Post by Azhrei »

Hey, k.fan! You're back! ;)

Long time, no see! Or perhaps you've been back for a couple days and I just haven't noticed (I don't read every post).

In any case, welcome home!

User avatar
Mr. Pokeylope
Giant
Posts: 118
Joined: Mon Aug 11, 2008 9:24 pm
Contact:

Re: Input window appearance

Post by Mr. Pokeylope »

Wow, apparently I started a trend of developers suddenly reappearing after being gone for over half a year. :-P

Post Reply

Return to “MapTool”