Matt: Imagine you're in an MS Word or, better still, Notepad
document. You type in a line of text, and then press enter. What
happens? A new line character is inserted and the cursor is moved
to the new line.
that's what I'm trying to achieve in the Simple Simon editbox.
That should be the default behavior for a multi-line edit box. Take
the Add Comment dialog in App Get, or the Help Contents dialog in
the Framework script for examples. Do you have some code I could run
to see what's happening?
Matt: The VBScript code is enclosed in start vbs and end vbs tags,
and the xml code is enclosed in start xml and end xml tags:
'start vbs
option explicit
Dim isVisible
isVisible = 0
Dim myKey
Set myKey = Keyboard.RegisterHotkey("Control-Shift-Q", "LaunchDialog")
Sub LaunchDialog()
If isVisible = 0 Then
Queue "DisplayDialog"
End If
End Sub
Sub DisplayDialog()
Dialog "xx.xml", "simon_says", "DialogEventHandler"
End Sub
Function DialogEventHandler(dObj, dEvent, dId, dControl)
DialogEventHandler = False
Select Case dId
Case "button_speak"
If dEvent = buttonClicked Then
SimonSays dObj
DialogEventHandler = True
Exit Function
End If
Case "button_close"
If dEvent = buttonClicked Then
isVisible = 0
dObj.Close
DialogEventHandler = True
Exit Function
End If
Case Else
If dEvent = dialogCreated Then
isVisible = 1
DialogEventHandler = True
Exit Function
End If
End Select
End Function
Sub SimonSays(dObj)
Dim textToSpeak
dim currentScreenRate
textToSpeak = "Simon says " & dObj.Control("edit_string").Text
If dObj.Control("check_slow").Checked Then
currentScreenRate = ActiveSettings.Screen.Rate
ActiveSettings.Screen.Rate = Round(currentScreenRate / 4)
Speak textToSpeak
ActiveSettings.Screen.Rate = currentScreenRate
Else
Speak textToSpeak
End If
End Sub
'end vbs
start xml
<?xml version="1.0"?>
<wescriptui>
<language id="en-gb">
<dialog id="simon_says"
sysmenu="yes">
Simple Simon Says
<menubar>
<menu id="menu_file" shortcut="f">
File
<menuitem id="menu_file_open" shortcut="o">Open</menuitem>
<menuitem id="menu_file_exit" shortcut="x">Exit</menuitem>
</menu>
<menu id="menu_tools" shortcut="t">
Tools
<menuitem id="menu_tools_options" shortcut="o">Options</menuitem>
</menu>
<menu id="menu_help" shortcut="h">
Help
<menuitem id="menu_help_about" shortcut="a">About</menuitem>
</menu>
</menubar>
<group>
<static shortcut="i">
Simon Says:
</static>
<editbox id="edit_string" width="200" lines="multiple"
returns="yes">
</editbox>
<spacer />
<checkbox
id="check_slow"
shortcut="e">
Speak Slowly
</checkbox>
<spacer />
<group width="group" justify="center">
<button
id="button_speak"
width="+30"
widthclass="button"
shortcut="s">
Speak
</button>
<button
id="button_close"
shortcut="c"
widthclass="button"
system="cancel">
Close
</button>
</group>
</group>
</dialog>
</language>
</wescriptui>
end xml
Regards
matt
Thanks,
Aaron
--
Aaron Smith
Web Development * App Development * Product Support Specialist
GW Micro, Inc. * 725 Airport North Office Park, Fort Wayne, IN 46825
260-489-3671 * gwmicro.com
To insure that you receive proper support, please include all past
correspondence (where applicable), and any relevant information
pertinent to your situation when submitting a problem report to the GW
Micro Technical Support Team.