AutoHotkey Community

It is currently May 27th, 2012, 1:38 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 1 post ] 
Author Message
PostPosted: June 3rd, 2009, 8:25 pm 
Offline

Joined: May 27th, 2007, 9:41 am
Posts: 4999
As requested here http://www.autohotkey.com/forum/viewtopic.php?t=44855
(didn't need sendmessage after all it occured to me)
Code:
; [Example] Endless scrolling in a listview
; an example of a listviw which you can endlessly scroll, after
; it reaches the last item in the listviw it jumps back the
; first and vice versa

; See also
; [Example] Endless scrolling in a listbox
; http://www.autohotkey.com/forum/topic31618.html
;
GUITitle=Endless Listview
Gui, add, ListView, w200 h200,1|2
Loop 50
   {
   LV_Add("",A_Index,A_Index)
   }
LV_ModifyCol(1, 30)
LV_ModifyCol(2, 30)
Gui, Show,, %GUITitle%
Return

#IfWinActive, Endless Listview
Up::
PreviousPos:=LV_GetNext()
If (PreviousPos = 0) ; exeption, focus is not on listview this will allow you to jump to last item via UP key
   {
    ControlSend, SysListview321, {End}, %GUITitle%
    Return
   }
ControlSend, SysListview321, {Up}, %GUITitle%
ItemsInList:=LV_GetCount()
ChoicePos:=PreviousPos-1
If (ChoicePos <= 1)
   ChoicePos = 1
If (ChoicePos = PreviousPos)
    ControlSend, SysListview321, {End}, %GUITitle%
Return

Down::
PreviousPos:=LV_GetNext()
ControlSend, SysListview321, {Down}, %GUITitle%
ItemsInList:=LV_GetCount()
ChoicePos:=PreviousPos+1
If (ChoicePos > ItemsInList)
   ChoicePos := ItemsInList
If (ChoicePos = PreviousPos)
    ControlSend, SysListview321, {Home}, %GUITitle%
Return
#IfWinActive

GuiEscape:      ; ESC
GuiClose:      ; Program is closed
ExitApp
See also
[Example] Endless scrolling in a listbox
http://www.autohotkey.com/forum/topic31618.html

_________________
AHK FAQ
TF : Text files & strings lib, TF Forum


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

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 20 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