Adopted franckspike's more general Manager_loop
This commit is contained in:
parent
64bccf01e5
commit
1546091696
2 changed files with 12 additions and 10 deletions
|
@ -15,6 +15,7 @@ summarizes these sources (of ideas or code):
|
||||||
+ Window information handling patches
|
+ Window information handling patches
|
||||||
- memory leaks
|
- memory leaks
|
||||||
- flickering windows
|
- flickering windows
|
||||||
|
* [morinted](https://github.com/morinted): [Read in sound volume](https://github.com/fuhsjr00/bug.n/issues/11)
|
||||||
|
|
||||||
#### Ideas or concepts
|
#### Ideas or concepts
|
||||||
|
|
||||||
|
@ -24,6 +25,7 @@ summarizes these sources (of ideas or code):
|
||||||
|
|
||||||
#### Code snippets
|
#### Code snippets
|
||||||
|
|
||||||
|
* [franckspike](https://github.com/franckspike): [More general loop function](https://github.com/franckspike/bug.n/commit/e4e615512b363e8c342bf02cf9067cfeb4cc5d57#diff-e42236c27dedd9350fa8c9b9654fd485)
|
||||||
* fures: System + Network monitor - with net history graph (AutoHotkey forum)
|
* fures: System + Network monitor - with net history graph (AutoHotkey forum)
|
||||||
* maestrith: Script Writer (github.com/maestrith/Script_Writer)
|
* maestrith: Script Writer (github.com/maestrith/Script_Writer)
|
||||||
* PhiLho: [AC/Battery status](http://www.autohotkey.com/forum/topic7633.html)
|
* PhiLho: [AC/Battery status](http://www.autohotkey.com/forum/topic7633.html)
|
||||||
|
|
|
@ -281,17 +281,17 @@ Manager_lockWorkStation()
|
||||||
}
|
}
|
||||||
;; Unambiguous: Re-use WIN+L as a hotkey in bug.n (http://www.autohotkey.com/community/viewtopic.php?p=500903&sid=eb3c7a119259b4015ff045ef80b94a81#p500903)
|
;; Unambiguous: Re-use WIN+L as a hotkey in bug.n (http://www.autohotkey.com/community/viewtopic.php?p=500903&sid=eb3c7a119259b4015ff045ef80b94a81#p500903)
|
||||||
|
|
||||||
Manager_loop(index, increment, lowerBound, upperBound)
|
Manager_loop(index, increment, lowerBound, upperBound) {
|
||||||
{
|
If (upperBound <= 0) Or (upperBound < lowerBound) Or (upperBound = 0)
|
||||||
index += increment
|
Return, 0
|
||||||
If (index > upperBound)
|
|
||||||
index := lowerBound
|
|
||||||
If (index < lowerBound)
|
|
||||||
index := upperBound
|
|
||||||
If (upperBound = 0)
|
|
||||||
index := 0
|
|
||||||
|
|
||||||
Return, index
|
numberOfIndexes := upperBound - lowerBound + 1
|
||||||
|
lowerBoundBasedIndex := index - lowerBound
|
||||||
|
lowerBoundBasedIndex := Mod(lowerBoundBasedIndex + increment, numberOfIndexes)
|
||||||
|
If (lowerBoundBasedIndex < 0)
|
||||||
|
lowerBoundBasedIndex += numberOfIndexes
|
||||||
|
|
||||||
|
Return, lowerBound + lowerBoundBasedIndex
|
||||||
}
|
}
|
||||||
|
|
||||||
Manager__setWinProperties(wndId, isManaged, m, tags, isDecorated, isFloating, hideTitle, action = "")
|
Manager__setWinProperties(wndId, isManaged, m, tags, isDecorated, isFloating, hideTitle, action = "")
|
||||||
|
|
Loading…
Reference in a new issue