 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
majkinetor
Joined: 24 May 2006 Posts: 3652 Location: Belgrade
|
Posted: Thu Aug 02, 2007 9:20 am Post subject: [module] ScrollBar 1.1 |
|
|
Encapsulation of scroll bar control.
Documentation in the code (to create HTML docs see this)
Download
API
| Code: | Add (hGui, x, y, w, h, handler, o1="", o2="", o3="", o4="", o5="")
Enable (hCtrl, enable=true)
Get (hCtrl, info="pos")
Set (hCtrl, nPos=0, nMin=-1, nMax=-1, nPage=-1, redraw=0)
SetPos (hCtrl, nPos=1)
Show (hCtrl, show=true) |
Example:
| Code: | Gui, +LastFound
hwnd := WinExist()
Gui, Add, Edit, y50 w130, 0
hHBar := ScrollBar_Add(hwnd, 0, 15, 280, 10, "OnScroll", "min=0", "max=50", "page=5")
hVBar := ScrollBar_Add(hwnd, 280, 5, 20, 295, "OnScroll", "style=ver", "pos=10")
Gui, show, h300 w300, ScrollBar Test
return
OnScroll:
s := ScrollBar_HWND = hHBar ? "horizontal" : "vertical"
ControlSetText, Edit1, %ScrollBar_POS% - %s% bar
return |
_________________

Last edited by majkinetor on Thu Aug 16, 2007 10:20 am; edited 4 times in total |
|
| Back to top |
|
 |
Chris Site Admin
Joined: 02 Mar 2004 Posts: 10480
|
Posted: Thu Aug 02, 2007 3:22 pm Post subject: |
|
|
As always, it's impressively professional in interface and documentation. This and much of your other work are obviously quite suitable for the standard library. When you get more time, perhaps we can make a list of you works for the stdlib and set up a means to merge and distribute the files and documentation with AutoHotkey.
To avoid confusion with status bars, I wonder if ScrollBar_ would be a better prefix than SBar_. Clearly it would be less convenient to type it; but given the rarity of using scrollbars, maybe the higher readability (in both code and documentation) would be worth it. |
|
| Back to top |
|
 |
engunneer
Joined: 30 Aug 2005 Posts: 6847 Location: Pacific Northwest, US
|
Posted: Thu Aug 02, 2007 4:13 pm Post subject: |
|
|
majkinetor,
Welcome back! Did you have a good vacation from the forum? As always you have a well thought out script. _________________
Unless otherwise noted, all code is untested.
Common Answers: 1.(Loops, Viruses, etc.) 2. Search 3.RTFM |
|
| Back to top |
|
 |
daniel2
Joined: 23 Jul 2007 Posts: 47
|
Posted: Fri Aug 03, 2007 5:09 pm Post subject: |
|
|
Wow! No dll.......
Whats next? SBar_Anchor()  |
|
| Back to top |
|
 |
Washboard Guest
|
Posted: Fri Aug 03, 2007 9:51 pm Post subject: |
|
|
As allways, a very good ans well documented control from majkinetor.
Thanks a lot  |
|
| Back to top |
|
 |
corrupt
Joined: 29 Dec 2004 Posts: 2436
|
Posted: Mon Aug 06, 2007 8:36 pm Post subject: |
|
|
Cool. Thanks
| daniel2 wrote: | Wow! No dll....... | Yes, dll, but since it's a common control the dll should already exist in your Windows installation . |
|
| Back to top |
|
 |
majkinetor
Joined: 24 May 2006 Posts: 3652 Location: Belgrade
|
Posted: Thu Aug 16, 2007 10:25 am Post subject: |
|
|
version 1.1
- fixed problem with upper arrow not responding to clicks
- new API functions: Enable, Show, SetPos
- new Add option: glue
Glue scroll bar to the GUI control
- new Add option for widht|height of vertical|horizontal scroll
set -1 to use system default size
- module name changed to ScrollBar _________________
 |
|
| Back to top |
|
 |
Hardeep
Joined: 02 Jul 2006 Posts: 87
|
Posted: Thu Aug 16, 2007 10:35 am Post subject: |
|
|
Welcome changes  |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|