 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
oops7 Guest
|
Posted: Mon Mar 10, 2008 7:08 pm Post subject: i have listview select confusion |
|
|
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  |
|
| Back to top |
|
 |
garry
Joined: 19 Apr 2005 Posts: 1030 Location: switzerland
|
|
| Back to top |
|
 |
oops7 Guest
|
Posted: Tue Mar 11, 2008 3:13 am Post subject: |
|
|
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, .... Essentially the same result you get if you double-click on a listview row. 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
-Amy |
|
| Back to top |
|
 |
Sakurako
Joined: 10 May 2007 Posts: 142
|
Posted: Tue Mar 11, 2008 5:19 am Post subject: |
|
|
| 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 |
|
 |
oops7 Guest
|
Posted: Tue Mar 11, 2008 9:31 am Post subject: |
|
|
Sakurako, thank you very much for that sample - but I did run it, and did not quite get to my goal. 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??
-Amy |
|
| Back to top |
|
 |
Sakurako
Joined: 10 May 2007 Posts: 142
|
Posted: Tue Mar 11, 2008 3:19 pm Post subject: |
|
|
| 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 |
|
 |
oops7 Guest
|
Posted: Tue Mar 11, 2008 4:57 pm Post subject: |
|
|
Sakurako --- you are the best.
But i am not working out. Can anyone try out this code? |
|
| Back to top |
|
 |
Chankra Guest
|
Posted: Wed Mar 12, 2008 10:26 pm Post subject: |
|
|
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?  |
|
| Back to top |
|
 |
GuestQuestion Guest
|
Posted: Fri Mar 14, 2008 2:36 pm Post subject: |
|
|
| Hello, can anyone please say if this is a issue that can be solved? |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|