Guest User

System Colours

a guest
Aug 3rd, 2020
178
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
mIRC 2.15 KB | None | 0 0
  1. alias systemcolours {
  2.   if ($window(@SystemColours)) sc.close
  3.   else {
  4.     window -pdfk0w0B +ft @SystemColours -1 -1 320 240 $qt($mircexe) 53
  5.     drawsize @SystemColours 320 240
  6.     %c.w = 320
  7.     %c.h = 240
  8.     window -hk0 @sc.objects
  9.     sc.objects
  10.     sc.draw
  11.   }
  12. }
  13.  
  14. alias -l sc.objects {
  15.   aline @sc.objects 5 20 100 50 $rgb(shadow) shadow
  16.   aline @sc.objects 110 20 100 50 $rgb(hilight) hilight
  17.   aline @sc.objects 5 75 100 50 $rgb(3dlight) 3dlight
  18.   aline @sc.objects 110 75 100 50 $rgb(frame) frame
  19.   aline @sc.objects 5 125 100 50 $rgb(text) text
  20. }
  21.  
  22. alias -l sc.draw {
  23.   drawrect -nrf @SystemColours $rgb(face) 1 0 0 480 320
  24.   drawtext -nr @SystemColours 255 Tahoma -8 5 0 face
  25.   drawtext -nr @SystemColours 255 Tahoma -8 5 225 Drag & drop!
  26.   filter -wk @sc.objects sc.drawobject
  27.   drawdot @SystemColours
  28. }
  29.  
  30. alias -l sc.drawobject {
  31.   tokenize 32 $1
  32.   drawrect -nrf @SystemColours $5 1 $1-4
  33.   drawtext -nr @SystemColours 255 Tahoma -8 $1-2 $6-
  34. }
  35.  
  36. menu @SystemColours {
  37.   sclick: {
  38.     %c.x = $mouse.x
  39.     %c.y = $mouse.y
  40.     %c.s =
  41.     filter -wk @sc.objects sc.checkclick
  42.     if ($fline(@sc.objects,%c.s)) {
  43.       dline @sc.objects $v1
  44.       aline @sc.objects %c.s
  45.       %c.move = $line(@sc.objects,0)
  46.       sc.draw
  47.     }
  48.     else %c.move =
  49.   }
  50.   mouse: {
  51.     if (%c.move) {
  52.       set -l %x $mouse.x
  53.       set -l %y $mouse.y
  54.       tokenize 32 %c.s
  55.       set -l %nx $calc(%x -(%c.x -$1))
  56.       set -l %ny $calc(%y -(%c.y -$2))
  57.       if (%nx < 0) %nx = 0
  58.       elseif ($calc(%nx +$3) > %c.w) %nx = %c.w - $3
  59.       if (%ny < 0) %ny = 0
  60.       elseif ($calc(%ny +$4) > %c.h) %ny = %c.h - $4
  61.       %c.s = %nx %ny $3-
  62.       rline @sc.objects %c.move %c.s
  63.       %c.x = %x
  64.       %c.y = %y
  65.       sc.draw
  66.     }
  67.   }
  68.   uclick:unset %c.move %c.x %c.y %c.s
  69.   leave:unset %c.move %c.x %c.y %c.s
  70.   Reset objects:clear @sc.objects | sc.objects | sc.draw
  71.   -
  72.   Close:sc.close
  73. }
  74.  
  75. alias -l sc.checkclick {
  76.   tokenize 32 $1
  77.   if ($inrect(%c.x,%c.y,$1,$2,$3,$4)) %c.s = $1-
  78. }
  79.  
  80. on *:close:@SystemColours:sc.close
  81.  
  82. alias -l sc.close {
  83.   window -c @SystemColours
  84.   window -c @sc.objects
  85.   unset %c.move %c.x %c.y %c.s %c.w %c.h
  86. }
  87.  
Advertisement
Add Comment
Please, Sign In to add comment