mIRC Home    About    Download    Register    News    Help

Print Thread
Page 1 of 2 1 2
#233000 07/07/11 05:08 PM
Joined: May 2011
Posts: 14
N
nnvi Offline OP
Pikka bird
OP Offline
Pikka bird
N
Joined: May 2011
Posts: 14
Hey

I'm trying to get this to work

Hope you understand what i'm trying to do...



dialog n {
title "New Project"
size -1 -1 250 133
option dbu
list 1, 0 0 61 133, size
tab "Tab 1", 2, 67 2 127 89
tab "Tab 2", 3
tab "Tab 3", 4
}

on *:dialog:n:init:0:{
mdx MarkDialog $dname
mdx SetControlMDX $dname 1 Treeview fullrowselect singleexpand nohscroll showsel > $views.mdx
did -i $dname 1 1 setitemheight 26
did -a $dname 1 $chr(160) 1
did -a $dname 1 $chr(160) 2
did -a $dname 1 $chr(160) 3
did -c $dname 1 2
}

on *:dialog:n:sclick:1:{
if ($did(1).seltext = 2) did -f n 3
}

nnvi #233005 07/07/11 07:45 PM
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
You should always explain what you are trying to do and what isn't working. Just providing code and screenshots is never a good idea because anyone helping you is likely to waste time trying to find out what you are trying to do and what the problem is when you could explain it really quickly.

That said, I'm guessing that you are trying to make clicking on the list number change the tab automatically. If that's what you're having trouble with, it appears to work here without MDX (I don't have MDX to test right now). So either you have some other problem or else it's related to how you are using MDX.

Also, keep in mind that MDX is outdated and will probably not be updated again. It is also not fully functional in the current version of mIRC (most things work, some do not). You would be much better off using DCX, which does the same things that MDX does (and more) and it is kept updated.


Invision Support
#Invision on irc.irchighway.net
nnvi #233008 07/07/11 09:06 PM
Joined: May 2011
Posts: 14
N
nnvi Offline OP
Pikka bird
OP Offline
Pikka bird
N
Joined: May 2011
Posts: 14
Well i didnt know that MDX was no longer supported!

Am not very good with DCX at all!

nnvi #233010 07/07/11 09:10 PM
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
It's very similar to MDX and they have very helpful people if you run into problems. It's up to you, but eventually, MDX won't work at all. It's usually better to start changing to the new option sooner rather than later.


Invision Support
#Invision on irc.irchighway.net
Riamus2 #233018 08/07/11 08:37 AM
Joined: May 2011
Posts: 14
N
nnvi Offline OP
Pikka bird
OP Offline
Pikka bird
N
Joined: May 2011
Posts: 14
I will give dcx another go.

How do i make a dialog with DCX?

can i use dialog studio

Last edited by nnvi; 08/07/11 08:37 AM.
nnvi #233022 08/07/11 10:20 AM
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
I doubt what you have is designed for it, but you could probably use it and then make any changes necessary. Otherwise, there may be something that is designed for DCX. I have never looked because I just write dialogs instead of using any studios. Maybe someone else knows of something here or you might as on the DCX forum.


Invision Support
#Invision on irc.irchighway.net
Riamus2 #233023 08/07/11 11:06 AM
Joined: May 2011
Posts: 14
N
nnvi Offline OP
Pikka bird
OP Offline
Pikka bird
N
Joined: May 2011
Posts: 14
Ok,

At the moment i just have this:

dialog n {
title "New Project"
size -1 -1 250 133
option dbu
}

Now i would like List control from DCX


How would i go about doing this

Would it be something like this

on *:dialog:n:init:0: {
xdid -a dcx 4 1 number one
}
alias n sclick 4 1 did -f n 3




nnvi #233025 08/07/11 12:00 PM
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
From the DCX site:
Quote:
/xdid -a [DNAME] [ID] [N] [Item Text]


DNAME is the dialog name. For you, that's n.
ID is the ID of the list box. I don't see a list box created in the dialog example that you just gave. Create one and use the same ID here as you do there. In your first post, the list box was ID 1.
N is where you want to add the line... 0 is at the end, or other numbers insert it at that line number.
ITEM TEXT is, of course, the text you want to add.

So, assuming the list box is ID 4 and you want to add the line to the end of the list, /xdid would look like this (Replace Text with the number/text you want to add):

Code:
/xdid -a n 4 0 Text


And your alias is missing the alias name and not set up correctly.

You need a callback alias with DCX to handle mouse events (and perhaps others). You need to mark the dialog in with the callback alias name you want to use. For example, lets say you just use callback_n for the alias name. In the dialog init, you need to use:

Code:
dcx Mark n callback_n


Then, you need the callback alias...

Code:
alias callback_n {
  ; Below is the dialog/mouse event
  if ($2 == sclick) {
    ; Below is the ID of that was clicked
    if ($3 == 4) {
      ; You may need to verify this, but I believe this is
      ; correct for N (line #) that was clicked (below).
      ; You can put "echo -a $1-" (no quotes) as the first line
      ; in the alias to see what data is sent to the alias.
      if ($4 == 1) { did -f n 3 }
    }
  }
}


I haven't done much with DCX in over a year and can't test right now, but that should give you enough to get started. Try looking at the tutorials on the DCX site here. It will give you an idea of how the callback alias works.


Invision Support
#Invision on irc.irchighway.net
Riamus2 #233026 08/07/11 12:32 PM
Joined: May 2011
Posts: 14
N
nnvi Offline OP
Pikka bird
OP Offline
Pikka bird
N
Joined: May 2011
Posts: 14
Code:
dialog n {
  title "New Project"
  size -1 -1 250 133
  option dbu
}

on *:dialog:n:init:0:{
  dcx Mark n cb_n
  xdialog -b $dname +ty
  n_init
}

alias -l n_init {
  xdialog -c $dname 1 list 5 5 150 100
  xdid -a n 1 0 Text
}

alias cb_n {
  if ($2 == sclick) {

    if ($3 == 4) {
      if ($4 == 1) { did -f n 3 }
    }
  }
}

Last edited by nnvi; 08/07/11 12:54 PM.
nnvi #233028 08/07/11 01:06 PM
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
You created the list box with ID 1, but did not change the ID in the callback alias to match. $3 is your ID, so check if $3 == 1. And like I mentioned, I do not know for certain if $4 is the line number N in the list box, so that may or may not work as it currently is. Using the echo like I mentioned will give you a good idea of the format being used.

Also, I'm not sure if $dname is passed to the n_init alias or not. You'd need to test it to see. If not, you'll want to just put the dialog name instead (n).

Also, don't forget that you are using /did -f on ID 3 (a tab) and your current script doesn't have any tabs (or ID 3) yet.


Invision Support
#Invision on irc.irchighway.net
Riamus2 #233031 08/07/11 01:40 PM
Joined: May 2011
Posts: 14
N
nnvi Offline OP
Pikka bird
OP Offline
Pikka bird
N
Joined: May 2011
Posts: 14
yeah, i will use the echo. And for the tabs i will add them as a normal mirc control... Thanks for ya help, am out now, will try later and let you know!

Riamus2 #233032 08/07/11 02:33 PM
Joined: May 2011
Posts: 14
N
nnvi Offline OP
Pikka bird
OP Offline
Pikka bird
N
Joined: May 2011
Posts: 14
Code:
alias dcx {
  if ($isid) returnex $dll($scriptdirdcx.dll,$1,$2-)
  else dll " $+ $scriptdirdcx.dll" $1 $2-
}
alias xdock {
  if ($isid) returnex $dcx( _xdock, $1 $prop $2- )
  dcx xdock $1-
}
alias xdid { if ( $isid ) returnex $dcx( _xdid, $1 $2 $prop $3- ) | dcx xdid $2 $3 $1 $4- }
alias xdialog { if ( $isid ) returnex $dcx( _xdialog, $1 $prop $2- ) | dcx xdialog $2 $1 $3- }
dialog n {
  title "New Project"
  size -1 -1 250 133
  option dbu
  tab "Tab 1", 2, 67 2 127 89
  tab "Tab 2", 3
  tab "Tab 3", 4
}
dialog n {
  title "New Project"
  size -1 -1 250 133
  option dbu
}

on *:dialog:n:init:0:{
  dcx Mark n cb_n
  xdialog -b $dname +ty
  n_init
}

alias -l n_init {
  xdialog -c n 1 list 1 1 100 200
  xdid -a n 1 0 Text
}
;0 0 61 133
alias cb_n {
  if ($2 == sclick) {

    if ($3 == 4) {
      if ($4 == 1) { echo -a iguyg }
    }
  }
}


nnvi #233033 08/07/11 03:10 PM
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Your $3 in the callback alias still checks against 4, while your list box ID is 1. That 4 should be a 1. And the echo should be the first line in the alias (use //echo -a $1- so that you get all of the infomation being passed and can tell what you need to include in your IF statements).

Anyhow, after that, if you post the script, please make note of whether it is currently working or not and if not, what's wrong.


Invision Support
#Invision on irc.irchighway.net
Riamus2 #233034 08/07/11 04:01 PM
Joined: May 2011
Posts: 14
N
nnvi Offline OP
Pikka bird
OP Offline
Pikka bird
N
Joined: May 2011
Posts: 14
Now got it working!



Code:
dialog n {
  title "New Project"
  size -1 -1 250 133
  option dbu
  tab "Tab 1", 2, 67 2 127 89
  tab "Tab 2", 3
  tab "Tab 3", 4
}
dialog n {
  title "New Project"
  size -1 -1 250 133
  option dbu
}

on *:dialog:n:init:0:{
  dcx Mark n cb_n
  xdialog -b $dname +ty
  n_init
}

alias -l n_init {
  xdialog -c n 1 list 1 1 100 200
  xdid -a n 1 0 Text
}
;0 0 61 133
alias cb_n {
  if ($2 == sclick) {

    if ($3 == 1) {
      if ($4 == 1) { did -f n 3 }
    }
  }
}




Now i have to work out how to center the text and "setitemheight" (like mdx) ..... any idea

nnvi #233036 08/07/11 05:39 PM
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
From a quick glance, I don't see how to do those. You should ask on the DCX forum. If it's not currently available, you can suggest those and they are good at getting new things added that they think are good suggestions.

As a note, the "centering" you were doing in your original MDX code above was just using $chr(160) to space the text in. You could do something similar here as well.


Invision Support
#Invision on irc.irchighway.net
nnvi #233123 14/07/11 08:20 PM
Joined: Sep 2005
Posts: 2,881
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
DCX has its' own tab control, you shouldn't use mIRC's tabs with a dialog that uses DCX.

If you're using DCX, use DCX alone.

I used to develop for DCX and can confirm you can run into problems trying to mix up different dialog methods..

Riamus2 #233179 17/07/11 09:25 PM
Joined: May 2011
Posts: 14
N
nnvi Offline OP
Pikka bird
OP Offline
Pikka bird
N
Joined: May 2011
Posts: 14
Now stuck with this "SCLICK" for a button

Code:
on *:dialog:ny:init:0:{
  dcx Mark $dname cb_n
  xdialog -b $dname +ty
  n_init
}
alias -l n_init {
  xdialog -c ny 1 button 1 1 100 200
  xdid -t ny 1 Button text
}
;0 0 61 133
alias cb_n {
  if ($1 == sclick) { did -f ny 2
  }
}

nnvi #233193 18/07/11 10:55 AM
Joined: May 2011
Posts: 14
N
nnvi Offline OP
Pikka bird
OP Offline
Pikka bird
N
Joined: May 2011
Posts: 14
How do i make muti sclick's

i got this but no luck
Code:
alias cb_n {
  if $3 == 1 {
    if $2 == sclick {
      did -f ny 3
    }
    elseif $3 == sclick {
      did -f ny 2
    }
  }
}


nnvi #233194 18/07/11 11:44 AM
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
You are already checking if $3 == 1, so how can it also equal sclick? Check the documentation on the DCX site to see what each $1,$2,$3,$4 are for. More than likely (I didn't check), $4 is the ID number you need to determine which line was clicked. If so, then use that to determine what you want to do.

And, again, the DCX forum is the best place to ask DCX questions. Even if some of us here have used it to some extent, a lot more people there will have used it even more and be able to more easily answer your questions. They will probably know the answers right away, while we may have to look it up for you.


Invision Support
#Invision on irc.irchighway.net
Riamus2 #233199 18/07/11 07:04 PM
Joined: May 2011
Posts: 14
N
nnvi Offline OP
Pikka bird
OP Offline
Pikka bird
N
Joined: May 2011
Posts: 14
Thanks Riamus2 i will have a look.

I've been to DCX a few times and the forums are dead

Page 1 of 2 1 2

Link Copied to Clipboard