View Full Version : Listview and selecting items
Michael Clease
23-10-2008, 14:30
I am trying to use a listview in details view and cant seem to get the system to recognise when i click on a second column.
I dont have the script with me I will post an example tonight (unless you give me a solution before that ;) )
ErosOlmi
23-10-2008, 14:43
Michael,
I do not think I've already covered that option in an example so I need to test it too.
I will wait your script to work with and find a solution.
Anyhow, I think that a ListView in not able to recognize the column because what is really selected is the item that has more info. ListView is like Windows Explorer view and I do not remember a way you can select just a column like in a real grid. Anyhow I'm not sure 100% so I have to check.
Thanks
Eros
Michael Clease
23-10-2008, 17:27
What you have said does make sense, I will explore other options for what I require.
maybe two listviews side by side(single column), that might be better for what I want anyway.
thanks for your help as usual.
Michael Clease
24-10-2008, 00:10
quick question about the events structures, the code below is from the example (pre callbacks)
If I replace lCBCTL with CBCTL it works and finds my listview but when I try and use CBNMCODE it is not recognised, is this because listview does not have the callback function enabled (yet).
case %WM_NOTIFY
select case lCBCTL
case %ID_LV_RIGHT
'---lParam contains a pointer to a listview notification structure
'---so assign it to our lvnm pointer
lvnm = lParam
'---Now check the notification event occurred
select case nm.code
case %LVN_COLUMNCLICK
I am not saying this is an answer... But this may help you find what you are looking for.
It is called "Control Spy", with version 5/6 for the common controls.
It allows you to recreate some things, as you can do in the program, or with API, where the program is limited. You can see every event, function, command, trait, attribute... etc... (Even the return CALLS that get sent back. Which is why I suggest it. You can see the exact call you are looking for... I hope.)
http://www.microsoft.com/downloads/details.aspx?FamilyID=19d4294d-0531-4ec2-8b27-2e463b315f16&displaylang=en
If the link does not work... Just search for "Control Spy v2.0", made by Microsoft.
Goes well with API-Monitor
http://www.rohitab.com/apimonitor/index.html
It will install into C:\Program Files\Windows\Control Spy\
No start-shortcuts will be created.
Michael Clease
24-10-2008, 08:16
@Jason http://community.thinbasic.com/index.php?topic=1357.0
ErosOlmi
24-10-2008, 11:22
quick question about the events structures, the code below is from the example (pre callbacks)
If I replace lCBCTL with CBCTL it works and finds my listview but when I try and use CBNMCODE it is not recognised, is this because listview does not have the callback function enabled (yet).
case %WM_NOTIFY
select case lCBCTL
case %ID_LV_RIGHT
'---lParam contains a pointer to a listview notification structure
'---so assign it to our lvnm pointer
lvnm = lParam
'---Now check the notification event occurred
select case nm.code
case %LVN_COLUMNCLICK
Yes, CB... automatic keywords/variable are available only inside CALLBACKs functions.
Regarding ListView, I'm still finishing to integrate callback with it but it is almost done.
@Jason http://community.thinbasic.com/index.php?topic=1357.0
Darn, I thought I was helping. >:( ;D
Michael Clease
26-10-2008, 11:00
I think that some of my problems are solved after looking at pb help and msdn.
There is one issue regarding timers and message boxes not working if the timer is set for a low number, but i think the timer notification message is firing to often and filling the message queue when a canvas is attached to the window.