M
hello @HectorSmallwood
@HectorSmallwood said in Change LONG_CYCLE selected Item.:
Assume that I have the following code, the Item with id 0 will be selected by default. Is there any way that I can change this? Like after a specific action the Item 1 will be selected?
That's exactly what the code is doing in the Init() function using SetParameter(). You change the value of the parameter, the UI show the item with that value in the list. So by default the parameter value is 1 so the UI show the item with the value 1 "Item 1"
If you want to change the item somewhere else, same thing just change the value of the parameter, the ui will follow.
node->SetParameter(DescID(MY_CYCLE_ID), GeData(1), DESCFLAGS_SET::NONE);
I'am adding an answer here as it is a related. But for your second question if the answer doesn't fit your need, please open a new thread and post your question in a new thread. That will help us to keep things organized.
@HectorSmallwood said in Change LONG_CYCLE selected Item.:
event to determine when the selected item in the ListBox is changed.
If i understand the question, you have to check for MSG_DESCRIPTION_CHECKUPDATE message type in the Message() function as follow.
virtual Bool Message(GeListNode* node, Int32 type, void* data) override
{
switch (type)
{
case MSG_DESCRIPTION_CHECKUPDATE :
{
DescriptionCheckUpdate* dcu = static_cast<DescriptionCheckUpdate*>(data);
if (dcu == nullptr)
return true;
maxon::Int32 id = (*(dcu->descid))[0].id;
if (id == MY_CYCLE_ID)
{
DiagnosticOutput("Cycle have been changed");
// ... do Something
}
break;
}
}
return true;
};
Cheers
Manuel