Dcx.dll

eyrgo Messages postés 60 Date d'inscription samedi 20 mai 2006 Statut Membre Dernière intervention 28 janvier 2008 - 11 janv. 2007 à 17:47
cs_wims Messages postés 2466 Date d'inscription vendredi 23 juillet 2004 Statut Membre Dernière intervention 1 août 2010 - 5 févr. 2007 à 19:50
Bonjours, je suis nouveau et je script depuis 2 mois.
J'ai un probleme avec la dcx: docker une switchbar.
J'ai essayer de la creer mais en fin de compte il me dit :"D_ERROR Invalid Window to dock */ switch_cb: switch changing 0 */ switch_cb: switch deactivate 0 */ switch_cb: switch changing 0"
J'aimerais savoir qui pourrais m'aider svp?
voici mon code:
alias switch {
  dialog -ma switch switch_table
}

dialog switch_table {
  title "Switch"
  size -1 -1 139 620
  option pixels
}

on *:dialog:switch:*:*: {
  if ($devent == init) {
    dcx Mark $dname switch_cb
    xdock -s $dname +v

    ;// Call initilisation alias
    switch_init_dcx
  }
}

alias -l switch_init_dcx {
  ;// Initialising control: List Des Salons (Box 1)
  xdialog -c $dname 1 box 0 2 138 210
  xdid -t $dname 1 List Des Salons
  xdid -l $dname 1 root $chr(9) +pl 0 1 0 0

  ;// Initialising control: (TreeView 5)
  xdid -c $dname 1 5 treeview 5 15 125 189 haslines showsel tabstop
  xdid -l $dname 5 16

  ;// Initialising control: Contact Mirc (Box 4)
  xdialog -c $dname 4 box 0 480 138 150
  xdid -t $dname 4 Contact Mirc
  xdid -l $dname 4 root $chr(9) +pl 0 1 0 0

  ;// Initialising control: (TreeView 8)
  xdid -c $dname 4 8 treeview 5 15 125 130 haslines showsel tabstop
  xdid -l $dname 8 16

  ;// Initialising control: Lecteur Mp3 (Box 2)
  xdialog -c $dname 2 box 3 214 137 187
  xdid -t $dname 2 Lecteur Mp3
  xdid -l $dname 2 root $chr(9) +pl 0 1 0 0

  ;// Initialising control: (ListView 6)
  xdid -c $dname 2 6 listview 5 15 125 165 report fullrow showsel nolabelwrap tooltip tabstop

  ;// Initialising control: Lecteur Radio (Box 3)
  xdialog -c $dname 3 box 1 405 138 75
  xdid -t $dname 3 Lecteur Radio
  xdid -l $dname 3 root $chr(9) +pl 0 1 0 0

  ;// Initialising control: (ComboEx 7)
  xdid -c $dname 3 7 comboex 5 15 120 23 dropdown tabstop

}

;// Callback alias for switch
alias switch_cb {
  if ($2 != mouse) {
    echo $color(info) -s */ switch_cb: $1-
  }
}

;// quick-access menu item
menu status,channel {
  switch : switch
}
J'ai fais ce code avec le Dcx Studio .

26 réponses

cs_wims Messages postés 2466 Date d'inscription vendredi 23 juillet 2004 Statut Membre Dernière intervention 1 août 2010 1
11 janv. 2007 à 19:48
Remplace les $dname par le nom de ton dialog ( switch_table ) dans l'alias switch_init_dcx car $dname n'est retourné que dans l'event on dialog normalement
0
eyrgo Messages postés 60 Date d'inscription samedi 20 mai 2006 Statut Membre Dernière intervention 28 janvier 2008
12 janv. 2007 à 18:30
Non, meme si je remplace les $dname par Switch_Table dans l'alias Switch_init_dcx cela ne change rien: la switchbar ne docke pas :s .
0
cs_wims Messages postés 2466 Date d'inscription vendredi 23 juillet 2004 Statut Membre Dernière intervention 1 août 2010 1
13 janv. 2007 à 14:07
/xdock -s,

----

This command docks a window to the mIRC SwitchBar.,

----

Syntax:,
/xdock -s [HWND_DOCK] [+FLAGS],

----

Example:,
/xdock -s $dialog(dcx).hwnd +v,

----

Parameters:,

----

HWND_DOCK,
The HWND of the window you wish to dock.,

----

+FLAGS,
Flags for docking into the mIRC SwitchBar.,

----

s,
Docked window will be resized to fit its parent width & height automatically.,

----

h,
Docked window will be resized to fit its parent width automatically.,

----

v,
Docked window will be resized to fit its parent height automatically.,

----

n




Rien qu'en regardant l'exemple tu vois bien qu'il faut donner le hwnd de la fenetre avec $dialog($dname).hwnd
Donc ton /xdock -s $dname +v devient /xdock -s $dialog($dname).hwnd +v
0
eyrgo Messages postés 60 Date d'inscription samedi 20 mai 2006 Statut Membre Dernière intervention 28 janvier 2008
13 janv. 2007 à 14:47
Oui effectivement je n'avais pas fait attention se detail. Merci.
Mais le probleme est toujours là : "D_ERROR Invalid Window to dock " :s
Je te redonne mon code avec les modification que tu ma dis de faire :
alias switch {
  dialog -ma switch switch_table
}

dialog switch_table {
  title "Switch"
  size -1 -1 139 620
  option pixels
}

on *:dialog:switch:*:*: {
  if ($devent == init) {
    dcx Mark switch_cb
    xdock -s $dialog(switch_table).hwnd +v

    ;// Call initilisation alias
    switch_init_dcx
  }
}

alias -l switch_init_dcx {
  ;// Initialising control: List Des Salons (Box 1)
  xdialog -c switch_table 1 box 0 2 138 210
  xdid -t switch_table 1 List Des Salons
  xdid -l switch_table 1 root $chr(9) +pl 0 1 0 0

  ;// Initialising control: (TreeView 5)
  xdid -c switch_table 1 5 treeview 5 15 125 189 haslines showsel tabstop
  xdid -l switch_table 5 16

  ;// Initialising control: Contact Mirc (Box 4)
  xdialog -c switch_table 4 box 0 480 138 150
  xdid -t switch_table 4 Contact Mirc
  xdid -l switch_table 4 root $chr(9) +pl 0 1 0 0

  ;// Initialising control: (TreeView 8)
  xdid -c switch_table 4 8 treeview 5 15 125 130 haslines showsel tabstop
  xdid -l switch_table 8 16

  ;// Initialising control: Lecteur Mp3 (Box 2)
  xdialog -c switch_table 2 box 3 214 137 187
  xdid -t switch_table 2 Lecteur Mp3
  xdid -l switch_table 2 root $chr(9) +pl 0 1 0 0

  ;// Initialising control: (ListView 6)
  xdid -c switch_table 2 6 listview 5 15 125 165 report fullrow showsel nolabelwrap tooltip tabstop

  ;// Initialising control: Lecteur Radio (Box 3)
  xdialog -c switch_table 3 box 1 405 138 75
  xdid -t switch_table 3 Lecteur Radio
  xdid -l switch_table 3 root $chr(9) +pl 0 1 0 0

  ;// Initialising control: (ComboEx 7)
  xdid -c switch_table 3 7 comboex 5 15 120 23 dropdown tabstop
}

;// Callback alias for switch
alias switch_cb {
  if ($2 != mouse) {
    echo $color(info) -s */ switch_cb: $1-
  }
}
0

Vous n’avez pas trouvé la réponse que vous recherchez ?

Posez votre question
cs_wims Messages postés 2466 Date d'inscription vendredi 23 juillet 2004 Statut Membre Dernière intervention 1 août 2010 1
13 janv. 2007 à 16:11
J'ai testé vite fait et avec ce on dialog ca marche bien :

on *:dialog:switch:*:*: {
  if ($devent == init) {
    echo -s $dcx(Mark,$dname switch_cb)
    xdock -s $dialog($dname).hwnd +v
    switch_init_dcx
  }
}
0
eyrgo Messages postés 60 Date d'inscription samedi 20 mai 2006 Statut Membre Dernière intervention 28 janvier 2008
14 janv. 2007 à 14:52
Oui, ca fonctionne je te remerci de ton aide :)
0
eyrgo Messages postés 60 Date d'inscription samedi 20 mai 2006 Statut Membre Dernière intervention 28 janvier 2008
14 janv. 2007 à 20:59
J'ai un autre probleme, cette fois c pas avec dcx mais mdx: Serait il possible de colore tout un combo avec cette dll ?
car jai utilise ce code que j'inscriverai si dessus mais ca ne colorie que une partie du combo
dialog asmp_table {
  icon images/mirc.ico
  title "Menu Principal"
  size -1 -1 420 290
  combo 1, 5 15 410 25, seize drop
  box "Navigateur", 2, 0 0 420 45
  list 3, 5 50 410 215
  button "Fermer", 4, 5 260 410 25, ok flat
}
on *:dialog:asmp:init:*:{
  dll system/dll/mdx.dll SetMircVersion $version
  dll system/dll/mdx.dll MarkDialog $dname
  dll system/dll/mdx.dll SetControlMDX 3 listview autoarange icon hottrack > system/dll/views.mdx
  dll system/dll/mdx.dll SetFont $dname 1 +a 15 500 Lucida Calligraphy
  dll system/dll/mdx.dll SetColor 1 background $rgb(2,5,111)
  dll system/dll/mdx.dll SetColor 1 text $rgb(255,255,255)
  dll system/dll/mdx.dll SetBorderStyle $dname 3 staticedge
}
0
cs_wims Messages postés 2466 Date d'inscription vendredi 23 juillet 2004 Statut Membre Dernière intervention 1 août 2010 1
14 janv. 2007 à 21:02
Oublie MDX et garde DCX tout se que fait MDX, c'est fait en mieux, avec une documentation et DCX fait énormement d'autre chose
0
eyrgo Messages postés 60 Date d'inscription samedi 20 mai 2006 Statut Membre Dernière intervention 28 janvier 2008
15 janv. 2007 à 18:48
ok merci
0
eyrgo Messages postés 60 Date d'inscription samedi 20 mai 2006 Statut Membre Dernière intervention 28 janvier 2008
17 janv. 2007 à 13:58
Re voila j'ai un autre problem avec ma switchbar, bon ce n'est pas vraiment pour la dcx mais bon...
Voila j'ai cree une box et une list pour la liste des salons, mais comment je fais pour que quand je me connect je voi les salons sur lesquelles je suis svp.
j'ai essayer avec dcx mais apparement ce n'est pas possible...
0
cs_wims Messages postés 2466 Date d'inscription vendredi 23 juillet 2004 Statut Membre Dernière intervention 1 août 2010 1
17 janv. 2007 à 19:45
ce n'est pas lorsque tu te connect mais quand tu join un salon, ou quand tu active un server, tu doit rafraichir ta list de server avec $chan(0)
0
eyrgo Messages postés 60 Date d'inscription samedi 20 mai 2006 Statut Membre Dernière intervention 28 janvier 2008
18 janv. 2007 à 19:06
wé encor moi...j'ai fait une boite de dialog avec dcx, celle-ci fonctionne, mais dés que j'ouvre et passe la souri dessus il me dit : "/dialog: 'asmp' name in use (line 3, script2.ini)"
la ligne 3 etant l'alias : "alias asmp dialog -m asmp asmp" voici mon code

alias asmp dialog -m asmp asmp
dialog asmp {
  icon images/mirc.ico
  title "Menu Principal"
  size -1 -1 420 290
  combo 1, 5 15 410 25, seize drop
  box "Navigateur", 2, 0 0 420 45
  list 3, 5 50 410 215
  button "Fermer", 4, 5 260 410 25, ok flat
}
on *:dialog:asmp:init:*:{
  dcx Mark $dname asmp
  xdialog -a asmp +ab 2000
}
0
cs_wims Messages postés 2466 Date d'inscription vendredi 23 juillet 2004 Statut Membre Dernière intervention 1 août 2010 1
18 janv. 2007 à 19:11
quand tu marque le dialog, tu spécifie l'alias de retour pour les event, et comme ta spécifié le nom d'alias asmp, il l'ouvre puisque c'est l'init, il faut changé le nom d'alias et crée le nouveau en conséquence
0
eyrgo Messages postés 60 Date d'inscription samedi 20 mai 2006 Statut Membre Dernière intervention 28 janvier 2008
19 janv. 2007 à 19:54
ok merci
0
eyrgo Messages postés 60 Date d'inscription samedi 20 mai 2006 Statut Membre Dernière intervention 28 janvier 2008
24 janv. 2007 à 16:45
eih le problem est tjrs la meme si je change l'aliase il me dit la meme chose
0
cs_wims Messages postés 2466 Date d'inscription vendredi 23 juillet 2004 Statut Membre Dernière intervention 1 août 2010 1
25 janv. 2007 à 20:51
reposte ton code avec l'alias modifié
0
eyrgo Messages postés 60 Date d'inscription samedi 20 mai 2006 Statut Membre Dernière intervention 28 janvier 2008
26 janv. 2007 à 17:42
voila
alias conn dialog -m asmdp asmdp
dialog asmdp {
  title "Menu De Personnalisation"
  size -1 -1 398 282
  icon images/mirc.ico
  option pixels
  box "Navigateur", 4, 6 2 388 50
  combo 1, 15 15 370 100, size drop
  button "Fermer", 2, 10 250 377 25, ok flat
  list 3, 15 90 370 152, size
}
on *:dialog:asmdp:init:*:{
  dcx Mark $dname conn
  xdialog -a conn +v 2000
}
0
cs_wims Messages postés 2466 Date d'inscription vendredi 23 juillet 2004 Statut Membre Dernière intervention 1 août 2010 1
27 janv. 2007 à 14:51
C'est une blague ? ta juste changé le nom de l'alias callback, il faut que l'alias qui ouvre le dialog sois différent de celui que tu donne comme callback alias dans le /dcx Mark

alias asmdp dialog -m asmdp asmdp
dialog asmdp {
  title "Menu De Personnalisation"
  size -1 -1 398 282
  icon images/mirc.ico
  option pixels
  box "Navigateur", 4, 6 2 388 50
  combo 1, 15 15 370 100, size drop
  button "Fermer", 2, 10 250 377 25, ok flat
  list 3, 15 90 370 152, size
}
on *:dialog:asmdp:init:*:{
  dcx Mark $dname conn
  xdialog -a conn +v 2000
}

alias conn { }
0
eyrgo Messages postés 60 Date d'inscription samedi 20 mai 2006 Statut Membre Dernière intervention 28 janvier 2008
27 janv. 2007 à 16:47
Haan ok
Ca fonctionne, j'ai compris :) je te remercis de ton aide!
Mais :s j'ai un autre probleme: Lecteur Mp3.
J'aimerais savoir comment on fait pour les modes: continue, aleatoire, repeat, sachant que le diallog du mp3 ce presente comme ceci:
dialog mp3x {
  title "Lecteur Mp3"
  icon images/mirc.ico
  size -1 -1 398 267
  option pixels
  menu "Playlist", 1
  item "Charger un dossier", 2, 1
  item "Charger un fichier", 3, 1
  menu "Options", 4
  item "Lecture", 5, 4
  menu "A Propos", 6
  item "Lecteur mp3", 7, 6
  button "PLay", 8, 10 230 55 25
  button "Pause", 10, 70 230 55 25
  button "Stop", 11, 130 230 55 25
  button "Option", 15, 190 230 55 25
  button "charger", 18, 250 230 45 25
  button "A Propos", 17, 310 230 55 25
  list 9, 10 39 375 163, size
  edit "00:00", 16, 10 10 95 21, read center
  edit "", 12, 120 10 270 21, read autohs
  edit "", 20, 7 210 375 10
}
et que le dialog optionel est comme ca:
dialog opt1 {
  title "Options"
  icon images/mirc.ico
  size -1 -1 368 234
  option pixels
  box "Modes De Lecture", 1, 2 2 144 100
  radio "Lecture Continue", 2, 8 20 108 20
  radio "Lecture Répéter", 3, 8 44 108 20
  radio "Lecture Aléatoire", 4, 8 68 108 20
  }
0
cs_wims Messages postés 2466 Date d'inscription vendredi 23 juillet 2004 Statut Membre Dernière intervention 1 août 2010 1
28 janv. 2007 à 20:19
En supposant que toutes la musique sois dans la list :

l'aleatoire : joue une chanson au pif donc $did(9,$r(1,$did(9,0).lines)) retourne la musique au pif sur tout les musique

Continue, tu stock la position de la chanson actuellement joué et la suivant c'est la suivant ( $calc(pos + 1) ) fait gaffe a la derniere chanson, si la chanson en cour est la derniere chanson de la list ( if (pos == $did(9,0).lines) ) tu dois joué la premiere chanson

repear bah tu rejoue la meme chanson

donc dans le dialog opt1 quand tu click, tu stock le choix de lecture et quand une chanson de finis ( /help on mp3end ) tu agit selon ce que ta stocké
0
Rejoignez-nous