From c5ac75794ee7589900af8ae047abc06987784b8b Mon Sep 17 00:00:00 2001 From: hoppfrosch Date: Thu, 17 Dec 2015 08:05:49 +0100 Subject: [PATCH 01/13] #26 - Added unittests method symmetricDifference() --- Examples/WindLy/Windly_Demo01_Basic.ahk | 2 +- .../Windly_Demo05_symmetricdifference.ahk | 33 +++++++++++++++++++ 2 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 Examples/WindLy/Windly_Demo05_symmetricdifference.ahk diff --git a/Examples/WindLy/Windly_Demo01_Basic.ahk b/Examples/WindLy/Windly_Demo01_Basic.ahk index ee08341..f80be83 100644 --- a/Examples/WindLy/Windly_Demo01_Basic.ahk +++ b/Examples/WindLy/Windly_Demo01_Basic.ahk @@ -8,7 +8,7 @@ for key, data in x.Snapshot() { ; access the window list directly by function c } OutputDebug % "******** removeNonExisting *********************************************************************" -MsgBox % "Close any window and watch, if the widiw is removed from the list" +MsgBox % "Close any window and watch, if the window is removed from the list" x.removeNonExisting() OutputDebug % "******** On Monitor 1 *************************************************************************" diff --git a/Examples/WindLy/Windly_Demo05_symmetricdifference.ahk b/Examples/WindLy/Windly_Demo05_symmetricdifference.ahk new file mode 100644 index 0000000..80945d7 --- /dev/null +++ b/Examples/WindLy/Windly_Demo05_symmetricdifference.ahk @@ -0,0 +1,33 @@ +#include %A_ScriptDir%\..\..\lib\Windy +#include WindLy.ahk +#include Windy.ahk + +OutputDebug % "******** All windows on monitor 1 ***********************************************************" +x := new WindLy() +x.byMonitorId(1) +for key, data in x.list { + OutputDebug % " " key ": " data.hwnd ": " data.title " (" key ")" +} + +OutputDebug % "******** All windows on monitor 2 ***********************************************************" +y:= new WindLy() +y.byMonitorId(2) +for key, data in x.list { ; As y is manipulated within loop, we have to use a list-clone to iterate over + i := i + 1 + if (i < 2) { + y.insert(data) + } +} +for key, data in y.list { + OutputDebug % " " key ": " data.hwnd ": " data.title " (" key ")" +} + +OutputDebug % "############## SET-Operation SYMMETRICDIFFERENCE: WindLy.symmetricDifference() ##################" +; Create difference of WindLy instance x and WindLy instance y +x.symmetricDifference(y) ; y is removed from x - the result is stored in x again +OutputDebug % "******** WindLy After Union *******************************************************************" +for key, data in x.list { + OutputDebug % " " key ": " data.hwnd ": " data.title " (" key ")" +} + +ExitApp From 6bd6c59fd2e9a03521db6cc6cb15276bbefd324d Mon Sep 17 00:00:00 2001 From: hoppfrosch Date: Thu, 17 Dec 2015 10:56:55 +0100 Subject: [PATCH 02/13] #37 - INTERNAL: Renamed property resizeable[] to resizable[] --- YUnit_Windy.ahk | 12 ++++++------ lib/Windy/Windy.ahk | 10 +++++----- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/YUnit_Windy.ahk b/YUnit_Windy.ahk index 6622101..0fa4f3c 100644 --- a/YUnit_Windy.ahk +++ b/YUnit_Windy.ahk @@ -714,16 +714,16 @@ class MiscTestSuite { OutputDebug % "<<<<[" A_ThisFunc "]<<<<<" } - Resizeable() { + Resizable() { OutputDebug % ">>>>>[" A_ThisFunc "]>>>>>" OutputDebug % "...[" A_ThisFunc "]> 1" - Yunit.assert( this.obj.resizeable == 1) + Yunit.assert( this.obj.resizable == 1) OutputDebug % "...[" A_ThisFunc "]> 0" - this.obj.resizeable := 0 - Yunit.assert( this.obj.resizeable == 0) + this.obj.resizable := 0 + Yunit.assert( this.obj.resizable == 0) OutputDebug % "...[" A_ThisFunc "]> toggle" - this.obj.resizeable := !this.obj.resizeable - Yunit.assert( this.obj.resizeable == 1) + this.obj.resizable := !this.obj.resizable + Yunit.assert( this.obj.resizable == 1) OutputDebug % "<<<<[" A_ThisFunc "]<<<<<" sleep, 500 } diff --git a/lib/Windy/Windy.ahk b/lib/Windy/Windy.ahk index 822828c..d333562 100644 --- a/lib/Windy/Windy.ahk +++ b/lib/Windy/Windy.ahk @@ -687,17 +687,17 @@ class Windy { return ret } } - resizeable[] { + resizable[] { /* --------------------------------------------------------------------------------------- - Property: resizeable [get/set] + Property: resizable [get/set] Is window resizing possible? Value: - flag - *true* or *false* (activates/deactivates *resizeable*-Property) + flag - *true* or *false* (activates/deactivates *resizable*-Property) Remarks: * To toogle, simply use - > obj.resizeable := !obj.resizeable + > obj.resizable := !obj.resizable * Same as property */ @@ -861,7 +861,7 @@ class Windy { Remarks: * To toogle, simply use > obj.sizebox := !obj.sizebox - * Same as property *resizeable* + * Same as property *resizable* */ get { ret := (this.style & WS.SIZEBOX) > 0 ? 1 : 0 From 53562a153ad46429493700001ed2776c763e2167 Mon Sep 17 00:00:00 2001 From: hoppfrosch Date: Tue, 22 Dec 2015 11:22:50 +0100 Subject: [PATCH 03/13] #41 - INTERNAL: Added several badges closes #41 --- Readme.md | 125 +++++++++++++++++++++++++++--------------------------- 1 file changed, 63 insertions(+), 62 deletions(-) diff --git a/Readme.md b/Readme.md index 5efbd1d..75b1aa5 100644 --- a/Readme.md +++ b/Readme.md @@ -1,62 +1,63 @@ -[![Stories in Ready](https://badge.waffle.io/hoppfrosch/AHK_Windy.png?label=ready&title=Ready)](https://waffle.io/hoppfrosch/AHK_Windy) -# AHK-Windy - Tools to operate on windows - -Functionality for easier work with mouse and windows on desktop. Multi-Monitor support is also provided ... - -Documentation is available on [gh_pages](http://hoppfrosch.github.io/AHK_Windy) - -**Author**: [hoppfrosch@gmx.de](mailto:hoppfrosch@gmx.de) - ----------- -## Credits - -- [Chris](http://www.autohotkey.com/board/user/2-chris/) - - [AutoHotkey 1.0](http://www.autohotkey.com/) -- [Lexikos](http://www.autohotkey.com/board/user/2446-lexikos/) - - for taking up the development on [AutoHotkey](http://l.autohotkey.net/) (aka. AHK_L) - - [WindowPad](http://http://www.autohotkey.com/board/topic/19990-windowpad-window-moving-tool) as **main inspiration** - -### Ideas/Implementations as Input -- [Bkid](http://ahkscript.org/boards/memberlist.php?mode=viewprofile&u=55) - - [Identify monitor numbers with IDMonitors()](http://http://ahkscript.org/boards/viewtopic.php?f=6&t=3761&p=19836) -- [joedf](http://ahkscript.org/boards/memberlist.php?mode=viewprofile&u=55) - - [Smart WinFade](http://ahkscript.org/boards/viewtopic.php?f=6&t=512) -- [just me](https://github.com/AHK-just-me) - - [GUI Constants](https://github.com/AHK-just-me/AHK_Gui_Constants) - - Function [API_GetWindowInfo()](http://www.autohotkey.com/board/topic/69254-func-api-getwindowinfo-ahk-l/) - - [MDMF - Multiple Display Monitor Functions](http://ahkscript.org/boards/viewtopic.php?f=6&t=4606) -- [majkinetor](http://www.autohotkey.com/board/user/1763-majkinetor/) - - [Forms-Framework](https://github.com/maul-esel/FormsFramework) -- [ManaUser](http://www.autohotkey.com/board/user/3558-manauser/) - - Function `__isWindow(`) - taken from [AppsKeys](http://www.autohotkey.com/board/topic/25393-appskeys-a-suite-of-simple-utility-hotkeys/) -- [maul-esel](https://github.com/maul-esel) - - porting [Forms Framework](https://github.com/maul-esel/FormsFramework) to AHK_L -- [MasterFocus](https://github.com/MasterFocus) - - Function [RandomBezier](https://github.com/MasterFocus/AutoHotkey/tree/master/Functions/RandomBezier) - moving mouse on a random path (bezier curve) -- [Uberi](http://www.autohotkey.com/board/user/12435-uberi/) - - [Yunit-Framework](https://github.com/Uberi/Yunit) -- **and to everyone I might have forgotten** - -### Bugfixes - - [WinSet, Transparent fails on AHK GUI -caption ](http://www.autohotkey.com/board/topic/67874-winset-transparent-fails-on-ahk-gui-caption/) - -### More Inspiration taken from ### - -- [WindowPad](http://http://www.autohotkey.com/board/topic/19990-windowpad-window-moving-tool)/[WindowPadX](https://github.com/hoppfrosch/WindowPadX) - free - based on AutoHotkey as well -- [WindowMenuPlus](http://www.moo0.com/?top=http://www.moo0.com/software/WindowMenuPlus/) - Free (Non-Commercial Use Only) -- [WindowSpace](http://www.ntwind.com/software/windowspace.html) - commercial -- [Winsplit-Revolution](http://winsplit-revolution.com/) - Freeware - -### Used libraries -- [Coco](https://gist.github.com/cocobelgica) - - [SerDes](https://github.com/cocobelgica/AutoHotkey-SerDes)-Function (Serialize / de-serialize an AutoHotkey object structure) -- [Uberi](http://www.autohotkey.com/board/user/12435-uberi/) - - [Yunit-Framework](https://github.com/Uberi/Yunit) -- **and to everyone I might have forgotten** - - -### History - -This project was split of [AHK_EDE](https://github.com/hoppfrosch/AHK_EDE/). - -ChangeLog is available [here](https://github.com/hoppfrosch/AHK_Windy/blob/master/ChangeLog.md) +# AHK-Windy - Tools to operate on windows [![AutoHotkey](https://img.shields.io/badge/Language-AutoHotkey-yellowgreen.svg)](https://autohotkey.com/) ![](https://img.shields.io/badge/State-Stable-green.svg) + +Functionality for easier work with mouse and windows on desktop. Multi-Monitor support is also provided ... + +Documentation is available on [gh_pages](http://hoppfrosch.github.io/AHK_Windy) + +**Author**: [hoppfrosch@gmx.de](mailto:hoppfrosch@gmx.de) + +---------- +**Issues**: [![Stories in Backlog](https://badge.waffle.io/hoppfrosch/AHK_Windy.svg?label=backlog&title=Backlog)](http://waffle.io/hoppfrosch/AHK_Windy) [![Stories in Ready](https://badge.waffle.io/hoppfrosch/AHK_Windy.svg?label=ready&title=Ready)](http://waffle.io/hoppfrosch/AHK_Windy) [![Stories in Progress](https://badge.waffle.io/hoppfrosch/AHK_Windy.svg?label=In%20Progress&title=In%20Progress)](http://waffle.io/hoppfrosch/AHK_Windy) [![Stories in Done](https://badge.waffle.io/hoppfrosch/AHK_Windy.svg?label=done&title=Done)](http://waffle.io/hoppfrosch/AHK_Windy) +---------- +## Credits + +- [Chris](http://www.autohotkey.com/board/user/2-chris/) + - [AutoHotkey 1.0](http://www.autohotkey.com/) +- [Lexikos](http://www.autohotkey.com/board/user/2446-lexikos/) + - for taking up the development on [AutoHotkey](http://l.autohotkey.net/) (aka. AHK_L) + - [WindowPad](http://http://www.autohotkey.com/board/topic/19990-windowpad-window-moving-tool) as **main inspiration** + +### Ideas/Implementations as Input +- [Bkid](http://ahkscript.org/boards/memberlist.php?mode=viewprofile&u=55) + - [Identify monitor numbers with IDMonitors()](http://http://ahkscript.org/boards/viewtopic.php?f=6&t=3761&p=19836) +- [joedf](http://ahkscript.org/boards/memberlist.php?mode=viewprofile&u=55) + - [Smart WinFade](http://ahkscript.org/boards/viewtopic.php?f=6&t=512) +- [just me](https://github.com/AHK-just-me) + - [GUI Constants](https://github.com/AHK-just-me/AHK_Gui_Constants) + - Function [API_GetWindowInfo()](http://www.autohotkey.com/board/topic/69254-func-api-getwindowinfo-ahk-l/) + - [MDMF - Multiple Display Monitor Functions](http://ahkscript.org/boards/viewtopic.php?f=6&t=4606) +- [majkinetor](http://www.autohotkey.com/board/user/1763-majkinetor/) + - [Forms-Framework](https://github.com/maul-esel/FormsFramework) +- [ManaUser](http://www.autohotkey.com/board/user/3558-manauser/) + - Function `__isWindow(`) - taken from [AppsKeys](http://www.autohotkey.com/board/topic/25393-appskeys-a-suite-of-simple-utility-hotkeys/) +- [maul-esel](https://github.com/maul-esel) + - porting [Forms Framework](https://github.com/maul-esel/FormsFramework) to AHK_L +- [MasterFocus](https://github.com/MasterFocus) + - Function [RandomBezier](https://github.com/MasterFocus/AutoHotkey/tree/master/Functions/RandomBezier) - moving mouse on a random path (bezier curve) +- [Uberi](http://www.autohotkey.com/board/user/12435-uberi/) + - [Yunit-Framework](https://github.com/Uberi/Yunit) +- **and to everyone I might have forgotten** + +### Bugfixes + - [WinSet, Transparent fails on AHK GUI -caption ](http://www.autohotkey.com/board/topic/67874-winset-transparent-fails-on-ahk-gui-caption/) + +### More Inspiration taken from ### + +- [WindowPad](http://http://www.autohotkey.com/board/topic/19990-windowpad-window-moving-tool)/[WindowPadX](https://github.com/hoppfrosch/WindowPadX) - free - based on AutoHotkey as well +- [WindowMenuPlus](http://www.moo0.com/?top=http://www.moo0.com/software/WindowMenuPlus/) - Free (Non-Commercial Use Only) +- [WindowSpace](http://www.ntwind.com/software/windowspace.html) - commercial +- [Winsplit-Revolution](http://winsplit-revolution.com/) - Freeware + +### Used libraries +- [Coco](https://gist.github.com/cocobelgica) + - [SerDes](https://github.com/cocobelgica/AutoHotkey-SerDes)-Function (Serialize / de-serialize an AutoHotkey object structure) +- [Uberi](http://www.autohotkey.com/board/user/12435-uberi/) + - [Yunit-Framework](https://github.com/Uberi/Yunit) +- **and to everyone I might have forgotten** + + +### History + +This project was split of [AHK_EDE](https://github.com/hoppfrosch/AHK_EDE/). + +ChangeLog is available [here](https://github.com/hoppfrosch/AHK_Windy/blob/master/ChangeLog.md) From e7c9d9801b797cc63ff17dfda5db47e25dff7505 Mon Sep 17 00:00:00 2001 From: hoppfrosch Date: Wed, 23 Dec 2015 08:43:35 +0100 Subject: [PATCH 04/13] #42 - Updated Docu-Generator to use NaturlaDocs 2.0 --- _build/mkDoc.bat | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/_build/mkDoc.bat b/_build/mkDoc.bat index f7fdf7e..0413307 100644 --- a/_build/mkDoc.bat +++ b/_build/mkDoc.bat @@ -16,7 +16,7 @@ copy ..\lib\Windy\Windy.ahk %WORK% copy ..\lib\Windy\WindLy.ahk %WORK% ::path to the natural doc folder -SET NDPATH=D:\Portable\PortableApps\AutoHotkey\App\Tools\NaturalDocs\NaturalDocs +SET NDPATH=d:\Usr\programme\NaturalDocs\ pushd %WORK% @@ -30,7 +30,7 @@ mkdir "%ROOT%\%DOC%\_ndProj" 2>nul pushd "%NDPATH%" if exist "%ROOT%\images" SET IMG=-img "%ROOT%\images" -call NaturalDocs.bat -i "%ROOT%" -o HTML "%ROOT%\%DOC%" -p "%ROOT%\%DOC%\_ndProj" %IMG% +call NaturalDocs.exe -i "%ROOT%" -o HTML "%ROOT%\%DOC%" -p "%ROOT%\%DOC%\_ndProj" %IMG% popd From 0d7fbe80a1f55df749a914068fa87fa6d99e43b0 Mon Sep 17 00:00:00 2001 From: hoppfrosch Date: Wed, 23 Dec 2015 09:49:51 +0100 Subject: [PATCH 05/13] #42 - Updated for pretty documentation --- lib/Windy/Pointy.ahk | 165 +++++++++++++++++++------------------------ 1 file changed, 73 insertions(+), 92 deletions(-) diff --git a/lib/Windy/Pointy.ahk b/lib/Windy/Pointy.ahk index bdbfff4..d672ecc 100644 --- a/lib/Windy/Pointy.ahk +++ b/lib/Windy/Pointy.ahk @@ -1,63 +1,77 @@ -; ****** HINT: Documentation can be extracted to HTML using NaturalDocs (http://www.naturaldocs.org/) ************** +; ****** HINT: Documentation can be extracted to HTML using NaturalDocs (http://www.naturaldocs.org/) ************** +; ****** HINT: Debug-lines should contain "; _DBG_" at the end of lines - using this, the debug lines could be automatically removed through scripts before releasing the sourcecode + +class Pointy { ; ****************************************************************************************************************************************** /* Class: Pointy - Handling points (given through [x, y]) + Handling points (given through 2-D coordinates [x, y]) + + Authors: + : Original - Remarks: - ### License - This program is free software. It comes without any warranty, to the extent permitted by applicable law. You can redistribute it and/or modify it under the terms of the Do What The Fuck You Want To Public License, Version 2, as published by Sam Hocevar. See [WTFPL](http://www.wtfpl.net/) for more details. - ### Author - [hoppfrosch](hoppfrosch@gmx.me) - @UseShortForm + About: License + This program is free software. It comes without any warranty, to the extent permitted by applicable law. You can redistribute it and/or modify it under the terms of the Do What The Fuck You Want To Public License, Version 2, as published by Sam Hocevar. See for more details. */ -class Pointy { _version := "0.2.0" _debug := 0 ; _DBG_ x := 0 y := 0 - + ; ##################### Start of Properties (AHK >1.1.16.x) ############################################################ + debug[] { + /* ------------------------------------------------------------------------------- + Property: debug [get/set] + Debug flag for debugging the object + + Value: + flag - *true* or *false* + */ + get { + return this._debug + } + set { + mode := value<1?0:1 + this._debug := mode + return this._debug + } + } + ; ##################### End of Properties (AHK >1.1.16.x) ############################################################## + + /* -------------------------------------------------------------------------------------- + Method: Dump() + Dumps coordinates to a string + + Returns: + printable string containing coordinates + */ Dump() { - /*! =============================================================================== - Method: Dump() - Dumps coordinates to a string - Returns: - printable string containing coordinates - Remarks: - ### Author(s) - * 20140908 - [hoppfrosch](hoppfrosch@gmx.de) - Original - */ return "(" this.x "," this.y ")" } - + /* -------------------------------------------------------------------------------------- + Method: equal(comp) + Compares currrent point to given point + + Parameters: + comp - [Point](Pointy.html) to compare with + + Returns: + true or false + */ equal(comp) { - /*! =============================================================================== - Method: equal(comp) - Compares currrent point to given point - Parameters: - comp - [Point](Pointy.html) to compare with - Returns: - true or false - Remarks: - ### Author(s) - * 20140908 - [hoppfrosch](hoppfrosch@gmx.de) - Original - */ + return (this.x == comp.x) AND (this.y == comp.y) } - + /* -------------------------------------------------------------------------------------- + Method: fromHWnd(hwnd) + Fills values with upper left corner coordinates from given Window (given by Handle) + + Parameters: + hWnd - Window handle, whose upper left corner has to be determined + */ fromHWnd(hwnd) { - /*! =============================================================================== - Method: fromHWnd(hwnd) - Fills values from given Window (given by Handle) - Parameters: - hWnd - Window handle, whose upper left corner has to be determined - Remarks: - ### Author(s) - * 20140908 - [hoppfrosch](hoppfrosch@gmx.de) - Original - */ WinGetPos, x, y, w, h, ahk_id %hwnd% this.x := x this.y := y @@ -66,15 +80,11 @@ class Pointy { return this } - + /* -------------------------------------------------------------------------------------- + Method: fromMouse(hwnd) + Fills values from current mouseposition + */ fromMouse() { - /*! =============================================================================== - Method: fromMouse(hwnd) - Fills values from current Mouseposition - Remarks: - ### Author(s) - * 20140908 - [hoppfrosch](hoppfrosch@gmx.de) - Original - */ CoordMode, Mouse, Screen MouseGetPos, x, y this.x := x @@ -84,18 +94,14 @@ class Pointy { return this } - + /* -------------------------------------------------------------------------------------- + Method: fromPoint(new) + Fills values from given + + Parameters: + new - Point + */ fromPoint(new) { - /*! =============================================================================== - Method: fromPoint(new) - Fills values from given [Point](Pointy.html) - Parameters: - new - Point - Remarks: - ### Author(s) - * 20140908 - [hoppfrosch](hoppfrosch@gmx.de) - Original - */ - this.x := new.x this.y := new.y if (this._debug) ; _DBG_ @@ -103,39 +109,14 @@ class Pointy { return this } + /* --------------------------------------------------------------------------------------- + Constructor: __New + Constructor via given X,X Coordinates - __debug(value="") { ; _DBG_ - /*! =============================================================================== - Method:__debug() - Set or get the debug flag (*INTERNAL*) - Parameters: - value - Value to set the debug flag to (OPTIONAL) - Returns: - true or false, depending on current value - Remarks: - ### Author(s) - * 20140908 - [hoppfrosch](hoppfrosch@gmx.de) - Original - */ - if % (value="") ; _DBG_ - return this._debug ; _DBG_ - value := value<1?0:1 ; _DBG_ - this._debug := value ; _DBG_ - return this._debug ; _DBG_ - } ; _DBG_ - - /* - =============================================================================== - Function: __New - Constructor (*INTERNAL*) - - Parameters: - x,y - X,Y of the point - debug - Flag to enable debugging (Optional - Default: 0) - - Author(s): - * 20140908 - [hoppfrosch](hoppfrosch@gmx.de) - Original - =============================================================================== - */ + Parameters: + x,y - X,Y coordinates of the point + debug - Flag to enable debugging (Optional - Default: 0) + */ __New(x=0, y=0, debug=false) { this._debug := debug ; _DBG_ if (this._debug) ; _DBG_ From 8dcc1bec434b62f1707a701682cb9ffc59dc48bb Mon Sep 17 00:00:00 2001 From: hoppfrosch Date: Wed, 23 Dec 2015 10:12:27 +0100 Subject: [PATCH 06/13] #42 - Updated for pretty documentation --- lib/Windy/Mony.ahk | 41 +++++++++++++++++++++-------------------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/lib/Windy/Mony.ahk b/lib/Windy/Mony.ahk index 03b7f77..4262743 100644 --- a/lib/Windy/Mony.ahk +++ b/lib/Windy/Mony.ahk @@ -11,11 +11,12 @@ Class: Mony Handling a single Monitor, identified via its monitor ID - Author(s): - + Authors: + : Original About: License This program is free software. It comes without any warranty, to the extent permitted by applicable law. You can redistribute it and/or modify it under the terms of the Do What The Fuck You Want To Public License, Version 2, as published by Sam Hocevar. See for more details. + */ class Mony { _debug := 0 @@ -32,7 +33,7 @@ class Mony { Remarks: * There is no setter available, since this is a constant system property - See also: + See Also: */ get { @@ -136,7 +137,7 @@ class Mony { Remarks: * There is no setter available, since this is a constant system property - See also: + See Also: */ get { @@ -159,7 +160,7 @@ class Mony { Remarks: * There is no setter available, since this is a constant system property - See also: + See Also: */ get { @@ -179,6 +180,7 @@ class Mony { More infos on GetMonitorInfo see The return value is an object containing + * Monitor handle * Monitor name * Monitor Id @@ -190,7 +192,7 @@ class Mony { * There is no setter available, since this is a constant system property Authors: - Original - + * Original: */ get { hmon := this.hmon @@ -274,7 +276,7 @@ class Mony { Remarks: * There is no setter available, since this is a constant system property - See also: + See Also: , */ get { @@ -300,7 +302,7 @@ class Mony { Remarks: * There is no setter available, since this is a constant system property - See also: + See Also: , */ get { @@ -319,7 +321,6 @@ class Mony { Determines the scaling factor in y-direction for coordinates when moving to monDest Parameters: - monDest - Destination Monitor number (*Required*, Default := 1) Returns: @@ -328,7 +329,7 @@ class Mony { Remarks: * There is no setter available, since this is a constant system property - See also: + See Also: , */ get { @@ -349,7 +350,7 @@ class Mony { Remarks: * There is no setter available, since this is a constant system property - See also: + See Also: , */ get { @@ -383,7 +384,7 @@ class Mony { Remarks: * There is no setter available, since this is a constant system property - See also: + See Also: , */ get { @@ -405,7 +406,7 @@ class Mony { Remarks: * There is no setter available, since this is a constant system property - See also: + See Also: */ get { @@ -464,7 +465,7 @@ class Mony { The given rectangle-coordinates are transformed into percent of the screen. For example on a 1920x1200 screen the coordinates x=394,y=240,w=960,h=400 are transformed into (20, 20, 50, 33.33) because 394/1920 = 20%, 240/1200=20%, 960/1920=50%, 400/1200=33.33% - Parameter(s): + Parameters: x,y,w,h - position and width/height to be transformed into screen percents Returns: @@ -487,11 +488,11 @@ class Mony { } ; ===== Internal Methods ========================================================= - /* ------------------------------------------------------------------------------- + /*! ------------------------------------------------------------------------------- method: __idHide Helper function for : Hides the Id, shown with <__idShow> (*INTERNAL*) - See also: + See Also: , <__idShow> */ __idHide() { @@ -504,7 +505,7 @@ class Mony { return } - /* ------------------------------------------------------------------------------- + /*! ------------------------------------------------------------------------------- method: __idShow Helper function for : Identify monitor by displaying the monitor id, hidden via <__idHide> (*INTERNAL*) @@ -512,10 +513,10 @@ class Mony { txtcolor - color of the displayed monitor id (*Optional*, Default: "000000") txtsize - size of the displayed monitor id (*Optional*, Default: 300[px]) - Author(s): - Original - + Authors: + * Original: - See also: + See Also: , <__idHide> */ __idShow( txtcolor := "000000", txtsize := 300 ) { From 935dc4e8d8137e8e357fb4db7b1b9abc55cd06f3 Mon Sep 17 00:00:00 2001 From: hoppfrosch Date: Wed, 23 Dec 2015 10:31:37 +0100 Subject: [PATCH 07/13] #42 - Updated for pretty documentation --- lib/Windy/Windy.ahk | 93 +++++++++++++++++++++------------------------ 1 file changed, 43 insertions(+), 50 deletions(-) diff --git a/lib/Windy/Windy.ahk b/lib/Windy/Windy.ahk index d333562..fd7b08c 100644 --- a/lib/Windy/Windy.ahk +++ b/lib/Windy/Windy.ahk @@ -17,12 +17,11 @@ class Windy { Class: Windy Perform actions on windows using an unified class based interface - Author(s): - + Authors: + : Original About: License This program is free software. It comes without any warranty, to the extent permitted by applicable law. You can redistribute it and/or modify it under the terms of the Do What The Fuck You Want To Public License, Version 2, as published by Sam Hocevar. See for more details. - */ _version := "0.9.0" _debug := 0 @@ -156,23 +155,23 @@ class Windy { return __classname } } - debug[] { ; _DBG_ - /* ------------------------------------------------------------------------------- ; _DBG_ - Property: debug [get/set] ; _DBG_ - Debug flag for debugging the object ; _DBG_ - ; _DBG_ - Value: ; _DBG_ - flag - *true* or *false* ; _DBG_ - */ ; _DBG_ - get { ; _DBG_ - return this._debug ; _DBG_ - } ; _DBG_ - set { ; _DBG_ - mode := value<1?0:1 ; _DBG_ - this._debug := mode ; _DBG_ - return this._debug ; _DBG_ - } ; _DBG_ - } ; _DBG_ + debug[] { + /* ------------------------------------------------------------------------------- + Property: debug [get/set] + Debug flag for debugging the object + + Value: + flag - *true* or *false* + */ + get { + return this._debug + } + set { + mode := value<1?0:1 + this._debug := mode + return this._debug + } + } exist[] { /* --------------------------------------------------------------------------------------- Property: exist [get] @@ -710,9 +709,9 @@ class Windy { } } rolledUp[] { - /*! --------------------------------------------------------------------------------------- + /* --------------------------------------------------------------------------------------- Property: rolledUp [get/set] - Is (window rolled up to its title bar? Rolls/De-Rolls the current window or get the current state of RollUp + Is window rolled up to its title bar? Rolls/De-Rolls the current window or get the current state of RollUp Value: flag - *true* or *false* (activates/deactivates *rolledUp*-Property) @@ -777,7 +776,7 @@ class Windy { } rolledUpHeight[] { /* --------------------------------------------------------------------------------------- - Property:rolledUpHeight [get] + Property: rolledUpHeight [get] Height of the caption bar of windows Remarks: @@ -1161,13 +1160,13 @@ class Windy { This method is needed as a helper method in order to allow an easy configuration of window alignment within AHK_EDE ' - Parameter(s): + Parameters: border - string describing the border to move to - for further description see ) - Returns; + Returns: containing the screen percents - See also: + See Also: */ border2percent(border="") { @@ -1227,8 +1226,8 @@ class Windy { Performs the AHK command - See also: - * + See Also: + */ kill() { if (this._debug) ; _DBG_ @@ -1245,7 +1244,7 @@ class Windy { The given coordinates/sizes are absolute coordinates/sizes. If the value of any coordinate is equal *99999* the current value keeps unchanged. - Examples + Examples: * Resize-only can be performed by > obj.move(99999,99999,width,height) @@ -1255,7 +1254,7 @@ class Windy { w - width (absolute) the window has to be resized to - use *99999* to preserve actual value *(Optional)* h - height (absolute) the window has to be resized to - use *99999* to preserve actual value *(Optional)* - See also: + See Also: , */ move(X,Y,W="99999",H="99999") { @@ -1284,26 +1283,26 @@ class Windy { Method: movePercental move and resize window relative to the size of the current screen. - Example(s): + Examples: * create a window with origin 0,0 and a *width=100% of screen width* and *height=100% of screen height* > obj.movePercental(0,0,100,100) * create a window at *x=25% of screen width*, *y =25% of screen height*, and with *width=50% of screen width*, *height=50% of screen height*. The resulting window is a screen centered window with the described width and height > obj.movePercental(25,25,50,50) - Parameter(s): + Parameters: xFactor - x-position factor (percents of current screen width) the window has to be moved to (Range: 0.0 to 100.0) *(*Optional*, Default = 0) yFactor - y-position factor (percents of current screen height) the window has to be moved to (Range: 0.0 to 100.0) (*Optional*, Default = 0) wFactor - width-size factor (percents of current screen width) the window has to be resized to (Range: 0.0 to 100.0) (*Optional*, Default = 100) hFactor - height-size factor (percents of current screen height) the window has to be resized to (Range: 0.0 to 100.0) (*Optional*, Default = 100) - See also: + See Also: , - Author(s): - Original - + Authors: + - Original: - Caveats / Known issues: - * The range of the method parameters is **NOT** checked - so be carefull using any values *<0* or *>100* + Caveats: + - The range of the method parameters is *NOT* checked, so be carefull using any values *<0* or *>100* */ movePercental(xFactor=0, yFactor=0, wFactor=100, hFactor=100) { if (this._debug) ; _DBG_ @@ -1340,16 +1339,10 @@ class Windy { > obj.moveBorder("t l") - Parameter(s): - border - string describing the border to move to - * "t" - top - * "b" - bottom - * "l" - left - * "r" - right - * "vc" - vertically centered - * "hc" - horizonally centered + Parameters: + border - string describing the border to move to (*t*: top, *b*: bottom, *l*: left, *r*: right, *vc*: vertically centered, *hc*: horizonally centered) - See also: + See Also: , */ moveBorder(border="") { @@ -1370,7 +1363,7 @@ class Windy { This method is needed as a helper method in order to allow an easy configuration of window alignment within AHK_EDE ' - Returns; + Returns: containing the screen percents */ posSize2percent() { @@ -1396,8 +1389,8 @@ class Windy { Hint: This function will update the window for sure, unlike or InvalidateRect. - Author(s): - Original - majkinetor + Authors: + * Original: majkinetor */ redraw(Option="" ) { return @@ -1659,7 +1652,7 @@ class Windy { Function: ClassWindy_EventHook Callback on System Events. Used as dispatcher to detect window manipulation and calling the appropriate member-function within class -See also: +See Also: * http://www.autohotkey.com/community/viewtopic.php?t=35659 * http://www.autohotkey.com/community/viewtopic.php?f=1&t=88156 */ From 088c13e149fba36f1e060403be19c333ebc09e9e Mon Sep 17 00:00:00 2001 From: hoppfrosch Date: Wed, 23 Dec 2015 10:44:06 +0100 Subject: [PATCH 08/13] #42 - Updated for pretty documentation --- lib/Windy/Mousy.ahk | 41 +++++++++++++++++++---------------------- 1 file changed, 19 insertions(+), 22 deletions(-) diff --git a/lib/Windy/Mousy.ahk b/lib/Windy/Mousy.ahk index 500771d..a188366 100644 --- a/lib/Windy/Mousy.ahk +++ b/lib/Windy/Mousy.ahk @@ -11,8 +11,8 @@ Class: Mousy Toolset to handle mousecursor within a MultiMonitorEnvironment - Author(s): - + Authors: + : Original About: License This program is free software. It comes without any warranty, to the extent permitted by applicable law. You can redistribute it and/or modify it under the terms of the Do What The Fuck You Want To Public License, Version 2, as published by Sam Hocevar. See for more details. @@ -39,11 +39,11 @@ class Mousy { Value: flag - *true* or *false* - Example: - >obj.confineRect := new Recty(100,100,500,500) - >obj.confine := true ; Confining to previously defined rect is enabled - >obj.confine := false ; Confining to previously defined rect is disabled - >obj.confine := true ; Confining to previously defined rect is re-enabled + Examples: + > obj.confineRect := new Recty(100,100,500,500) + > obj.confine := true ; Confining to previously defined rect is enabled + > obj.confine := false ; Confining to previously defined rect is disabled + > obj.confine := true ; Confining to previously defined rect is re-enabled */ get { return this._bConfine @@ -74,7 +74,7 @@ class Mousy { Value: rect - confining rectangle - See also: + See Also: */ get { @@ -142,10 +142,11 @@ class Mousy { Movement mode while moving the mouse via , , This has to be a value out of - * 0 - mouse jumps immediatialy to the new position - * 1 - mouse moves to new position following a linear track (default) - * 2 - mouse moves to new position following a random track jittering along a line - * 3 - mouse moves to new position following a random track following a bezier curce + + * 0: mouse jumps immediatialy to the new position + * 1: mouse moves to new position following a linear track (default) + * 2: mouse moves to new position following a random track jittering along a line + * 3: mouse moves to new position following a random track following a bezier curce The speed of the movement can be set via */ @@ -427,7 +428,7 @@ class Mousy { x,y - Coordinates to move to Authors: - Original - + * Original: */ __moveRandomBezier(x, y, Speed=-1) { if (speed == -1) { @@ -451,7 +452,7 @@ class Mousy { x,y - Coordinates to move to Authors: - Original - + * Original: */ __moveRandomLinear(x, y, Speed=-1) { if (speed == -1) { @@ -475,7 +476,7 @@ class Mousy { Constructor (*INTERNAL*) Parameters: - debug - Flag to enable debugging (Optional - Default: 0) + debug - Flag to enable debugging (Optional; Default: 0) */ __New( debug := false ) { this._debug := debug ; _DBG_ @@ -502,17 +503,13 @@ along with this script. If not, see . ;======================================================================== ; ; Function: RandomBezier -; Description: Moves the mouse through a random Bézier path +; Moves the mouse through a random Bézier path ; URL (+info): -------------------- ; ; Last Update: 30/May/2013 03:00h BRT ; -; Created by MasterFocus -; - https://github.com/MasterFocus -; - http://masterfocus.ahk4.net -; - http://autohotkey.com/community/viewtopic.php?f=2&t=88198 -; -;======================================================================== +; Author: +; * Created by MasterFocus (https://github.com/MasterFocus, http://masterfocus.ahk4.net, http://autohotkey.com/community/viewtopic.php?f=2&t=88198) RandomBezier( X0, Y0, Xf, Yf, O="") { Time := RegExMatch(O,"i)T(\d+)",M)&&(M1>0)? M1: 10 RO := InStr(O,"RO",0) , RD := InStr(O,"RD",0) From ae5d9684c6a8f1bce53e69b79537be338f7fff11 Mon Sep 17 00:00:00 2001 From: hoppfrosch Date: Wed, 23 Dec 2015 10:50:56 +0100 Subject: [PATCH 09/13] #42 - Updated for pretty documentation --- lib/Windy/WindLy.ahk | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/lib/Windy/WindLy.ahk b/lib/Windy/WindLy.ahk index 9ca0ab6..3a00dac 100644 --- a/lib/Windy/WindLy.ahk +++ b/lib/Windy/WindLy.ahk @@ -8,10 +8,10 @@ /* ****************************************************************************************************************************************** Class: WindLy - Class holding lists of -Objects + Class holding lists of Objects - Author(s): - + Authors: + : Original About: License This program is free software. It comes without any warranty, to the extent permitted by applicable law. You can redistribute it and/or modify it under the terms of the Do What The Fuck You Want To Public License, Version 2, as published by Sam Hocevar. See for more details. @@ -46,7 +46,7 @@ class WindLy { id - Monitor-Id Returns: - List of -Objects on the given monitor + List of Objects on the given monitor */ byMonitorId(id=1) { this.__reset() @@ -54,7 +54,7 @@ class WindLy { for h_Wnd, win in _tmp { h_WndHex := this.__hexStr(h_Wnd) if (win.monitorID = id ) { - this.Insert(win) + this._wl[h_WndHex] := win } } _tmp := {} @@ -68,7 +68,7 @@ class WindLy { myStyle - Windows-Style () Returns: - List of -Objects matching the given style + List of Objects matching the given style */ byStyle(myStyle) { this.__reset() @@ -89,7 +89,7 @@ class WindLy { deletes a single Windy-object from current instance Parameters: - oWindy - -Object to be deleted + oWindy - Object to be deleted */ delete(oWindy) { x := this.__decStr(oWindy._hwnd) @@ -105,7 +105,7 @@ class WindLy { The difference contains only elements from the current instance which are not part of the given WindLy-object Parameters: - oWindLy - -Object to be used for calculating difference + oWindLy - Object to be used for calculating difference */ difference(oWindLy) { for currhwnd, data in oWindLy.list { @@ -118,7 +118,7 @@ class WindLy { Inserts a single Windy-object into current instance Parameters: - oWindy - -Object to be inserted + oWindy - Object to be inserted */ insert(oWindy) { if (!this._wl[oWindy._hwnd]) { @@ -130,11 +130,11 @@ class WindLy { Method: intersection Calculates the INTERSECTION of the given WindLy-Object and the current instance - The result only contains -Objects which + The result only contains Objects which have been in the current instance as well as in the given WindLy-Object Parameters: - oWindy - -Object to be inserted + oWindy - Object to be inserted */ intersection(oWindLy) { result := new WindLy() @@ -150,7 +150,7 @@ class WindLy { Method: removeNonExisting Remove non-existing windows from the list - The result only contains -Objects which + The result only contains Objects which do currently exist. Non existing windows are removed from the list. */ removeNonExisting() { @@ -173,7 +173,7 @@ class WindLy { Initializes the window list from all currently openend windows Returns: - List of -Objects. + List of Objects. */ snapshot() { this.__reset() @@ -184,11 +184,11 @@ class WindLy { Method: symmetricDifference Calculates the SYMMETRICDIFFERENCE of the given WindLy-Object and the current instance - The result only contains -Objects which + The result only contains Objects which have not been in the current instance as well as not in the given WindLy-Object (Removes items which occur in both lists) Parameters: - oWindy - -Object to operate with + oWindy - Object to operate with */ symmetricDifference(oWindLy) { result := new WindLy() @@ -219,7 +219,7 @@ class WindLy { The Union contains all elements from the current instance as well as the given WindLy-object Parameters: - oWindLy - -Object to be used for calculating union + oWindLy - Object to be used for calculating union */ union(oWindLy) { for currhwnd, data in oWindLy.list { @@ -230,12 +230,12 @@ class WindLy { ; ######################## Internal Methods - not to be called directly ############################################ ; ===== Internal Methods ========================================================= - /* ------------------------------------------------------------------------------- + /*! ------------------------------------------------------------------------------- method: __all Gets all currently openend windows and returns as a List of Objects (*INTERNAL*) Returns: - List of -Objects + List of Objects */ __all() { hwnds := this.__hwnds(true) @@ -250,7 +250,7 @@ class WindLy { return ret } - /* --------------------------------------------------------------------------------------- + /*! --------------------------------------------------------------------------------------- Method: __hwnds Determines handles of all current windows(*INTERNAL*) @@ -280,7 +280,7 @@ class WindLy { } - /* --------------------------------------------------------------------------------------- + /*! --------------------------------------------------------------------------------------- Method: __isRealWindow Checks whether the given hWnd refers to a TRUE window (As opposed to the desktop or a menu, etc.) (*INTERNAL*) @@ -298,7 +298,7 @@ class WindLy { ret := s & WS.CAPTION ? (s & WS.POPUP ? 0 : 1) : 0 return ret } - /* ------------------------------------------------------------------------------- + /*! ------------------------------------------------------------------------------- method: __reset Initializes all the data (*INTERNAL*) */ @@ -329,7 +329,7 @@ class WindLy { return this } - /* --------------------------------------------------------------------------------------- + /*! --------------------------------------------------------------------------------------- Method: ____hexStr Converts number to hex representation (*INTERNAL*) */ From 3280e15137975d035d207caa117b4391e6b0d6ba Mon Sep 17 00:00:00 2001 From: hoppfrosch Date: Wed, 23 Dec 2015 10:57:12 +0100 Subject: [PATCH 10/13] #42 - Updated for pretty documentation --- lib/Windy/MultiMony.ahk | 66 ++++++++++++++++++++--------------------- 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/lib/Windy/MultiMony.ahk b/lib/Windy/MultiMony.ahk index bd2c627..62eebc9 100644 --- a/lib/Windy/MultiMony.ahk +++ b/lib/Windy/MultiMony.ahk @@ -11,8 +11,8 @@ Class: MultiMony Handling Multiple Display-Monitor Environments - Author(s): - + Authors: + : Original About: License This program is free software. It comes without any warranty, to the extent permitted by applicable law. You can redistribute it and/or modify it under the terms of the Do What The Fuck You Want To Public License, Version 2, as published by Sam Hocevar. See for more details. @@ -22,22 +22,21 @@ class MultiMony { _version := "1.0.1" ; ===== Properties ============================================================== - debug[] { ; _DBG_ - /* ------------------------------------------------------------------------------- + debug[] { + /* ------------------------------------------------------------------------------- Property: debug [get/set] Debug flag for debugging the object Value: flag - *true* or *false* */ - get { - return this._debug ; _DBG_ + return this._debug } set { - mode := value<1?0:1 ; _DBG_ - this._debug := mode ; _DBG_ - return this._debug ; _DBG_ + mode := value<1?0:1 + this._debug := mode + return this._debug } } monitorsCount[] { @@ -66,7 +65,7 @@ class MultiMony { Remarks: * There is no setter available, since this is a constant system property - See also: + See Also: */ get { @@ -98,7 +97,7 @@ class MultiMony { Remarks: * There is no setter available, since this is a constant system property - See also: + See Also: */ get { @@ -117,7 +116,7 @@ class MultiMony { /* ------------------------------------------------------------------------------- Method: coordDisplayToVirtualScreen - Transforms coordinates relative to given monitor into absolute (virtual) coordinates. Returns object of type . + Transforms coordinates relative to given monitor into absolute (virtual) coordinates. Returns object of type Parameters: id - id of the monitor @@ -171,9 +170,9 @@ class MultiMony { Handle of the monitor at specified coordinates Authors: - Original - + * Original: - See also: + See Also: */ hmonFromCoord(x := "", y := "") { @@ -202,9 +201,9 @@ class MultiMony { Handle of the monitor containing the specified window Authors: - Original - + * Original: - See also: + See Also: */ hmonFromHwnd(hwnd) { @@ -223,7 +222,7 @@ class MultiMony { Returns: Monitor Handle - See also: + See Also: */ hmonFromid(id := 1) { @@ -234,7 +233,7 @@ class MultiMony { return hmon } /* ------------------------------------------------------------------------------- - Method: hmonFromRect + Method: hmonFromRect Get the handle of the monitor that has the largest area of intersection with a specified rectangle. Parameters: @@ -244,9 +243,9 @@ class MultiMony { Monitor Handle Authors: - Original - + * Original: - See also: + See Also: */ hmonFromRect(x, y, w, h) { @@ -261,13 +260,13 @@ class MultiMony { return hmon } /* ------------------------------------------------------------------------------- - method: identify + method: identify Identify monitors by displaying the monitor id on each monitor Parameters: disptime - time to display the monitor id (*Optional*, Default: 1500[ms]) - txtcolor - color of the displayed monitor id(*Optional*, Default: "000000") - txtsize - size of the displayed monitor id(*Optional*, Default: 300[px]) + txtcolor - color of the displayed monitor id (*Optional*, Default: "000000") + txtsize - size of the displayed monitor id (*Optional*, Default: 300[px]) */ identify(disptime := 1500, txtcolor := "000000", txtsize := 300) { @@ -302,7 +301,7 @@ class MultiMony { Returns: Index of the monitor at specified coordinates - See also: + See Also: */ idFromCoord(x, y, default := 1) { @@ -330,7 +329,7 @@ class MultiMony { Returns: ID of the monitor containing the specified window - See also: + See Also: */ idFromHwnd(hwnd) { @@ -368,7 +367,7 @@ class MultiMony { Returns: Index of the monitor - See also: + See Also: */ idFromHmon(hmon) { @@ -390,7 +389,7 @@ class MultiMony { Returns: Monitor Handle - See also: + See Also: */ idFromRect(x, y, w, h) { @@ -406,9 +405,9 @@ class MultiMony { Parameters: id - monitor, whose next monitorid has to be determined - cycle - == 1 cycle through monitors; == 0 stop at last monitor (*Optional*, Default: 1) + cycle - *== 1* cycle through monitors; *== 0* stop at last monitor (*Optional*, Default: 1) - See also: + See Also: */ idNext( currMon := 1, cycle := true ) { @@ -434,9 +433,9 @@ class MultiMony { Parameters: id - monitor, whose previous monitor id has to be determined - cycle - == true cycle through monitors; == false stop at last monitor (*Optional*, Default: true) + cycle - *== true* cycle through monitors; *== false* stop at first monitor (*Optional*, Default: true) - See also: + See Also: */ idPrev( currMon := 1, cycle := true ) { @@ -457,10 +456,11 @@ class MultiMony { return prevMon } /* ------------------------------------------------------------------------------- - Method: Enumerates display monitors and returns an object all monitors (list of -object ) + Method: monitors + Enumerates display monitors and returns an object all monitors (list of object ) Returns: - monitors - associative array with monitor id as key and -objects as values + monitors - associative array with monitor id as key and objects as values */ monitors() { Monis := {} From 0a57fa3d7d373d070c7885bbacb76836692bdd4d Mon Sep 17 00:00:00 2001 From: hoppfrosch Date: Wed, 23 Dec 2015 11:31:55 +0100 Subject: [PATCH 11/13] #42 - Updated for pretty documentation --- lib/Windy/Recty.ahk | 252 ++++++++++++++++++++++---------------------- 1 file changed, 125 insertions(+), 127 deletions(-) diff --git a/lib/Windy/Recty.ahk b/lib/Windy/Recty.ahk index e691dde..88d655e 100644 --- a/lib/Windy/Recty.ahk +++ b/lib/Windy/Recty.ahk @@ -6,8 +6,8 @@ class Recty { Class: Recty Handling rectangles (given through [x, y (upper-left corner), w, h] or [x, y (upper-left corner), x, y (lower-right corner)]) - Author(s): - + Authors: + : Original About: License This program is free software. It comes without any warranty, to the extent permitted by applicable law. You can redistribute it and/or modify it under the terms of the Do What The Fuck You Want To Public License, Version 2, as published by Sam Hocevar. See for more details. @@ -20,79 +20,171 @@ class Recty { w := 0 h := 0 - Dump() { - /* =============================================================================== + ; ##################### Start of Properties (AHK >1.1.16.x) ############################################################ + debug[] { + /* ------------------------------------------------------------------------------- + Property: debug [get/set] + Debug flag for debugging the object + + Value: + flag - *true* or *false* + */ + get { + return this._debug + } + set { + mode := value<1?0:1 + this._debug := mode + return this._debug + } + } + __Get(aName) { + /* --------------------------------------------------------------------------------------- + Property: x [get/set] + Get or Set x-coordinate of the upper left corner of the rectangle + + This is identical to property + */ + + /* --------------------------------------------------------------------------------------- + Property: y [get/set] + Get or Set y-coordinate of the upper left corner of the rectangle + + This is identical to property + */ + + /* --------------------------------------------------------------------------------------- + Property: w [get/set] + Get or Set the width of the rectangle + */ + + /* --------------------------------------------------------------------------------------- + Property: h [get/set] + Get or Set the height of the rectangle + */ + + if (aName = "xul") ; x - upper left corner + /* --------------------------------------------------------------------------------------- + Property: xul [get/set] + Get or Set x-coordinate of the upper left corner of the rectangle + + This is identical to property + */ + return this.x + if (aName = "yul") ; y - upper left corner + /* --------------------------------------------------------------------------------------- + Property: yul [get/set] + Get or Set y-coordinate of the upper left corner of the rectangle + + This is identical to property + */ + return this.y + if (aName = "xlr") ; x - lower right corner + /* --------------------------------------------------------------------------------------- + Property: xlr [get/set] + Get or Set x-coordinate of the lower right corner of the rectangle + */ + return this.x+this.w + if (aName = "ylr") ; y - lower right left corner + /* --------------------------------------------------------------------------------------- + Property: ylr [get/set] + Get or Set y-coordinate of the lower right corner of the rectangle + */ + return this.y+this.h + + return + } + __Set(aName, aValue) { + /*! =============================================================================== + Method: __Set + Custom Setter Function (*INTERNAL*) + */ + if aName in xul,yul,xlr,ylr + { + if (aName = "xul") + this.x := aValue + else if (aName = "yul") + this.y := aValue + else if (aName = "xlr") + this.w := aValue - this.x + else if (aName = "ylr") + this.h := aValue - this.y + + return aValue + } + } + ; ##################### End of Properties (AHK >1.1.16.x) ############################################################## + + /* --------------------------------------------------------------------------------------- Method: Dump Dumps coordinates to a string Returns: printable string containing coordinates */ - + Dump() { return "(" this.x "," this.y "," this.w "," this.h ")" } - equal(comp) { - /* =============================================================================== + /* --------------------------------------------------------------------------------------- Method: equal Compares currrent rectangle to given rectangle Parameters: - comp - to compare with + comp - to compare with Returns: true or false - See also: - , + See Also: + , */ - + equal(comp) { return this.equalPos(comp) AND this.equalSize(comp) } - equalPos(comp) { - /* =============================================================================== + /* --------------------------------------------------------------------------------------- Method: equalPos Compares currrent rectangle position to given rectangle position Parameters: - comp - to compare with + comp - to compare with Returns: true or false - See also: - , + See Also: + , */ - + equalPos(comp) { return (this.x == comp.x) AND (this.y == comp.y) } - equalSize(comp) { - /* =============================================================================== + /* --------------------------------------------------------------------------------------- Method: equalSize Compares currrent rectangle size to given rectangle size Parameters: - comp - to compare with + comp - to compare with Returns: true or false - See also: - , + See Also: + , */ + equalSize(comp) { ret := (this.w == comp.w) AND (this.h == comp.h) return ret } - fromHWnd(hwnd) { - /* =============================================================================== + /* --------------------------------------------------------------------------------------- Method: fromHWnd(hwnd) Fills values from given Window (given by Handle) Parameters: hWnd - Window handle, whose geometry has to be determined - See also: - + See Also: + */ + fromHWnd(hwnd) { WinGetPos, x, y, w, h, ahk_id %hwnd% this.x := x this.y := y @@ -101,14 +193,14 @@ class Recty { if (this._debug) ; _DBG_ OutputDebug % "|[" A_ThisFunc "([" hwnd "])] -> x,y,w,h: (" x "," y "," w "," h ")" ; _DBG_ } - fromRectangle(new) { - /*! =============================================================================== + /* --------------------------------------------------------------------------------------- Method: fromRectangle(new) - Fills values from given + Fills values from given Parameters: - new - Rectangle + new - */ + fromRectangle(new) { this.x := new.x this.y := new.y this.w := new.w @@ -116,90 +208,15 @@ class Recty { if (this._debug) ; _DBG_ OutputDebug % "|[" A_ThisFunc "] -> x,y,w,h: " this.Dump() ; _DBG_ } - - __debug(value="") { ; _DBG_ - /* =============================================================================== - Method: __debug - Set or get the debug flag - - Parameters: - value - Value to set the debug flag to (*OPTIONAL*) - - Returns: - true or false, depending on current value - */ - if % (value="") ; _DBG_ - return this._debug ; _DBG_ - value := value<1?0:1 ; _DBG_ - this._debug := value ; _DBG_ - return this._debug ; _DBG_ - } ; _DBG_ - __Get(aName) { - /* --------------------------------------------------------------------------------------- - Property: x [get/set] - Get or Set x-coordinate of the upper left corner of the rectangle - - This is identical to property - */ - - /* --------------------------------------------------------------------------------------- - Property: y [get/set] - Get or Set y-coordinate of the upper left corner of the rectangle - - This is identical to property - */ - - /* --------------------------------------------------------------------------------------- - Property: w [get/set] - Get or Set the width of the rectangle - */ - - /* --------------------------------------------------------------------------------------- - Property: h [get/set] - Get or Set the height of the rectangle - */ - - if (aName = "xul") ; x - upper left corner - /* --------------------------------------------------------------------------------------- - Property: xul [get/set] - Get or Set x-coordinate of the upper left corner of the rectangle - - This is identical to property - */ - return this.x - if (aName = "yul") ; y - upper left corner - /* --------------------------------------------------------------------------------------- - Property: yul [get/set] - Get or Set y-coordinate of the upper left corner of the rectangle - - This is identical to property - */ - return this.y - if (aName = "xlr") ; x - lower right corner - /* --------------------------------------------------------------------------------------- - Property: xlr [get/set] - Get or Set x-coordinate of the lower right corner of the rectangle - */ - return this.x+this.w - if (aName = "ylr") ; y - lower right left corner - /* --------------------------------------------------------------------------------------- - Property: ylr [get/set] - Get or Set y-coordinate of the lower right corner of the rectangle - */ - return this.y+this.h - - return - } - __New(x=0, y=0, w=0, h=0, debug=false) { - /*! =============================================================================== + /* --------------------------------------------------------------------------------------- Method: __New Constructor (*INTERNAL*) Parameters: x,y,w,h - X,Y (upper left corner coordinates) and Width, Height of the rectangle debug - Flag to enable debugging (*Optional* - Default: false) - */ - + */ + __New(x=0, y=0, w=0, h=0, debug=false) { this._debug := debug ; _DBG_ if (this._debug) ; _DBG_ OutputDebug % "|[" A_ThisFunc "(x=" x ", y=" y ", w=" w ", h=" h ", _debug=" debug ")] (version: " this._version ")" ; _DBG_ @@ -208,25 +225,6 @@ class Recty { this.w := w this.h := h } - __Set(aName, aValue) { - /*! =============================================================================== - Method: __Set - Custom Setter Function (*INTERNAL*) - */ - if aName in xul,yul,xlr,ylr - { - if (aName = "xul") - this.x := aValue - else if (aName = "yul") - this.y := aValue - else if (aName = "xlr") - this.w := aValue - this.x - else if (aName = "ylr") - this.h := aValue - this.y - - return aValue - } - } } /*! From 9ff0bb065fd34fdb98b26cf609e9bb67376ce93c Mon Sep 17 00:00:00 2001 From: hoppfrosch Date: Wed, 23 Dec 2015 11:49:28 +0100 Subject: [PATCH 12/13] #43 - INTERNAL: Recty: Converted property implementation to properties from AutoHotkey 1.1.16 --- YUnit_Recty.ahk | 2 +- lib/Windy/Recty.ahk | 167 ++++++++++++++++++++++++++------------------ 2 files changed, 99 insertions(+), 70 deletions(-) diff --git a/YUnit_Recty.ahk b/YUnit_Recty.ahk index 4800eec..9ea8d58 100644 --- a/YUnit_Recty.ahk +++ b/YUnit_Recty.ahk @@ -9,7 +9,7 @@ #Warn All #Warn LocalSameAsGlobal, Off -ReferenceVersion := "0.3.0" +ReferenceVersion := "0.3.1" Yunit.Use(YunitStdOut, YunitWindow).Test(CompareTestSuite, MiscTestSuite) Return diff --git a/lib/Windy/Recty.ahk b/lib/Windy/Recty.ahk index 88d655e..c8244db 100644 --- a/lib/Windy/Recty.ahk +++ b/lib/Windy/Recty.ahk @@ -13,7 +13,7 @@ class Recty { This program is free software. It comes without any warranty, to the extent permitted by applicable law. You can redistribute it and/or modify it under the terms of the Do What The Fuck You Want To Public License, Version 2, as published by Sam Hocevar. See for more details. */ - _version := "0.3.0" + _version := "0.3.1" _debug := 0 ; _DBG_ x := 0 y := 0 @@ -38,79 +38,108 @@ class Recty { return this._debug } } - __Get(aName) { - /* --------------------------------------------------------------------------------------- - Property: x [get/set] - Get or Set x-coordinate of the upper left corner of the rectangle - - This is identical to property - */ - - /* --------------------------------------------------------------------------------------- - Property: y [get/set] - Get or Set y-coordinate of the upper left corner of the rectangle - - This is identical to property - */ - - /* --------------------------------------------------------------------------------------- - Property: w [get/set] - Get or Set the width of the rectangle - */ + /* --------------------------------------------------------------------------------------- + Property: x [get/set] + Get or Set x-coordinate of the upper left corner of the rectangle + + Value: + x - x-coordinate of the upper left corner of the rectangle + + See Also: + + */ + /* --------------------------------------------------------------------------------------- + Property: y [get/set] + Get or Set y-coordinate of the upper left corner of the rectangle + + Value: + y - y-coordinate of the upper left corner of the rectangle + + See Also: + + */ + /* --------------------------------------------------------------------------------------- + Property: w [get/set] + Get or Set the width of the rectangle + + Value: + w - width of the rectangle + */ + /* --------------------------------------------------------------------------------------- + Property: h [get/set] + Get or Set the height of the rectangle + + Value: + h - height of the rectangle + */ + xul[] { + /* ------------------------------------------------------------------------------- + Property: xul [get/set] + Get or Set x-coordinate of the upper left corner of the rectangle - /* --------------------------------------------------------------------------------------- - Property: h [get/set] - Get or Set the height of the rectangle - */ - - if (aName = "xul") ; x - upper left corner - /* --------------------------------------------------------------------------------------- - Property: xul [get/set] - Get or Set x-coordinate of the upper left corner of the rectangle - - This is identical to property - */ + Value: + xul - x-coordinate of the upper left corner of the rectangle + + See Also: + + */ + get { return this.x - if (aName = "yul") ; y - upper left corner - /* --------------------------------------------------------------------------------------- - Property: yul [get/set] - Get or Set y-coordinate of the upper left corner of the rectangle - - This is identical to property - */ + } + set { + this.x := value + return this.x + } + } + yul[] { + /* ------------------------------------------------------------------------------- + Property: yul [get/set] + Get or Set y-coordinate of the upper left corner of the rectangle + + Value: + y - y-coordinate of the upper left corner of the rectangle + + See Also: + + */ + get { return this.y - if (aName = "xlr") ; x - lower right corner - /* --------------------------------------------------------------------------------------- - Property: xlr [get/set] - Get or Set x-coordinate of the lower right corner of the rectangle - */ - return this.x+this.w - if (aName = "ylr") ; y - lower right left corner - /* --------------------------------------------------------------------------------------- - Property: ylr [get/set] - Get or Set y-coordinate of the lower right corner of the rectangle - */ - return this.y+this.h + } + set { + this.y := value + return this.y + } + } + xlr[] { + /* ------------------------------------------------------------------------------- + Property: xlr [get/set] + Get or Set x-coordinate of the lower right corner of the rectangle - return + Value: + xlr - x-coordinate of the lower right corner of the rectangle + */ + get { + return this.x+this.w + } + set { + this.w := value - this.x + return value + } } - __Set(aName, aValue) { - /*! =============================================================================== - Method: __Set - Custom Setter Function (*INTERNAL*) - */ - if aName in xul,yul,xlr,ylr - { - if (aName = "xul") - this.x := aValue - else if (aName = "yul") - this.y := aValue - else if (aName = "xlr") - this.w := aValue - this.x - else if (aName = "ylr") - this.h := aValue - this.y - - return aValue + ylr[] { + /* ------------------------------------------------------------------------------- + Property: ylr [get/set] + Get or Set y-coordinate of the lower right corner of the rectangle + + Value: + ylr - y-coordinate of the lower right corner of the rectangle + */ + get { + return this.y+this.h + } + set { + this.h := value - this.y + return value } } ; ##################### End of Properties (AHK >1.1.16.x) ############################################################## From ca3744c08248fef72342e015859e4df572a0f6f7 Mon Sep 17 00:00:00 2001 From: hoppfrosch Date: Wed, 23 Dec 2015 11:57:13 +0100 Subject: [PATCH 13/13] [RC] Windy 0.15.3 Closes #37 - Windy: Correct name of property resizeable[] to resizable[] Closes #41 - INTERNAL: Readme.md: Update with several Badges Closes #42 - INTERNAL: Refactor for NaturalDocs 2.0 Closes #43 - INTERNAL: Recty: Use property feature from AutoHotkey 1.1.16 --- lib/Windy.ahk | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/Windy.ahk b/lib/Windy.ahk index 6373f10..33a9180 100644 --- a/lib/Windy.ahk +++ b/lib/Windy.ahk @@ -1,5 +1,5 @@ /* - Title: _ Windy, v0.15.0 + Title: Windy, v0.15.3 Windy provides a collection of classes, which allow a class based approach of handling windows, monitors, etc. @@ -12,8 +12,8 @@ * - Windows * - Collection (List) of Windows - Author(s): - + Authors: + : Original About: License This program is free software. It comes without any warranty, to the extent permitted by applicable law. You can redistribute it and/or modify it under the terms of the Do What The Fuck You Want To Public License, Version 2, as published by Sam Hocevar. See for more details. @@ -31,4 +31,4 @@ #include Windy.ahk -Version := "0.15.2" \ No newline at end of file +Version := "0.15.3" \ No newline at end of file