mIRC Homepage
Posted By: tidy_trax picwin - 24/02/04 07:15 PM
Code:
alias drawnotify {
  if !$window(@notify) { window -dk0pz +b @notify 0 0 180 300 }
  drawrect -fr @notify $rgb(224,235,246) 1 0 0 180 20
  drawrect -r @notify $rgb(109,109,109) 1 0 0 180 20
  drawtext -r @notify $rgb(109,109,109) Bright 11 5 5 Notify List 
}
menu @notify {
  sclick:{
    if $inrect($mouse.x,$mouse.y,0,0,180,20) { hadd -m notify move 1 }
  }
  uclick:{
    if $hget(notify,move) { .hfree notify }
  }
  mouse:{
    if $hget(notify) { window @notify $calc($mouse.dx - $mouse.x) $calc($mouse.dy - $mouse.y) }
  }
  leave:{
    if $hget(notify) { .hfree notify }
  }
}
on *:close:@notify:{ .hfree notify }

how could i make it so my mouse stays where it was in the "titlebar" before it moved?
Posted By: module Re: picwin - 24/02/04 09:36 PM
Try this, it's little off with the moving but by like 3 or 4 points. I havent figured out the titlebar part, yet. If I do I'll post it.
Code:
alias drawnotify {
  if (!$window(@notify)) { window -dk0pz +b @notify 0 0 180 300 }
  drawrect -fr @notify $rgb(224,235,246) 1 0 0 180 20
  drawrect -r @notify $rgb(109,109,109) 1 0 0 180 20
  drawtext -r @notify $rgb(109,109,109) Bright 11 5 5 Notify List
}
alias -l notify_win_move {
  if ((%mouse.x) && (%mouse.y)) {
    var %mx $mouse.mx, %my $mouse.my, %win @notify
    window %win $calc((%mx - %mouse.x) - 3) $calc((%my - %mouse.y) - 3) $window(%win).width 80
  }
}
menu @notify {
  sclick:{
    if ($timer(notify_win_move)) {
      .timernotify_win_move off
      return
    }
    set %mouse.x $mouse.x
    set %mouse.y $mouse.y
    .timernotify_win_move -m 0 1 notify_win_move
  }
  uclick: {
    .timernotify_win_move off
    unset %mouse.x %mouse.*
  }
  leave: {
    .timernotify_win_move off
    unset %mouse.*
  }
}
on 1:close:@notify:.timernotify_win_move off
Posted By: tidy_trax Re: picwin - 24/02/04 10:33 PM
thanks but i nearly got it worked out without a timer, the x pos works.. but y doesn't

Code:
      echo -s window @notify $calc($mouse.mx - ($mouse.mx - $hget(notify,x))) $calc($mouse.my - ($mouse.my - $hget(notify,y))) 
      hadd -m notify x $mouse.mx
      hadd -m notify y $mouse.my

anyone know why?
y pos is a negative number
Posted By: module Re: picwin - 24/02/04 10:39 PM
If show the entire code, i may be able to figure it out..
Posted By: tidy_trax Re: picwin - 24/02/04 10:40 PM
Code:
menu @notify {
  sclick:{
    if $mouse.x isnum 1-150 && $mouse.y isnum 1-20 { 
      hadd -m notify move 1 
      hadd -m notify x $mouse.mx
      hadd -m notify y $mouse.my
    }
    elseif $mouse.x isnum 155-165 && $mouse.y isnum 1-20 { window -n @notify }
    elseif $mouse.x isnum 165-175 && $mouse.y isnum 1-20 { window -c @notify } 
    elseif $mouse.x isnum 160-180 && $mouse.y isnum 20-40 {
      if $scon($calc(%scon -1)) { 
        dec %scon 
        drawnotify %scon
      }
    }
    elseif $mouse.x isnum 160-180 && $mouse.y isnum 280-300 { 
      if $scon($calc(%scon +1)) { 
        inc %scon 
        drawnotify %scon
      }
    }
  }
  uclick:{
    if $hget(notify,move) { .hfree notify }
  }
  mouse:{
    if $hget(notify) { 
      echo -s window @notify $calc($mouse.mx - ($mouse.mx - $hget(notify,x))) $calc($mouse.my - ($mouse.my - $hget(notify,y))) 
      hadd -m notify x $mouse.mx
      hadd -m notify y $mouse.my
    }
  }
  leave:{
    if $hget(notify) { .hfree notify }
  }
}

all code relevant with x/y pos is there.
Posted By: Man Re: picwin - 25/02/04 08:10 AM
Is this what you are after??

Code:
alias drawnotify {
  if !$window(@notify) { window -dk0pz +b @notify 0 0 180 300 }
  drawrect -fr @notify $rgb(224,235,246) 1 0 0 180 20
  drawrect -r @notify $rgb(109,109,109) 1 0 0 180 20
  drawtext -r @notify $rgb(109,109,109) Bright 11 5 5 Notify List
}
menu @notify {
  sclick:{
    if $inrect($mouse.x,$mouse.y,0,0,180,20) { 
      hadd -m notify move 1
      hadd -m notify x $mouse.x
      hadd -m notify y $mouse.y
    }
  }
  uclick:{
    if $hget(notify,move) { .hfree notify }
  }
  mouse:{
    if $hget(notify) {
      window @notify $calc($mouse.dx - $hget(notify,x)) $calc($mouse.dy - $hget(notify,y))
    }
  }
  leave:{
    if $hget(notify) { .hfree notify }
  }
}
on *:close:@notify:{ .hfree notify }
Posted By: tidy_trax Re: picwin - 25/02/04 09:24 AM
thanks smile
© mIRC Discussion Forums