mIRC Home    About    Download    Register    News    Help

Print Thread
#138150 24/12/05 08:05 PM
Joined: Aug 2005
Posts: 30
S
Ameglian cow
OP Offline
Ameglian cow
S
Joined: Aug 2005
Posts: 30
This is probably going to be the last time I annoy people with text. I've been testing lots and lots of times trying to get the same result as the /uwho dialog interface. How does it produce that scrollable text without the shaded box that edit has when you use read, so you can highlight things and copy them? I've looked up at least 3 dialog tutorials and I just can't seem to get it without that ugly shaded box.

#138151 24/12/05 09:40 PM
Joined: Dec 2002
Posts: 1,245
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Dec 2002
Posts: 1,245
If I understood you correctly you want to replicate the uwho dialog, but have it so that the information can be copied to a text or some other medium.
just to show the thing done with a listbox and the same data in text fields, and then getting the data out of the text fields in (in this case echo) perform a command on that info to display/save it.

Code:
alias listboxtest { dialog -m listbox listbox }
dialog listbox {
  Title "Listbox Test"
  size -1 -1 200 130
  option dbu
  list 100, 0 0 200 38
  text "", 200, 1 40 198 19
  text "", 300, 1 60 198 19
  text "", 400, 1 80 198 19
  button "Copy", 900, 25 100 50 10
}

on *:dialog:listbox:init:0:{
  whois $me $me
  version $me 
  did -f listbox 900
}
raw 311:*:{
  did -a listbox 100,200 $2 $3 $+ @ $+ $4
  did -a listbox 100,400 $5-
  halt
}

raw 317:*:{
  echo 3 -s raw317 $3 . $4
  did -a listbox 100,300 $duration($3) Signed On: $asctime($4)
  halt
}

on *:dialog:listbox:sclick:900:{
  echo -s $did(listbox,200).text $did(listbox,300).text $did(listbox,400).text
}

---- snippet to find raw codes ----

menu menubar {
  Show &RAW codes: $iif($group(#showraw) == off,.enable #showraw, .disable #showraw) | echo $color(action) -a RAW Code Display $group(#showraw) 
}
#showraw off
raw *:*:echo 4 -a $numeric $2-
#showraw end


Hope this helps and Merry Christmas/Happy Chanukah

#138152 25/12/05 12:26 AM
Joined: Aug 2005
Posts: 30
S
Ameglian cow
OP Offline
Ameglian cow
S
Joined: Aug 2005
Posts: 30
I copied your code exactly and loaded it, ticked "show raw codes" on, and used your listbox alias. When I clicked copy, I got the following errors:
* /did: 'listbox' invalid id '100' (line 17, testdialog.mrc)
Line 17 is: did -a listbox 100,200 $2 $3 $+ @ $+ $4
* /did: 'listbox' invalid id '100' (line 23, testdialog.mrc)
Line 23 is: echo 3 -s raw317 $3 . $4
* /echo: insufficient parameters (line 27, testdialog.mrc)
Line 27 is: echo -s $did(listbox,200).text $did(listbox,300).text $did(listbox,400).text


Nothing appeared on the dialog. Also, I'm not just trying to reproduce /uwho, I need to reproduce it so I can use it in other dialogs as well; ones that show values of things just like the /uwho dialog shows.

-Happy Holidays

#138153 25/12/05 04:59 AM
Joined: Dec 2002
Posts: 1,245
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Dec 2002
Posts: 1,245
while by no means a finished product, you do have to have the dialog open or those errors will result because the events occur, the code fires, the dialog doesnt exist and it errors. You say you got those errors after pressing the copy button, yet the only time I got those errors is when I had done a whois and the dialog wasnt open.

the raw tool I included in my post is just so you can see the raw events as mIRC sees them and you can then filter out the information you want in the way you want. I didnt put in code to stop all the raws that are received for that, again, its sample code.

/clear your status window, /listboxtest to open the dialog, in the init section it does "/whois $me $me".

the dialog should be populated with:
nick [email]user@host[/email]
"real name"
idle time and signon time

in two areas: (1) a listbox that has the margins set to the width of the dialog so you dont see the frame and (2) in three text IDs that are more like the dialog you see in uwho. This is where the "copy" button gets the info from that is to be echoed into status.

if it isn't, then dump my code, because your system isnt working the same as mine and I can't help you.

if it is populated with those items click the copy button, in status you should see the data the same as it was in the text area of the dialog. Again, if it doesn't then there is either something else going on or your system and mine are not working the same and you should dump my code and maybe someone else might offer a solution that will help you with not seeing the ugly listbox in your dialog and still be able to copy the info out.

in either case the code for displaying raw codes should still be working, you didnt say if that was or not.
remove the code
Code:
alias listboxtest { dialog -m listbox listbox }
dialog listbox {
  Title "Listbox vs Text Field Test"
  size -1 -1 200 90
  option dbu
  list 100, 0 0 200 38
  text "", 200, 1 40 198 9, center
  text "", 300, 1 50 198 9, center
  text "", 400, 1 60 198 9, center
  button "Copy", 900, 75 75 50 10
}

on *:dialog:listbox:init:0:{
  whois $me $me
  version $me 
  did -f listbox 900
}
raw 311:*:{
  did -a listbox 100,200 $2 $3 $+ @ $+ $4
  did -a listbox 100,300 $5-
  halt
}

raw 317:*:{
  echo 3 -s raw317 $3 . $4
  did -a listbox 100,400 Idle: $duration($3) Signed On: $asctime($4)
  halt
}

on *:dialog:listbox:sclick:900:{
  echo -s $did(listbox,200).text
  echo -s $did(listbox,300).text
  echo -s $did(listbox,400).text 
}


with that safely gone, keep the raw group and that menu, and it will show you the raw codes and what data is associated with each.

Merry Christmas or Happy Chanukah if you celebrate either.

#138154 25/12/05 08:47 PM
Joined: Aug 2005
Posts: 30
S
Ameglian cow
OP Offline
Ameglian cow
S
Joined: Aug 2005
Posts: 30
The thing is, not only do I want to be able to copy the contents, I want to be able to scroll through it like the uwho dialog, but it doesn't allow you to without the edit option on read, which is quite ugly.
Oh, and sorry, I messed up with the paste. I just realized that id 100 on mine was screwed up which was why I was getting errors, stupid me, heh.
I'm guessing there's no way to have text autohs scrollable like on the uwho dialog. Is there a dll that would allow it, or am I stuck? Also, would you happen to know the use of "scroll"? I can't seem to figure it out :\

#138155 25/12/05 09:46 PM
Joined: Dec 2002
Posts: 1,245
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Dec 2002
Posts: 1,245
"-z resets the width of horizontal scrollbar in listbox"
Code:
alias lbscroll dialog -m listboxscroll listboxscroll
dialog listboxscroll {
  title "Scroll Update"
  size -1 -1 100 50
  option dbu
  list 100, 1 1 98 49, hsbar
}
on *:dialog:listboxscroll:init:0:{
  var %null = $findfile($mp3dir,*.mp3,0, did -a listboxscroll 100 $1-)
  did -z listboxscroll 100
}

#138156 26/12/05 02:11 AM
Joined: Aug 2005
Posts: 30
S
Ameglian cow
OP Offline
Ameglian cow
S
Joined: Aug 2005
Posts: 30
Not that scroll, this one:
scroll "text", id, x y w h, style (top left bottom right horizontal range N N)

It's...rather mysterious :\

#138157 26/12/05 05:49 AM
Joined: Dec 2002
Posts: 1,245
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Dec 2002
Posts: 1,245
mysteries reveled in
Code:
alias scrolltest { dialog -m scroll scroll }
dialog scrollbar {
  title scrollbar test
  size -1 -1 100 50
option dbu
  text "", 100, 1 1 98 20, center
  scroll "", 200, 5 30 90 10, horizontal range 0 65500
}
on *:dialog:scrollbar:init:0:{ did -c scrollbar 200 $vol(mp3) | .splay $findfile($mp3dir,*.mp3,1) }
on *:dialog:scrollbar:scroll:200:{ did -ra scrollbar 100 $did(scrollbar,200).sel | vol -p $did(scrollbar,200).sel }


Edit added DBU to the dialog

Last edited by MikeChat; 26/12/05 06:25 AM.
#138158 26/12/05 08:52 AM
Joined: Dec 2002
Posts: 3,138
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 3,138
As I understand your post: You want a text control that can be selected and scrolled by clicking and dragging, and copied using control+c or right-click>Copy.

Unfortunately I don't think this is possible in mIRC dialogs. The closest thing you can use are edit controls with the read style, though you said you didn't want the box around the text.

Neither of the two dialog extension DLLs (MDX and DCX) seem to offer this functionality either.

#138159 26/12/05 04:27 PM
Joined: Aug 2005
Posts: 30
S
Ameglian cow
OP Offline
Ameglian cow
S
Joined: Aug 2005
Posts: 30
Thanks Collective/Mike (I finally understand how it works, danke). I'll go post it in the request section.

#138160 26/12/05 08:04 PM
Joined: Dec 2002
Posts: 3,138
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 3,138
Contrary to what I said before, MDX does have a command to remove the border of an edit box.

It can be done with the SetBorderStyle funtion. Here is an example:

Code:
alias borderexample { dialog -m bordex bordex }
dialog bordex {
  title "Edit box without border example"
  size -1 -1 50 20
  option dbu
  edit "A piece of text long enough to scroll", 312, 5 5 40 10, autohs read
}
on *:DIALOG:bordex:init:0:{
  echo -a Marking dialog: $dll([color:brown]mdx.dll[/color],MarkDialog,$dname $dialog($dname).hwnd)
  echo -a Removing border: $dll([color:brown]mdx.dll[/color],SetBorderStyle,$dname 312)
}


The brown text would be replaced with the path to mdx.dll on your system.

Sorry for the misinformation in my previous post.


Link Copied to Clipboard