Yeah. That is currently an insoluble problem..
About the only thing you could do is have a function key programmed to cause an alias to execute, have that alias' script copy out the entire line, then run each individual word through the thesaurus, if you changed the line at all, then the script would clear the existing one and replace it with the altered one. The major pain with this is a) you would need a 'local' thesaurus database to check, or it would hit you with a 20-30 second of freezing Mushclient every time it executed the INET control command to retrieve a page (using IE here wouldn't work), b) you can't tell it to only check one word (or even get the cursor position to have the script figure out which one to request and last c) it would be a pain in the rear for even me, knowing how the control works, to do it. Oh yeah, and it would only be able to retrieve the first page or choices, without even more mind bending code to check for multiple ones (add another 20-30 seconds 'per' page here).
An external and inexpensive solution is to make it possible to do GetWordUnderCursor and ReplaceWordUnderCursor and then have an alias (for the right click menu) or a macro key call a script that did those things and called an external thesaurus to find the needed words. This would be a lot more usable and could allow for not just thesauruses, but word translators, etc.
As for spawned windows.. I had this idea for additions to that:
Added to the XML:
<!-- Control events would allow response to Click, DblClick, Change and other
events from the controls. -->
<trigger
match="OnButton1Click"
ControlEvent="y"
script="ClickThis">
</trigger>
<!-- Option 14 would be 'Send to Window'. -->
<trigger
match="gossip: *"
label="Text1"
send-to="14">
</trigger>
<!-- Responds to the Enter key being pressed and can thus work like an
input box for a chat window. -->
<trigger
match="OnText1Enter"
ControlEvent="y"
</trigger>
<window>
name="Window1"
top="0"
height="70"
left="300"
width="100"
<Button
name="Button1"
caption="Click This!"
top="50"
height="15"
left="1"
width="20">
</button>
<Textbox
name="Text1"
text=""
top="35"
height="10"
left="1"
width="98">
</Textbox>
<Picture
name="Pic1"
picture=""
top="1"
height="29"
left="1"
width="29">
</picture>
</window>
To the script command set>
World.CreateEventTrigger (BSTR match, BSTR Script)
World.CreateWindow (BSTR Name, INTEGER Top, INTEGER Height, INTEGER Left, INTEGER Width)
World.MoveWindow (BSTR Name, INTEGER Top, INTEGER Height, INTEGER Left, INTEGER Width)
World.CloseWindow
World.CreateButton (BSTR Name, BSTR Caption, INTEGER Top, INTEGER Height, INTEGER Left, INTEGER Width)
World.RemoveButton (BSTR Name)
World.MoveButton (BSTR Name, INTEGER Top, INTEGER Height, INTEGER Left, INTEGER Width)
World.SetCaption (BSTR Name, BSTR Caption)
'This I assume would use your fast output window object, since the only real alternative is the RichText control.
World.CreateTextbox (BSTR Name, INTEGER Top, INTEGER Height, INTEGER Left, INTEGER Width)
World.MoveTextbox (BSTR Name, INTEGER Top, INTEGER Height, INTEGER Left, INTEGER Width)
World.RemoveTextbox (BSTR Name)
World.SetText (BSTR Name, BSTR Text)
World.AppendText (BSTR Name, BSTR Text)
World.ColourAppendText (BSTR Name, BSTR Foreground, BSTR Background, BSTR Text)
World.GetText (BSTR Name)
World.GetLine (BSTR Name, LONG Line)
World.GetTextLines (BSTR Name)
World.ClearText (BSTR Name)
World.CreatePicture (BSTR Name, BSTR filename, INTEGER Top, INTEGER Height, INTEGER Left, INTEGER Width, INTEGER Mode)
'Mode would be stretch, tile or center. I think it is center anyway..
World.MovePicture (BSTR Name, INTEGER Top, INTEGER Height, INTEGER Left, INTEGER Width)
World.SetPicture (BSTR Name, BSTR Filename, INTEGER Mode) ' Should probably reload
'if the filename is the same, in case an external program changed the image.
World.FillePicture (BSTR Name, BSTR Color)
Optional>
World.Draw (BSTR Name, BSTR Commands)
'Simple implimentation of QBasics DRAW command. Not 'quite' as good as real drawing commands, but simpler than coding them all. They can use a real program for that. ;)
World.SavePicture (BSTR Name, BSTR Filename)
' Only useful if the above is allowed or real drawing can be somehow allowed. It should only work when the image mode is 'center', since tile would be confusing and I am not sure how stretch deals with drawing.
Hopefully everything is more of less self explainatory.
Not sure how much actual bloat this would add. It does add a mess of new commands, but while the window creation code and means to handle 'where' the events get sent are possibly complicated, the actual controls are just standard things you plug in when you need them. Then again, I don't have much experience with C++, so it may be insanely more complex in reality.
Anyway, I figure those three controls cover 'most' things you may want to do. A grid control would however be nice to have for databases, etc, but I am not sure how events on that are handled. If there are other useful controls, then the biggest hassle is figuring out what commands are needed to set things up and what events you actually want to keep track of. Most only use 'Click', 'DblClick' and 'Changed' though.
I figure having the events defined as part of the list of triggers would make them easier to keep track of. Though, it makes no sense for them to have a sequence number and should probably always appear in the list either first or last.
Making this sort of spawnable window also makes suggestion 496 'a mail editor' redundant, since you could easilly code one in script using such a window, not to mention a mess of other stuff.
---
Oh yeah, QBasic's DRAW feature:
'These draw by 1, if # is not given.
D# - Down by #
E# - Up and right by #
F# - Down and right by #
G# - Down and left by #
H# - Up and left by #
L# - Left by #
R# - Right by #
U# - Up by #
M<+,->#,<+/-># - Move to #,# or relative + or -.
C% - Sets color (an integer or in Mushclients case also maybe a color name).
I assume these work like [B D2 U L4], only way it makes sense..
[B] - Move but don't draw.
[N] - Draw, then return to first position.
There are also commands that do scaling and rotation, but that would get complicated, since instead of just drawing, you could need to keep track of each thing drawn as a seperate object to be scaled and rotated. I am not even sure how QBasic handled that. lol |