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 

Listview doubleclick action on DropDownList selection

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
newbie5000
Guest





PostPosted: Tue Nov 17, 2009 12:44 am    Post subject: Listview doubleclick action on DropDownList selection Reply with quote

Hi folks,

I am struggling to come up with a solution to my problem

I have a listview with a DropDownList.
From the DropDownList i have 2 choices which are to load a list of places into my listview or a list of photos from within a directory. Depending on which choice has been loaded into the listview i want the doubleclick action to recognise which choice is loaded.

E.G.

If it is the list of places that is loaded into the listview then doubleclicking would copy the text to clipboard or if it is the photos loaded within the listview then doubleclicking on an item would display the photo

Any help appreciated.
Back to top
jaco0646



Joined: 07 Oct 2006
Posts: 1770
Location: MN, USA

PostPosted: Tue Nov 17, 2009 1:21 am    Post subject: Reply with quote

code?
_________________
http://autohotkey.net/~jaco0646/
Back to top
View user's profile Send private message Visit poster's website
newbie5000
Guest





PostPosted: Tue Nov 17, 2009 1:44 am    Post subject: Reply with quote

Sorry for not posting any code but my program is very big.
I was hoping my description explained my problem enough to get a little help pointing me in the right direction.

Here is the action for my listview doubleclick

Code:
MyListView:
if A_GuiEvent = DoubleClick
      {
     LV_GetText(C1,A_EventInfo,1)
     RN:=LV_GetNext("C")
     RF:=LV_GetNext("F")
     GC:=LV_GetCount()
 
;if txt file
gosub,LoadFile ;Open selected file into MainEdit
 GuiControl, Choose, Systabcontrol321, 2 ; Change tab focus to tab 2
 

  ;if photo 
run  %C1%  ;open in default photo viewer
     
    }
return


LoadFile: ; Loads a selected file in the listview into the Clip Pad (MainEdit)
  FileRead, FileToEdit, %C1%
   GuiControlGet, Edit
   GuiControl,,MainEdit, %MainEdit%`n%FileToEdit%
return


Any help appreciated with this. Just wondering if it can be done but my brain is frazzled so i may have to sleep on it or find an alternatve method?

Regards
Paul
Back to top
jaco0646



Joined: 07 Oct 2006
Posts: 1770
Location: MN, USA

PostPosted: Tue Nov 17, 2009 2:43 pm    Post subject: Reply with quote

Maybe something like this.
Code:
MyListView:
if A_GuiEvent != DoubleClick
 return

LV_GetText(C1,A_EventInfo,1)
RN:=LV_GetNext("C")
RF:=LV_GetNext("F")
GC:=LV_GetCount()
 
;if txt file
;Loads a selected file in the listview into the Clip Pad (MainEdit)
If InStr(C1, ".txt") {
 FileRead, FileToEdit, %C1%
 Gui, Submit, NoHide
 GuiControl,,MainEdit, %MainEdit%`n%FileToEdit%
 GuiControl, Choose, SysTabcontrol321, 2 ; Change tab focus to tab 2
}
;if photo
Else Run, %C1%  ;open in default photo viewer
return

_________________
http://autohotkey.net/~jaco0646/
Back to top
View user's profile Send private message Visit poster's website
newbie5000
Guest





PostPosted: Tue Nov 17, 2009 10:03 pm    Post subject: Reply with quote

Thank you very much for your help jaco0646.
I am new to AHK and the documentation seems to blur into a big question mark at nearly 1am in the morning.

it is much appreciated.

regards
Paul
Back to top
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help 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