AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

[module] ScrollBar 1.1

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions
View previous topic :: View next topic  
Author Message
majkinetor



Joined: 24 May 2006
Posts: 3652
Location: Belgrade

PostPosted: Thu Aug 02, 2007 9:20 am    Post subject: [module] ScrollBar 1.1 Reply with quote

    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
View user's profile Send private message MSN Messenger
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10480

PostPosted: Thu Aug 02, 2007 3:22 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
engunneer



Joined: 30 Aug 2005
Posts: 6847
Location: Pacific Northwest, US

PostPosted: Thu Aug 02, 2007 4:13 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
daniel2



Joined: 23 Jul 2007
Posts: 47

PostPosted: Fri Aug 03, 2007 5:09 pm    Post subject: Reply with quote

Wow! Shocked No dll....... Exclamation

Whats next? SBar_Anchor() Very Happy
Back to top
View user's profile Send private message
Washboard
Guest





PostPosted: Fri Aug 03, 2007 9:51 pm    Post subject: Reply with quote

As allways, a very good ans well documented control from majkinetor.
Thanks a lot Very Happy Very Happy Very Happy
Back to top
corrupt



Joined: 29 Dec 2004
Posts: 2436

PostPosted: Mon Aug 06, 2007 8:36 pm    Post subject: Reply with quote

Cool. Thanks Smile

daniel2 wrote:
Wow! Shocked No dll....... Exclamation
Yes, dll, but since it's a common control the dll should already exist in your Windows installation Wink .
Back to top
View user's profile Send private message Visit poster's website
majkinetor



Joined: 24 May 2006
Posts: 3652
Location: Belgrade

PostPosted: Thu Aug 16, 2007 10:25 am    Post subject: Reply with quote

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
View user's profile Send private message MSN Messenger
Hardeep



Joined: 02 Jul 2006
Posts: 87

PostPosted: Thu Aug 16, 2007 10:35 am    Post subject: Reply with quote

Welcome changes Cool
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group