mIRC Homepage
Posted By: Kurdish_Assass1n Disable space in a dialog - 11/10/07 05:55 AM
Topic pretty much says it all. I know 100% sure that there is a way to disable the spacebar in an editbox. I just do not remember how to do it, please help me! Thanks.
Posted By: Horstl Re: Disable space in a dialog - 11/10/07 12:54 PM
This works not by disabling the key, but removing what it produces: spaces smile
It's simply replacing the edit's text [ did -ar ] with a "space-free" version of the text [ $remove(former_text,$chr(32)) ].
Type /nospaces to test...
Code:
alias nospaces { dialog $iif((!$dialog(nospaces)),-m,-x) nospaces nospaces }

dialog -l nospaces {
  title "no spaces in the edit"
  size -1 -1 200 30
  option dbu
  edit "", 1, 10 10 180 10
}

on *:DIALOG:nospaces:EDIT:1: { did -ar $dname $did $remove($did($did),$chr(32)) }
Posted By: Riamus2 Re: Disable space in a dialog - 12/10/07 10:16 AM
One method is to use the EDIT event in the on DIALOG to watch that editbox and whenever the most recent character is a space, it will automatically remove 1 character from the end of the box.

Of course, that doesn't help if someone moves the cursor to the middle and enters a space. In that case, using $remove to remove all spaces as mentioned is a good idea. If you don't want them to be seen in the editbox, then put that into the EDIT event of the on DIALOG so that it removes spaces right away.
© mIRC Discussion Forums