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 

i have listview select confusion

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





PostPosted: Mon Mar 10, 2008 7:08 pm    Post subject: i have listview select confusion Reply with quote

I am having trouble following this part of the documentation. I just want to make a list view row to be clicked... not highlighted or pre-selected. I am only able to get the lighter shade or Focus? of a row... but this part of the doc really confuses me. Could someone interpret, and maybe even show a running example of how a row can be actually clicked via a hotkey testing key?

//
Select: Selects the row. To later deselect it, use LV_Modify(RowNumber, "-Select"). When selecting rows, it is usually best to ensure that at least one row always has the focus property because that allows the Apps key to display its context menu (if any) near the focused row. The word Select may optionally be followed immediately by a 0 or 1 to indicate the starting state. In other words, both "Select" and "Select" . VarContainingOne are the same (the period used here is the concatenation operator). This technique also works with Focus and Check above.


if i am missing something please let me know Shocked
Back to top
garry



Joined: 19 Apr 2005
Posts: 1030
Location: switzerland

PostPosted: Mon Mar 10, 2008 8:08 pm    Post subject: Reply with quote

an easy LV example
http://www.autohotkey.com/forum/post-27715.html
Back to top
View user's profile Send private message
oops7
Guest





PostPosted: Tue Mar 11, 2008 3:13 am    Post subject: Reply with quote

Garry thank you for that reference link. I spun up that sample you have, and it is a very pretty module, however, it didn't actually give me what I was looking for. I am trying to figure out how to cause a ListView line to become selected, ....Very Happy Essentially the same result you get if you double-click on a listview row. Very Happy There are two color shades you can achieve by clicking on a row... I am trying to get the darker, fully clicked by way of a function call Smile

-Amy
Back to top
Sakurako



Joined: 10 May 2007
Posts: 142

PostPosted: Tue Mar 11, 2008 5:19 am    Post subject: Reply with quote

Code:
Gui, Add, ListView, HwndTestVar, Test
LV_Add("", "test 1")
LV_Add("", "test 2")
LV_Add("", "test 3")
Gui, Add, Edit, section vTestNum
Gui, Add, Button, ys gTest, Test
Gui, Show,, Test
return

^t::
Test:
If A_TimeSinceThisHotkey < 100
 If A_TimeSinceThisHotkey < 0
  GuiControlGet, TestRec,, TestNum
 Else
  ControlGet, TestRec, List, Count Focused,, ahk_id %TestVar%
Else
 GuiControlGet, TestRec,, TestNum
TestRec += 0
If TestRec = 0
 TestRec += 1
LV_Modify(0, "-Select")
LV_Modify(TestRec, "Select")
GuiControl,, TestNum, %TestRec% Test
return

_________________
Back to top
View user's profile Send private message
oops7
Guest





PostPosted: Tue Mar 11, 2008 9:31 am    Post subject: Reply with quote

Sakurako, thank you very much for that sample - but I did run it, and did not quite get to my goal. Sad WIM is when you run that code, and select Test 1, Test 1 will hilight like it is selected, ... but it is not fully selected. What I mean is, if you click with the mouse after highlighting it this way, note how the line gets even darker? This is what I wanted via automated process.

Can this even be done?? Very Happy

-Amy
Back to top
Sakurako



Joined: 10 May 2007
Posts: 142

PostPosted: Tue Mar 11, 2008 3:19 pm    Post subject: Reply with quote

Code:
Gui, Add, ListView, HwndTestVar, Test
Loop, 6
 LV_Add("", "test " A_Index)
Gui, Add, Edit, section vENum
Gui, Add, Button, ys gTest, Test
Gui, Add, Button, ys gTest0, Test0
Gui, Show,, Test
return

Test:
GuiControlGet, ENum
if ENum is number
{
 LV_Modify(0, "-Select")
 LV_Modify(ENum, "Select")
 ControlFocus,, ahk_id %TestVar%
}
return

Test0:
GuiControlGet, ENum
If ENum = 1
{
 LV_Modify(ENum += 1, "Focus")
 ControlSend,, {Up}, ahk_id %TestVar%
}
Else
{
 LV_Modify(ENum -= 1, "Focus")
 ControlSend,, {Down}, ahk_id %TestVar%
}
ControlFocus,, ahk_id %TestVar%
return

_________________
Back to top
View user's profile Send private message
oops7
Guest





PostPosted: Tue Mar 11, 2008 4:57 pm    Post subject: Reply with quote

Sakurako --- you are the best.

But i am not working out. Can anyone try out this code?
Back to top
Chankra
Guest





PostPosted: Wed Mar 12, 2008 10:26 pm    Post subject: Reply with quote

Hi, I think this may be a sendmessage issue, ... I don\\\'t know the proper commands, but someone else on here might kow? what is the problem, you cannot click on a element? Cool
Back to top
GuestQuestion
Guest





PostPosted: Fri Mar 14, 2008 2:36 pm    Post subject: Reply with quote

Hello, can anyone please say if this is a issue that can be solved?
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