mIRC Home    About    Download    Register    News    Help

Print Thread
#35893 12/07/03 08:11 AM
Joined: Jul 2003
Posts: 39
X
Xanadu Offline OP
Ameglian cow
OP Offline
Ameglian cow
X
Joined: Jul 2003
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

#35894 12/07/03 10:07 AM
Joined: Dec 2002
Posts: 1,321
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Dec 2002
Posts: 1,321
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
#35895 12/07/03 02:36 PM
Joined: Jul 2003
Posts: 39
X
Xanadu Offline OP
Ameglian cow
OP Offline
Ameglian cow
X
Joined: Jul 2003
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.

#35896 12/07/03 02:38 PM
Joined: May 2003
Posts: 2,265
P
Hoopy frood
Offline
Hoopy frood
P
Joined: May 2003
Posts: 2,265
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

Link Copied to Clipboard