Miniwindow Textbox control

Posted by WillFa on Sat 30 May 2009 06:02 PM — 4 posts, 22,254 views.

USA #0
Hey Nick,

Would it be possible to add text boxes to miniwindows? I had an idea to make a wizard for wizards kind of thing for areabuilding, and being able to make actual dialog boxes would be super useful. :)

Australia Forum Administrator #1
Hmmm. Miniwindows are currently output-only, as you know. There are also hooks for mouse activity, like clicks and mouse-overs.

Handling keyboard input is going to be a big change. Remember the issue that keeps cropping up with whether Ctrl+C copies from the command window or the output window? This would be the same, but worse.

To implement some sort of keyboard input the very least that would be needed is to have the "focus" be moveable from the command window to the miniwindow (and which miniwindow, if you have more than one with input boxes?). Then keystrokes would need to be passed to the miniwindow rather than the command window, and attention would be needed to handle accelerator keys as well (eg. if you redirect "K" to do something different, would that apply if the miniwindow had the focus?).

You would also need to have some sort of special key that moves the focus around (or the mouse maybe), like Ctrl+Tab does in Windows. You would need to handle copy and paste, highlighting selections, scrolling, etc.

Sounds like a big job to me.

The closest I can suggest, if you want to have a way of easily editing something like a mob description, is to use the Lua editbox (or similar) function (http://www.gammon.com.au/scripts/doc.php?lua=utils.editbox). Now admittedly this would be modal, and you couldn't do anything else until you amended the description and clicked OK or Cancel, but that would be a workaround.
USA #2
I never said it was a [b]good[/b] suggestion... :)

I had thought of the utils.editbox, but the modality thing made me wonder if this would be something you're interested in doing.

Thanks Nick. :)
Netherlands #3
An alternative option could be as follows...

Suppose you have a line in your miniwindow you want to edit to show something else. Have a hotspot on it. Once clicked, adjust the command line window color to something specific (maybe even change the font to make the difference even clearer), perhaps put the current value in there and select it, and add an alias with the highest possible sequence that catches everything. Once it fires, restore everything to the users settings again.

Maybe improve it a bit and combine it with an OnPluginCommandEntered that turns input 'blah' into 'PLUGINID:blah' so there is no chance another alias will steal the input.

I might make you an example if you want, so just let me know. :)