Hello,
I'm trying to highlight 3d menu compononets when mouse is over.
I got success with SoDialogPushButton with this code:
//after a SoRayPickAction
SoNode * pickedNode = pickedPath->getTail();
if (pickedNode->isOfType(SoDialogPushButton::getClassTypeId())){
SoDialogPushButton * button = (SoDialogPushButton *)pickedNode;
if (selectedDialogComponent!=button){
unhighlightSelectedComponent();
selectedDialogComponent=button;
selectedDialogComponent->setPart(SbName("released"),highlightPushButtonPart);
}
}
else
unhighlightSelectedComponent();
void unhighlightSelectedComponent(){
if (selectedDialogComponent==NULL)
return;
if(selectedDialogComponent->isOfType(SoDialogPushButton::getClassTypeId()))
selectedDialogComponent->setPart(SbName("released"),unhighlightPushButtonPart);
selectedDialogComponent=NULL;
}
//selectedDialogComponent is a global variable
SoDialogComponent *selectedDialogComponent;
But how can I highlight an item of radioButtons?? How can I know on
what item mouse is over and how can I highlight only that item?
Max