AutoHotkey Community

It is currently May 26th, 2012, 11:21 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: November 17th, 2009, 1:44 am 
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.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: November 17th, 2009, 2:21 am 
Offline

Joined: October 7th, 2006, 4:50 pm
Posts: 3157
Location: MN, USA
code?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 17th, 2009, 2:44 am 
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


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: November 17th, 2009, 3:43 pm 
Offline

Joined: October 7th, 2006, 4:50 pm
Posts: 3157
Location: MN, USA
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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 17th, 2009, 11:03 pm 
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


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

All times are UTC [ DST ]


Who is online

Users browsing this forum: Bing [Bot], Cerberus, Google [Bot], Google Feedfetcher, Maestr0, rbrtryn, Tipsy3000, XstatyK and 69 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