Scripting Picture Windows » History » Revision 1
Revision 1/2
| Next »
Per Amundsen, 02/26/2017 04:33 PM
- Table of contents
- Picture Windows
Picture Windows¶
/window¶
Added in 1.9.0
/window [-aAbBcCde[N]fg[N]hHij[N]k[N]l[N]mMn[N]opq[N]rRsST[N]uvw[N]xz] [-tN,..,N] [+bdeflLmnstx] <@name> [rgb|[x y [w h]]] [/command] [popup.txt] [font [size]] [iconfile [N]]
Creates or manipulates a custom window with a Topicbox/Editbox/Text area/Listbox depending on the parameters used, see Custom Windows for more information.
If -p is specified, a picture window is created which can be custom drawn using various commands/identifiers, see Picture Windows for more information.
Option Switches
Switch | Description |
---|---|
-a | Set as the active window. |
-b | TODO |
-B | Prevent window from using an internal border. |
-c | Close window. |
-C | Center window. |
-d | Create desktop window instead of child. |
-e[N] | Enable Editbox; 0 = single, 1 = multi, 2 = auto, 3 = default. |
-f | Makes the w h the required width and height of the text display area. (instead of the window size) |
-g[N] | Sets/removes window button color, 0 = normal color, 1 = message color, 2 = highlight color, 3 = system color (3 is (AdiIRC only)). |
-h | Hide window. |
-H | Enables auto-hide for a side-listbox. |
-i | Dynamically associate with whatever happens to be the active connection. |
-j[N] | Sets buffer size to N lines. |
-k[N] | Hides the @ prefix in the window name, 0 = hide prefix, 1 = show prefix. |
-l[N] | Add listbox, if N is specified then a side-listbox N characters wide is created. |
-m | Enable line marker in the window. |
-M | TODO |
-n[N] | Minimize window ([N] = TODO) |
-o | Sets the windows as the top most window. (used with -d) |
-p | Creates a picture windows. |
-q[N] | If N is 0 hides the nick column, if N is 1 shows the nick column. (AdiIRC only) |
-Q[N] | If N is 0 disables "Show on Desktop", if N is 1 enables "Show on Desktop". (AdiIRC only) |
-r | Restore window. |
-R | TODO |
-s | Sort the main window, whether text or listbox. (only listbox for now) |
-S | Sort the side-listbox. |
-A | Indicates the [rgb] parameter is defined, sets the forms transparency key to [rgb]. (AdiIRC only) |
-T[N] | Enable Topicbox; 0 = Show, 1 = Show Sticky, 2 = Off, 3 = default. (AdiIRC only) |
-u | Remove ontop setting of a desktop window. |
-v | Close window when associated status window is closed. |
-w[N] | Show/hide window from Treebar or Switchbar; 0 = hide from both, 1 = show in Switchbar, 2 = show in Treebar, 3 = show in both |
-x | Maximize window |
-z[N] | if N = 1, places window button at end of Switchbar/Treebar, if N = 0, restores original place. (Default is 1) |
-Z | Reset the window icon to default. |
Tab Switches
Switch | Description |
---|---|
-tN,..,N | TODO |
Appearance Switches
These causes graphical glitches for MDI windows because .net MDI does not like windows without proper borders.
Switch | Description |
---|---|
+b | Border. |
+d | No border. |
+e | 3d Edge. |
+f | Dialog frame. |
+l | Tool window. |
+L | Tool window. (hide from taskbar) |
+n | Minimize box. |
+s | Sizeable. |
+t | Titlebar. |
+x | Maximize box. |
Parameters
Parameter | Description |
---|---|
<@name> | Window name. |
[rgb] | The $rgb value used with the -t parameter. |
x y [w h] | Left top [width height] - position and size of window. (A -1 value for any of the parameters means use default (or existing) value). |
/command | Default command. |
popup.txt | Popup filename, must be plane text file. TODO |
font [size] | Font name [font size]. |
iconfile [N] | Sets a custom Titlebar icon for the window. (N = TODO) |
Example
alias example1 { ; Create a desktop + picture window, Coordinates: (250,250), size 300x300. /window -dep @Example 250 250 300 300 ; Color it with the control code color 3. (default is green) /drawfill @Example 3 3 1 1 100 100 ; Draw text "Hello world!". /drawtext @Example 1 Arial 30 50 100 Hello World! ; Close the window. /window -c @Example }
/titlebar¶
Added in 1.9.0
/titlebar [@window] <text>
Sets the main application Titlebar. If you specify a custom @window name, then the Titlebar for that custom window is changed.
Parameters
Parameter | Description |
[@window] | Window to change the title. |
<text> | Title text to set. |
Example
; Changes AdiIRC's titlebar to Hello world! /titlebar Hello world! ; Open a custom window. /window -e @Example ; Changes @Example Titlebar to Hello world! /titlebar @Example Hello world!
/renwin¶
Added in 1.9.2
/renwin <@oldname> <@newname> [topic]
Allows you to change the name of an existing window to a different one, and an optional topic can be specified.
Parameters
Parameter | Description |
<@oldname> | Current window name. |
<@newname> | New window name. |
[topic] | Window topic/title. |
Example
; Open a custom window. /window -e @Example1 ; Rename @Example1 to @Example2 and add topic 'Hello world'. /renwin @Example1 @Example2 Hello World
/drawcopy¶
Added in 1.9.0
/drawcopy -himnrt <@window> [color] <x y w h> <@window> <x y [w h]>
Copies part of a picture to a different position in the same window or to another window. If the second [w h] parameters are specified, the picture is stretched/squeezed to fit.
Switches
Switch | Description |
-h | Highlights the windows icon if it is minimized. |
-i | Draws in inverse mode. |
-m | Changes the stretch mode quality when the picture is resized. |
-n | Prevents the display from being updated immediately. |
-r | Indicates that the color is in RGB format. You can use $rgb(N,N,N) to create an RGB value. |
-t | Indicates that you have specified the [color] RGB value as a transparent color in the source bitmap. |
Parameters
Parameter | Description |
<@window> | The picture window to copy from. |
[color] | If -t is used, the RGB color used for transparency. |
<x y w h> | Portion to of the source @window to copy. |
<@window> | The picture window to copy to. |
<x y [w h]> | The coordinate where to draw, if [w h] are specified, the picture is squeed/stretched to fit, they can be negative value to get a mirror effect. |
/drawdot¶
Added in 1.9.0
/drawdot [-ihnr] <@window> <color> <size> <x y> [<x y>...]
Draws a dot using the specified color and size at the x,y co-ordinates. Multiple co-ordinates can be provided.
Switches
Switch | Description |
-i | Draws in inverse mode. |
-h | Highlights the windows icon if it is minimized. |
-n | Prevents the display from being updated immediately. |
-r | Indicates that the color is in RGB format. You can use $rgb(N,N,N) to create an RGB value. |
Parameters
Parameter | Description |
<@window> | The picture window to draw in. |
<color> | Color off the dot to draw. |
<size> | Size of the dot to draw. |
<x y> | x,y co-ordinates to draw at. |
[<x y>...] | Additional x,y co-ordinates to draw at. |
/drawfill¶
Added in 1.9.0
/drawfill [-ihnrs] <@window> <color> <color> <x y> [filename] [<x y>...]
Fills an area with the specified color starting at the specified co-ordinates.
Switches
Switch | Description |
-i | Draws in inverse mode. |
-h | Highlights the windows icon if it is minimized. |
-n | Prevents the display from being updated immediately. |
-r | Indicates that the color is in RGB format. You can use $rgb(N,N,N) to create an RGB value. |
-s | Indicates that the second color parameter is the color that should be filled (surface fill). If no -s is specified, the second color is the border color at which filling should stop (border fill). |
Parameters
Parameter | Description |
<@window> | Name of the picture window to draw. |
<color> | The color used for the fill. |
<color> | The color used to know how to fill (if -s, it fills as long as the color of the pixels around is the same color as the one you provide here, otherwise, it fills as long as the color of pixel is not the color you provide here) |
<x y> | The coordinate where to fill. |
[filename] | TODO |
[<x y>...] | TODO |
/drawline¶
Added in 1.9.0
/drawline [-ihnr] <@window> <color> <size> <x y> <x y> [<x y>...]
Draws a line from the first <x y> co-ordinate to the second, if more co-ordinates are specified, the line is continued.
Switches
Switch | Description |
-i | Draws in inverse mode. |
-h | Highlights the windows icon if it is minimized. |
-n | Prevents the display from being updated immediately. |
-r | Indicates that the color is in RGB format. You can use $rgb(N,N,N) to create an RGB value. |
Parameters
Parameter | Description |
<@window> | The picture window to draw in. |
<color> | Color off the line to draw. |
<size> | Size of the line to draw. |
<x y> | x,y co-ordinates to draw at. |
[<x y>...] | Additional points to draw. |
/drawpic¶
Added in 1.9.0
/drawpic -ihmnotsclgNf <@window> [color] <x y [w h]> [x y w h] [N] [M] <filename>
Switches
Switch | Description |
-t | Indicates that you have specified the [color] $rgb value as a transparent color in the specified bitmap. |
-s | Indicates that you have specified the first [w h] parameters to squeeze/stretch the bitmap. |
-c | Indicates that the bitmap should be cached. This greatly speeds up subsequent references to this bitmap. If you specify -c and the bitmap is already in the cache, it is loaded and used from the cache, otherwise it is reloaded from the file. You can clear the entire cache with /drawpic -c. |
-l | TODO |
-m | Changes the stretch mode quality when the picture is resized. |
-o | Indicates that you have specified the [N] value before the filename, representing the index of the icon in the file. |
-gN | TODO |
-i | Draws in inverse mode. |
-h | Highlights the windows icon if it is minimized. |
-n | Prevents the display from being updated immediately. |
-o | Indicates that you have specified the [N] value before the filename represents the index of the icon in the file. |
-f | TODO |
Parameters
Parameter | Description |
<@window> | The window name to draw. |
[color] | If -t is used, the RGB color used for transparency. |
<x y [w h]> | The x y coordinates where you want to draw, if -s is used, [w h] is the width/height that will be used to squeeze/stretch the bitmap. |
[x y w h] | The area in the picture to be drawn. |
[N] | If -o is used, the index number of the picture in the file. |
[M] | TODO |
<filename> | The filename for the picture. |
/drawrect¶
Added in 1.9.0
/drawrect -ihnrfecd <@window> <color> <size> <x y w h> [<x y w h>...]
Draws a rectangle at the specified co-ordinates of the specified width and height. If more co-ordinates are specified these are also drawn as separate rectangles.
Switches
Switch | Description |
-i | Draws in inverse mode. |
-h | Highlights the windows icon if it is minimized. |
-n | Prevents the display from being updated immediately. |
-r | Indicates that the color is in RGB format. You can use $rgb(N,N,N) to create an RGB value. |
-f | Draws a filled rectangle. |
-e | Draws an ellipse instead of a rectangle. |
-c | Draws a focus rectangle. |
-d | Draws a rounded rectangle, using the format "/drawrect -d x y w h [w h]" where w and h are the width and height of the ellipse used to draw the corners. |
Parameters
Parameter | Description |
<@window> | Name of the Picture Window to draw to. |
<color> | The color used for the rectangle. |
<size> | Thickness of the border in pixels. |
<x y w h> | Co-ordinates for a rectangle in pixels, x and y are the top left corner. |
[<x y w h>...] | Draw additional rectangles. |
/drawreplace¶
Added in 1.9.0
/drawreplace -nr <@window> <color1> <color2> [x y w h]
Replaces all occurrences of color1 with color2.
Switches
Switch | Description |
-n | Prevents the display from being updated immediately. |
-r | Indicates that the color is in RGB format. You can use $rgb(N,N,N) to create an RGB value. |
Parameters
Parameter | Description |
<@window> | Name of the picture window to draw. |
<color1> | The color to replace. |
<color2> | The color to replace with. |
[x y w h] | the area of the picture to replace. |
/drawrot¶
Added in 1.9.0
/drawrot [-hmnbfcp] <@window> [color] <angle> [x y w h]
Rotates an area of a bitmap by the specified angle.
Switches
Switch | Description |
-h | Highlights the window if it's minimized. |
-m | Changes the stretch mode quality when the picture is resized. |
-n | Prevents the display from being updated immediately. |
-b | Indicates that you have specified the background color value. (The [color] is always in $rgb format) |
-f | Fits the newly rotated bitmap into the original width/height. |
-c | Centers the rotated image if -f is not specified. |
-p | Clips the rotated image. |
Parameters
Parameter | Description |
<@window> | Name of the window to rotate. |
[color] | The background color to use if -b is defined. |
<angle> | The angle of the rotation. |
[x y w h] | The area to rotate. |
/drawsave¶
Added in 1.9.0
/drawsave -bNqNSBFN <@window|&binvar> [x y w h] <filename>
Saves the background picture of the specified picture @window to a file.
Switches
Switch | Description |
-bN | allows you to specify the bit depth of the saved file, which can be 1, 4, 8, 16, 24, or 32. |
-qN | allows you to specify the quality of the jpeg file that is being saved, where N is between 1 and 100. |
-S | Indicates [x y w h] is specified to save only a specific position and size of the picture. (AdiIRC only) |
-B | Converts the picture window bitmap into a base64 encoded string and stores it into &binvar. (AdiIRC Only) |
-FN | Image format to save to. (AdiIRC Only) (default is PNG) |
Parameters
Parameter | Description |
<@window> | Window name to save from. |
<&binvar> | Used with -B. (AdiIRC Only) |
[x y w h] | The position and size from the picture to save, used with -S. (AdiIRC only) |
<filename> | Filename to save to. |
Image Formats
Format | Extension |
-F0 | .png |
-F1 | .jpg |
-F2 | .bmp |
-F3 | .emf |
-F4 | .exif |
-F5 | .gif |
-F6 | .ico |
-F7 | .tiff |
-F8 | .wmf |
/drawscroll¶
Added in 1.9.0
/drawscroll -hn <@window> <x> <y> <x y w h> [<x> <y> <x y w h>...]
Scrolls the region inside the specified rectangle. The first <x> and <y> parameters represent the distance to scroll and can be positive or negative.
Switches
Switch | Description |
-h | Highlights the windows icon if it is minimized. |
-n | Prevents the display from being updated immediately. |
Parameters
Parameter | Description |
<@window> | Name of the window to scroll. |
<x> | The number of pixel to scroll on the x axis. |
<y> | The number of pixel to scroll on the y axis. |
<x y w h> | The region to scroll. |
[<x> <y> <x y w h>...] | Additional pixels and regions to scroll. |
/drawtext¶
Added in 1.9.0
/drawtext -hnrpbocvd <@window> <color> [color] [fontname fontsize] <x y [w h]> <text|&binvar>
Draws text at the specified co-ordinates.
Switches
Switch | Description |
-p | Processes and interprets control codes in the text. |
-b | Indicates that you have specified the second color parameter as the background color for the text. |
-o | Indicates specified font should be in bold. |
-c | Indicates that you have specified the [w h] values as the rectangle in which text should be printed. Text will be clipped if it extends beyond this rectangle. |
-h | Highlights the windows icon if it is minimized. |
-n | Prevents the display from being updated immediately. |
-r | Indicates that the colors are in $rgb format. |
-v | Indicates &binvar is specified. |
-d | TODO |
Parameters
Parameter | Description |
<@window> | Name of the window to draw. |
<color> | The textcolor. |
[color] | The background color, if -b has been specified. |
[fontname fontsize] | The name of the font and the size of the font. |
<x y [w h]> | The coordinate of the text. |
<text<redpre#0>&binvar> | The text or text from a &binvar to draw. |
Example
alias testdrawtext { window -p @win drawtext @win 4 Verdana 11 0 0 Hello World }
$window¶
Added in 1.9.0
$window(N/@name/@wildcard, M)
Returns properties for a window.
See also /window.
Parameters
Parameter | Description |
---|---|
N/name/ wildcard |
Name of the window or the Nth window. (@wildcard is also possible if M is defined) |
M | The Nth @wildcard match. (optional) |
If N is -1 | returns properties for the desktop area. |
If N is -2 | returns properties for the AdiIRC main window. |
If N is -3 | returns properties for the MDI client area of the main window. |
Properties
Propertie | Description |
---|---|
.x | Horizontal position of the window relative to the mainform. |
.y | Vertical position of the window relative to the mainform. |
.w | Window width. |
.h | Window height. |
.cx | TODO |
.cy | TODO |
.dx | Horizontal position of the window relative to the desktop. |
.dy | Vertical position of the window relative to the desktop. |
.dw | Width of the Text Area. |
.dh | Height of the Text Area. |
.bw | Width of the bitmap for a picture window. |
.bh | Height of the bitmap for a picture window. |
.mdi | $true if the window is a MDI window/docked, otherwise $false |
.title | The text of the window Titlebar. |
.state | minimized/maximized/hidden/normal. |
.font | Name of the current font. |
.fontsize | Size of the current font using the current display DPI. |
.fontdialogsize | The real size of the current font. |
.fontbold | $true if the font is bold, otherwise $false. |
.fontitalic | $true if the font is italic, otherwise $false. |
.fontunderline | $true if the font is underline, otherwise $false. |
.fontcs | returns the character set of the current font. |
.logfile | Name of logfile if one is open for the window. |
.historyfile | Name of the file Editbox history will be saved to. (AdiIRC only) |
.iconfile | Name of the icon file used for a custom icon. (AdiIRC only) |
.backgroundfile | Name of the background file used for a custom background. (AdiIRC only) |
.backgroundlayout | Gets background layout for this window. (AdiIRC only) |
.stamp | $true if timestamp is on for this window, otherwise $false. |
.icon | $true if icon is visible in Switchbar otherwise $false. |
.ontop | $true if window is on top otherwise $false. |
.type | Window type, channel/status/query/custom/picture/chat/tool/panel. |
.anysc | $true if the window was created with the /window -i parameter, otherwise $false. |
.wid | Window id. |
.cid | Connection id. |
.hwnd | Window handle. |
.sbtext | Switchbar button text for this window. |
.sbcolor | Switchbar color event event/message/highlight for this window. |
.sbstate | Switchbar button state (1 = visible, 0 = not visible) for this window. |
.tbtext | Treebar text for this window. |
.tbstate | Treebar state (1 = visible, 0 = not visible) for this window. |
.lb | listbox state (2 = side listbox, 1 = listbox, 0 = no listbox) for this window. |
.topicbox | Topicbox state (2 = Show sticky, 1 = show, 2 = off) for this window. (AdiIRC only) |
.idle | idle state. |
.isbottom | $true if the Text Area is scrolled to the bottom, otherwise $false. (AdiIRC only) |
.unread | Returns number of unread messages. (this include system messages, use .sbcolor to check the type, AdiIRC only) |
.layer | Returns the window layer. (AdiIRC only) |
.mscrollpos | Returns the current scrollbar position for the Text Area. (AdiIRC only) |
.mscrollmax | Returns the max scrollbar position for the Text Area. (AdiIRC only) |
.collapsed | Returns $true if the associated Status Window is collapsed in the Treebar, otherwise $false. (AdiIRC only) |
.eb | Returns 1 if the window has a Editbox, otherwise 0. (AdiIRC only) |
.fullscreen | Returns $true if the window is fullscreen, otherwise $false. |
$width¶
Added in 1.9.1
$width(text,font,size,[B],[C],[D])
Returns width of text in pixels for the specified font.
If you use a negative number for the font size, it will match the size of fonts in the font dialogs.
Parameters
Parameter | Description |
text | Text to measure. |
font | Font to measure. |
size | Font size to measure. |
[B] | If B is non-zero, the font is bold. (optional) |
[C] | If C is non-zero, control codes are processed. (optional) |
[D] | TODO |
Example
; Measure the width of text 'Hello World' using font 'Verdana 9'. //echo -ag $width(Hello world, Verdana, 9)
$height¶
Added in 1.9.1
$height(text,font,size,[B],[C],[D])
Returns height of text in pixels for the specified font.
If you use a negative number for the font size, it will match the size of fonts in the font dialogs.
Parameters
Parameter | Description |
text | Text to measure. |
font | Font to measure. |
size | Font size to measure. |
[B] | If B is non-zero, the font is bold. (optional) |
[C] | If C is non-zero, control codes are processed. (optional) |
[D] | TODO |
Example
; Measure the height of text 'Hello World' using font 'Verdana 9'. //echo -ag $height(Hello world, Verdana, 9)
$click¶
Added in 1.9.4
$click(@window, N)
Retrieves mouse click information from a picture window.
If no properties is defined, returns both X Y.
Parameters
Parameter | Description |
@window | Picture window to use. |
N | The Nth mouse click item, if N = 0, returns number of mouse click items. |
Properties
Property | Description |
.x | Returns the X coordinate of the mouse click. |
.y | Returns the Y coordinate of the mouse click. |
Example
; Create the custom alias to launch the example ; ; Synopsis: /clickWatch alias clickWatch { ; Create a custom picture window, which is centered. window -dpC @clicker 0 0 250 125 ; Custom 'update' alias keeps code from repeating. ; During initial launch the values should be empty. update 15 Total Clicks: empty update 35 Current Position: none yet update 55 Previous Position: none yet } ; Monitor the sclicks in our custom '@clicker' window. menu @clicker { sclick: { ; Clear the window for the new value updates. clear @clicker ; Set the %current and %prev variables to the current. ; x/y click location, and to the previous x/y click. ; locations, respectively. var %current = $click(@clicker,0), %prev = $calc(%current - 1) ; Utilizing the custom 'update' alias, update the data. update 15 Total Clicks: $click(@clicker,0) update 35 Current Position: $click(@clicker,%current) update 55 Previous Position: $iif(%prev,$click(@clicker,%prev),none yet) } } ; Custom update alias removes a lot of the /drawtext repetition. ; from this example. alias -l update { drawtext @clicker $color(normal) 7 $1 $2- }
$inellipse¶
Added in 1.9.0
$inellipse(x,y,x,y,w,h)
Returns $true if the point x y is inside the specified ellipse, otherwise $false.
Parameters
Parameter | Description |
x | The first X coordinate. |
y | The first y coordinate. |
x | The second X coordinate. |
y | The second y coordinate. |
w | The width. |
h | The height. |
$inrect¶
Added in 1.9.0
$inrect(x,y,x,y,w,h)
Returns $true if the point x y is inside the specified rectangle, otherwise $false.
Parameters
Parameter | Description |
x | The first X coordinate. |
y | The first y coordinate. |
x | The second X coordinate. |
y | The second y coordinate. |
w | The width. |
h | The height. |
$inroundrect¶
Added in 1.9.4
$inroundrect(x,y,x,y,w,h,w,h)
Returns $true if the point x y (the first ones) is inside the specified rounded rectangle, otherwise $false.
Parameters
Parameter | Description |
x | The first X coordinate. |
y | The first y coordinate. |
x | The second X coordinate. |
y | The second y coordinate. |
w | The first width. |
h | The first height. |
w | The second width. |
h | The second height. |
$inpoly¶
Added in 1.9.0
$inpoly(x,y,a1,a2,b1,b2,...)
Returns $true if the point x y is inside the polygon defined by the specified points, otherwise $false.
Parameters
Parameter | Description |
x | The X coordinate. |
y | The Y coordinate. |
a1 | The first point x. |
a2 | The first point y. |
b1 | The second point x. |
b2 | The second point y. |
... | Additional points. |
$onpoly¶
Added in 1.9.4
$onpoly(n1,n2,x,y,x,y,...)
Returns $true if two polygons overlap, otherwise $false.
Parameters
Parameter | Description |
n1 | Number of points in the first polygon. |
n2 | Number of points in the second polygon. |
x | First x coordinate. |
y | First y coordinate. |
x | Second x coordinate. |
y | Second y coordinate. |
... | Additional coordinates. |
$getdot¶
Added in 1.9.1
$getdot(@,x,y)
Returns the RGB color value of the dot at the specified position in a picture window.
Parameters
Parameter | Description |
@ | The picture window name. |
x | The X coordinate. |
y | The Y coordinate. |
Example
; Open a picture window. /window -p @Example ; Fill a rectangle on the picture window. /drawfill @Example 4 4 0 0 ; Get the RGB color value at x coordinate 0 and y coordinate 0. //echo -ag $getdot(@Example, 0, 0)
$lineheight¶
Added in 1.9.5
$lineheight(font, size)
Returns the line height of the given font and size.
Parameters
Parameter | Description |
font | Font to calculate. |
size | Font size to calculate. |
Example
//echo -ag Lineheight for Consolas 10 is $lineheight(Consolas, 10)
$pic¶
Added in 1.9.1
$pic(filename)
Returns the filesize/imagesize of a image file.
Parameters
Parameter | Description |
filename | Image file to check. |
Properties
Property | Description |
.width | Return the image width. |
.height | Return the image height. |
.size | Return the image size. |
Example
; Print width and height of a image file. //echo -ag Image width is $pic(image.jpg).width height is $pic(image.jpg).height
$mouse¶
Added in 1.9.0
$mouse
Returns various properties about the mouse and keys pressed during events.
See also $menu, $menutype, $menucontext, $menuicon, Menus.
Properties
Property | Description |
.lb | Returns $true if the mouse event occurred in a side-listbox otherwise $false. |
.x | Mouse X position relative to active window. |
.y | Mouse Y position relative to active window. |
.mx | Mouse X position relative to AdiIRC main window. |
.my | Mouse Y position relative to AdiIRC main window. |
.dx | Mouse X position relative to the desktop area. |
.dy | Mouse Y position relative to the desktop area. |
.key | Bitwise flag, see example. |
.cx | TODO |
.cy | TODO |
.win | Returns the name of the active window. |
Example
alias Example { ; Test $mouse.key for various values, more than one value can be true. if ($mouse.key & 1) echo left button is pressed. if ($mouse.key & 2) echo control key is pressed. if ($mouse.key & 4) echo shift key is pressed. if ($mouse.key & 8) echo alt key is pressed. if ($mouse.key & 16) echo right mouse button is pressed. if ($mouse.key & 32) echo middle mouse button is pressed. (AdiIRC only) if ($mouse.key & 64) echo x mouse button 1 is pressed. (AdiIRC only) if ($mouse.key & 128) echo x mouse button 2 is pressed. (AdiIRC only) if ($mouse.key & 256) echo alt+gr pressed. (AdiIRC only) } ; Print mouse X and Y coordinates. //echo -ag $mouse.x / $mouse.y
$rgb¶
Added in 1.9.0
$rgb(N,N,N|N|name)
If N,N,N is defined, returns an RGB decimal color value.
if N is defined, returns a RRR,GGG,BBB value.
if name is defined, returns a system color RGB decimal value.
Parameters
Parameter | Description |
N,N,N | An RRR,GGG,BBB value. |
N | A RGB decimal value. |
name | A system color name: face, shadow, hilight, 3dlight, frame, or text. |
Switches
Switch | Description |
.hex | Returns the value in hex format. (AdiIRC only) |
Example
; Print the RGB decimal value from 123,123,123 //echo -ag RGB value is $rgb(123,123,123) ; Print the RRR,GGG,BBB value from 8092539 //echo -ag RGB decimal value is $rgb(8092539)
Updated by Per Amundsen almost 8 years ago · 1 revisions