AutoHotkey Community

It is currently May 25th, 2012, 1:49 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 8 posts ] 
Author Message
 Post subject: [module] ScrollBar 1.1
PostPosted: August 2nd, 2007, 10:20 am 
Offline

Joined: May 24th, 2006, 2:49 pm
Posts: 4511
Location: Belgrade
    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)



    Image

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

_________________
Image


Last edited by majkinetor on August 16th, 2007, 11:20 am, edited 4 times in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 2nd, 2007, 4:22 pm 
Offline

Joined: March 2nd, 2004, 3:36 pm
Posts: 10720
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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 2nd, 2007, 5:13 pm 
Online
User avatar

Joined: August 30th, 2005, 8:43 pm
Posts: 8649
Location: Salem, MA
majkinetor,

Welcome back! Did you have a good vacation from the forum? As always you have a well thought out script.

_________________
Image
(Common Answers) - New Tutorials Forum - Humongous FAQ


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 3rd, 2007, 6:09 pm 
Offline

Joined: July 23rd, 2007, 3:43 am
Posts: 47
Wow! :shock: No dll....... :!:

Whats next? SBar_Anchor() :D


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 3rd, 2007, 10:51 pm 
As allways, a very good ans well documented control from majkinetor.
Thanks a lot :D :D :D


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: August 6th, 2007, 9:36 pm 
Offline
User avatar

Joined: December 29th, 2004, 1:28 pm
Posts: 2541
Cool. Thanks :)

daniel2 wrote:
Wow! :shock: No dll....... :!:
Yes, dll, but since it's a common control the dll should already exist in your Windows installation ;) .


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 16th, 2007, 11:25 am 
Offline

Joined: May 24th, 2006, 2:49 pm
Posts: 4511
Location: Belgrade
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

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 16th, 2007, 11:35 am 
Offline

Joined: July 2nd, 2006, 7:59 pm
Posts: 87
Welcome changes 8)


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 23 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group