Enter->OK

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
jim
Newbie
Posts: 3
Joined: Tue Mar 15, 2005 6:36 am

Enter->OK

Post by jim » Mon Mar 21, 2005 6:37 am

Hi,
I have already made a dialog with an "OK" button which takes a value
when you push the button.I would like to know what I should add to my code so that the push of "ENTER" to have the same function with the push of "OK".Thanks in advance!!!!!!!!

rozling
Newbie
Posts: 4
Joined: Wed Apr 06, 2005 2:54 pm
Location: Dublin, Ireland

Enter->OK

Post by rozling » Wed Apr 06, 2005 3:14 pm

Having gone through the manual and searched the forums I'm also having trouble figuring this out.

In this dialog I'm grabbing the clipboard contents and taking that as the preset text in my dialog box. Then I'm asking the user to confirm that what's in the text field is what they want to output.

The Ok button outputs the clipboard and continues with the script:

----

GetClipBoard>edit

Dialog>MyDialog
Caption=Dialog Caption
Top=470
Width=609
Left=168
Height=106
Label=This is the text to output...,5,5
Edit=MyEdit,10,40,503,EditText
Button=Ok,532,40,50,20,3
EndDialog>MyDialog

Let>EditText=%edit%

Show>MyDialog,result
If>result=2,End
If>result=3,OutputClipboard

SRT>OutputClipboard
CapsOff
Send>%MyDialog.MyEdit%
END>OutputClipboard

Label>End

------

I'd like the user to have the option to either press Enter on the keyboard or Ok on the screen and for those to have the same result (namely to output 3 as the dialog result).

Any help is greatly appreciated!

Luciano
Junior Coder
Posts: 31
Joined: Fri Feb 11, 2005 1:10 pm
Location: Ghent, BELGIUM

Post by Luciano » Thu Apr 07, 2005 7:20 am

Put the BUTTON line before the EDIT line in the DIALOG declaration.



Dialog>MyDialog
Caption=Dialog Caption
Top=470
Width=609
Left=168
Height=106
Label=This is the text to output...,5,5
Button=Ok,532,40,50,20,3
Edit=MyEdit,10,40,503,EditText
EndDialog>MyDialog


Greetings

Luciano

User avatar
support
Automation Wizard
Posts: 1450
Joined: Sat Oct 19, 2002 4:38 pm
Location: London
Contact:

Post by support » Thu Apr 07, 2005 7:43 am

Or use the Tab Order tool in the dialog designer.
MJT Net Support
[email protected]

rozling
Newbie
Posts: 4
Joined: Wed Apr 06, 2005 2:54 pm
Location: Dublin, Ireland

Post by rozling » Thu Apr 07, 2005 12:19 pm

Thank you! I've tried these and it works until the text is edited in the dialog. Then the tab 'focus' is removed from the Ok button and I have to use the mouse again. Any suggestions?

I know it's not life-or-death but I'd like to have a better understanding of how dialogs work.

Does moving the BUTTON line ahead of the EDIT line have the same effect as changing the tab order in the dialog designer?
-- edit -- just figured this out by myself and it does, if anyone's interested!

Luciano
Junior Coder
Posts: 31
Joined: Fri Feb 11, 2005 1:10 pm
Location: Ghent, BELGIUM

Post by Luciano » Fri Apr 15, 2005 11:53 am

Hi,

After text editing, hit the TAB key on your keybord and the next object in the dialog window is active. Hit the TAB key until the OK button in the dialog is active. Use the SHIFT+TAB key for the reverse order of activation.
The Use of the TAB and SHIFT+TAB keys is a Window convention and not a magic trick of Macro Scheduler.

Greetings.

Luciano

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts