mIRC Home    About    Download    Register    News    Help

Topic Options
#35893 - 12/07/03 09:11 AM sclick in an edit box
Xanadu Offline
Ameglian cow

Registered: 02/07/03
Posts: 39
I have a dialog with an edit box linked to %varname. %vaname's info is a folder. What I would like to do is set it to open $sdir when the edit box is clicked, but it is not working for me. Any ideas how to do this with 6.03?

Thanks

Top
#35894 - 12/07/03 11:07 AM Re: sclick in an edit box
Hammer Offline
Hoopy frood

Registered: 07/12/02
Posts: 1321
Loc: Georgia, USA
From /help $sdir:

$sdir(dir,title)
Displays the select folder dialog and returns the selected folder. Title is optional.

From that, it would seem logical that you could probably use /run $$sdir(%varname, Message goes here), like this:
Code:

on *:DIALOG:dname:sclick:EditID: run $$sdir(%varname, Folder: %varname)

The problem is that an edit control does not react to :sclick: or :dclick:, so you'll have to give it a button to kick it off.
Code:

alias bergle dialog -m bergle bergle
 
dialog bergle {
  option dbu
  size -1 -1 100 100
  title Testing editbox sclick event
 
  edit   ""    , 1,  5  5 90 13
  button "Open", 2, 40 80 20 15, ok
}
 
on *:DIALOG:bergle:*:*:{
  var %varname = $getdir(jpg)
  if $devent != mouse echo -s * Event: $devent for ID: $did
  if $devent == init did -a $dname 1 %varname
  if $devent == sclick && $did == 2 run $sdir(%varname, Pick your poison $+ $chr(3) pardner)
}

You can use this sample code to show how clicking like a fiend in the editbox generates no events, then click on the Open button and see how everything works from there. (I filtered out the mouse event to keep you from going insane; however, be aware that anytime you move your mouse over the dialog, a mouse event is generated...LOTS of them.)
_________________________
DALnet: #HelpDesk and #m[color:#FF0000]IR[color:#EEEE00]C

Top
#35895 - 12/07/03 03:36 PM Re: sclick in an edit box
Xanadu Offline
Ameglian cow

Registered: 02/07/03
Posts: 39
I was hoping there was a way to get it to trigger off a click in the editbox instead of a button, but thanks.

Top
#35896 - 12/07/03 03:38 PM Re: sclick in an edit box
pheonix Offline
Hoopy frood

Registered: 06/05/03
Posts: 2265
put a button over the edit box and then hide the buttn so it looks like a click on the edit box cool
_________________________
new username: tidy_trax

Top