Re: [Sikuli-driver] [Question #240592]: [request] Input text field or input field that maintains formatting

2013-12-11 Thread RaiMan
Question #240592 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/240592

Assignee: None = RaiMan

Summary changed to:
[request] Input text field or input field that maintains formatting

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #240592]: [request] Input text field or input field that maintains formatting

2013-12-11 Thread RaiMan
Question #240592 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/240592

RaiMan proposed the following answer:
this is a somewhat enhanced version:

def myInput(title, width = 10, lines = 5):
import javax.swing.JTextArea as JTextArea
import javax.swing.JPanel as JPanel
import java.awt.Dimension as Dimension
import javax.swing.JOptionPane as JOptionPane
import javax.swing.BorderFactory as BF
import java.awt.Color as COLOR

textH = 16
textW = 10
inner = 5
ta = JTextArea()
ta.setPreferredSize(Dimension(width*textW,lines*textH + inner*2));
b0 = BF.createEmptyBorder(inner, inner, inner, inner)
b1 = BF.createLineBorder(COLOR.BLACK)   
ta.setBorder(BF.createCompoundBorder(b1, b0))
myPanel = JPanel();
myPanel.add(ta);

if 0 == JOptionPane.showConfirmDialog(None, myPanel, title, 
JOptionPane.OK_CANCEL_OPTION):
return ta.getText()
else:
return 

given = myInput(gimmi some text)
if given != :
print given
else:
print no input

The text area now has a simple border.
You may specify the number of characters (width = 10 default) per line and the 
number of lines (lines = 5 default) (this is based on the assumption, that a 
character is 10x16 Pixel.

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #240592]: [request] Input text field or input field that maintains formatting

2013-12-11 Thread dude
Question #240592 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/240592

Status: Answered = Open

dude is still having a problem:
Awesome, that works great
One thing I wonder I don't know how it would be implemented in sikuli
It starts out with the dialogue focus on the OK button and if you tab twice 
you're into the JTextArea

Would it be hard to implement  that if while in the JTextArea instead of
it putting a tab in the JTextArea when you press it cycles back to the
OK button and maybe a shift tab will actual  do a tab inside the
JTextArea or vice versa

thanks again for all your help :-)

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #240592]: [request] Input text field or input field that maintains formatting

2013-12-11 Thread RaiMan
Question #240592 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/240592

Status: Open = Answered

RaiMan proposed the following answer:
Thanks for feedback.
I have already added the feature including a password entry to version 1.1.

Your tabbing request is not possible with the nice and easy
implementation using JOptionPane.

But at least on Mac (did not check on Windows yet) using ctrl-tab does
what you want.

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #240592]: [request] Input text field or input field that maintains formatting

2013-12-11 Thread dude
Question #240592 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/240592

dude posted a new comment:
ctrl-tab works on both platforms FYI :D

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #240592]: [request] Input text field or input field that maintains formatting

2013-12-11 Thread dude
Question #240592 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/240592

Status: Answered = Solved

dude confirmed that the question is solved:
Thanks RaiMan, that solved my question.

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp