halias shell {
  return %LRpopupico
}

alias xpopdll {
  if ($isid) return $dll($mircirdlls\xpopup.dll,$1,$2-)
  else dll " $+ $mircdirdlls\xpopup.dll" $1 $2-
}

alias uxpop dll -u xpopup.dll

alias xpop {

  if ( $isid ) {
    return $xpopdll( _xpop, $1 $prop $2- )
  }
  else {
    xpopdll xpop $2 $1 $3-
  }
}

alias xpopup {

  if ( $isid ) {
    return $xpopdll( _xpopup, $1 $prop $2- )
  }
  else {
    xpopdll xpopup $2 $1 $3-
  }
}

alias mpopup {
  xpopdll mpopup $1 $2
}

ON *:SIGNAL:Xpopup-*: { 
  echo -s $signal : $1-
}

alias xtest { 

  if ( $xpopup(mymenu).ismenu == $false ) {

    xpopup -c mymenu custom
    xpopup -x mymenu +dp

    xpopup -b mymenu %LRpopup

    xpopup -i mymenu 0 $shell

    xpop -a mymenu 0 $chr(9) + 1 1 Menu Item 2 $chr(9) blah
    xpop -a mymenu 0 $chr(9) + 0 0 -
    xpop -a mymenu 0 $chr(9) +s 2 1 Menu Item 2

    xpop -a mymenu 3 0 $chr(9) + 10 1 $eval($me,0)
    xpop -a mymenu 3 0 $chr(9) + 0 0 -
    xpop -a mymenu 3 0 $chr(9) +c 11 0 Menu Item 2 2

    xpop -a mymenu 0 $chr(9) +c 3 0 Menu Item 3
    xpop -a mymenu 0 $chr(9) +cg 4 0 Menu Item 4
    xpop -a mymenu 0 $chr(9) +g 5 1 Menu Item 5
    xpop -a mymenu 0 $chr(9) +c 6 1 Menu Item 6
    xpop -a mymenu 0 $chr(9) +cg 7 1 Menu Item 7
  }

  xpopup -s mymenu +mcv 500 500
}

alias mtest {
  xpopup -i mirc 0 $shell
  mpopup mirc 1
  xpopup -t mirc custom
  xpopup -b mirc %LRpopup

}

alias mtest2 {
  xpopup -i mircbar 0 $shell
  mpopup mircbar 1
  xpopup -t mircbar custom
  xpopup -b mircbar %LRpopup
}

on *:start: { 
  .set %LRpopup gp.bmp
  mtest
  mtest2
}
