mIRC Home    About    Download    Register    News    Help

Print Thread
Disable space in a dialog #187721 11/10/07 05:55 AM
Joined: Apr 2006
Posts: 400
K
Kurdish_Assass1n Offline OP
Fjord artisan
OP Offline
Fjord artisan
K
Joined: Apr 2006
Posts: 400
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.


-Kurdish_Assass1n
Re: Disable space in a dialog [Re: Kurdish_Assass1n] #187726 11/10/07 12:54 PM
Joined: Nov 2006
Posts: 1,559
H
Horstl Offline
Hoopy frood
Offline
Hoopy frood
H
Joined: Nov 2006
Posts: 1,559
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)) }

Re: Disable space in a dialog [Re: Kurdish_Assass1n] #187779 12/10/07 10:16 AM
Joined: Oct 2004
Posts: 8,330
Riamus2 Offline
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
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.


Invision Support
#Invision on irc.irchighway.net