On 06/07/2013 at 17:27, xxxxxxxx wrote:
User Information:
Cinema 4D Version: 13
Platform: Windows ;
Language(s) : C++ ;
---------
Hi,
I'm loading the names of my currently selected objects into a ListView gizmo. Then clicking on the entries to select/unselect those objects.
LMB selects them and RMB deselects them.
It's working. But I've run into some rather strange behaviors.
Q#1: Can we toggle the selection state (the highlighting) of LV entries on/off?
Right now I don't see any way to deselect the entries. Other than selecting another one. Which is very poor. Because I have my LV gizmo set up to select/unselect objects in the scene.
When I unselect the object by clicking the entry in the LV gizmo. I need the entry to not be selected(highlighted) anymore.
I don't see anything in the SDK that allows us to unselect LV entries. So once we select one of the LV entries...It looks like we're foobared. And there's no way to make none selected(highlighted) as far as I can see.
Am I missing something?
Q#2: I'm not able to get many of the messgaes like: LV_GETLINEHEIGHT to work.
They always return a zero value. Please see the example below.
Q#3: The GetItem() function is giving me crazy garbage results.
I'm assuming that this function is used to grab the data from a LV entry and save it into a container. Then we can use this to get the values for each entry.
However...I'm getting crazy jibberish out of it. Please see the example below
//Executes if the user selects an item in the ListView gizmo that's already been selected(highlighted)
case LV_SIMPLE_FOCUSITEM_NC:
{
GePrint(LongToString(msg.GetLong(LV_GETLINEHEIGHT))); //<------Always returns zero!!
//These also don't work: LV_LMOUSEDOWN, LV_GETCOLUMNWIDTH
BaseContainer bc;
Bool entryName1 = myListView.GetItem(0,&bc); //Grab the first LV item and save it into bc
Bool entryName2 = myListView.GetItem(1,&bc); //Grab the second LV item and save it into bc
Bool entryName3 = myListView.GetItem(2,&bc); //Grab the third LV item and save it into bc
GePrint(bc.GetString(entryName1)); //<--does not work!?
GePrint(bc.GetString(entryName2)); //<--does not work!?
GePrint(bc.GetString(entryName3)); //<--does not work!?
//Ok..So I'm not getting any returns from my base container using the ID#'s I provided it with
//So Lets loop though the container to see if there really is anything in it at all
LONG i=0;
while (bc.GetIndexId(i) != NOTOK)
{
Real id = bc.GetIndexId(i);
GePrint(RealToString(id)); //Prints 1851878757!? ..what is this crazy number?
GePrint(bc.GetString(id)); //<--This does print the string value..But only for the last entry(entryName3)!!!
//Why does this only return the last LV entry I added to the bc and none of the others?
i++;
}
}
break;
-ScottA