Hi,
I am hiding an unnecessary ComboBox in an accept event of a command using the function below. It works fine and ComboBox became hidden. But when you navigate mouse over ComboBox, it becomes visible. Is there a solution to this?
int akDialog_itemShowHide ( DialogBox *dbP , long type , long id , boolean state ) { DialogItem *diP; diP = mdlDialog_itemGetByTypeAndId(dbP, type, id, 0); if(diP != NULL) { if( state ) { mdlDialog_itemShow(dbP, diP->itemIndex); // Show item } else { mdlDialog_itemHide(dbP, diP->itemIndex, TRUE); // Hide item } // Disable item mdlDialog_itemSetEnabledState((DialogBox *)diP->rawItemP->ownerDialogP, diP->itemIndex, state, TRUE); } return SUCCESS; }
Kind regards,
Sedat AlisAEC Technology Inc.
Sedat Alis said:I am hiding an unnecessary ComboBox
What dialog hosts your ComboBox? Is it your own dialog or the MicroStation Tool Settings dialog?
Regards, Jon Summers LA Solutions
Jon Summers said:What dialog hosts your ComboBox? Is it your own dialog or the MicroStation Tool Settings dialog?
MicroStation Tool Settings dialog.
Sedat Alis said:MicroStation Tool Settings dialog
Sedat Alis said:It works fine and ComboBox became hidden. But when you navigate mouse over ComboBox, it becomes visible
The Tool Settings dialog is controlled by MicroStation. It is populated using the Dialog Item Resource list that you provide, which includes your visible ComboBox.
When MicroStation redraws or recreates the Tool Settings dialog, it loads your item list once again, including the visible ComboBox. I suspect that's why your invisible ComboBox becomes visible.
Keeping track of events and states in MicroStation's state engine can be tricky!
Jon Summers said:When MicroStation redraws or recreates the Tool Settings dialog, it loads your item list once again, including the visible ComboBox. I suspect that's why your invisible ComboBox becomes visible.
MicroStation normally draws all items when you start a command. I make that ComboBox hidden in the accept event. Then if I navigate mouse over ComboBox, MicroStation makes it visible. Why does MicroStation make a hidden item visible?
Sedat Alis said:MicroStation normally draws all items when you start a command. I make that ComboBox hidden in the accept event
Yes, and after the accept event the command restarts? Then MicroStation reloads Tool Settings.