|
Joined: Nov 2003
Posts: 2,327
Hoopy frood
|
OP
Hoopy frood
Joined: Nov 2003
Posts: 2,327 |
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?
Last edited by tidy_trax; 24/02/04 07:23 PM.
New username: hixxy
|
|
|
|
Joined: Jan 2004
Posts: 26
Ameglian cow
|
Ameglian cow
Joined: Jan 2004
Posts: 26 |
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.
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
Last edited by module; 24/02/04 10:35 PM.
It's not in the GUI, it's in the source.
|
|
|
|
Joined: Nov 2003
Posts: 2,327
Hoopy frood
|
OP
Hoopy frood
Joined: Nov 2003
Posts: 2,327 |
thanks but i nearly got it worked out without a timer, the x pos works.. but y doesn't
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
New username: hixxy
|
|
|
|
Joined: Jan 2004
Posts: 26
Ameglian cow
|
Ameglian cow
Joined: Jan 2004
Posts: 26 |
If show the entire code, i may be able to figure it out..
It's not in the GUI, it's in the source.
|
|
|
|
Joined: Nov 2003
Posts: 2,327
Hoopy frood
|
OP
Hoopy frood
Joined: Nov 2003
Posts: 2,327 |
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.
New username: hixxy
|
|
|
|
Joined: Dec 2003
Posts: 33
Ameglian cow
|
Ameglian cow
Joined: Dec 2003
Posts: 33 |
Is this what you are after??
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 }
|
|
|
|
Joined: Nov 2003
Posts: 2,327
Hoopy frood
|
OP
Hoopy frood
Joined: Nov 2003
Posts: 2,327 |
thanks
New username: hixxy
|
|
|
|
|