| 54 | ); |
| 55 | |
| 56 | GuiControl* GuiInspectorTypeMenuBase::constructEditControl() |
| 57 | { |
| 58 | GuiControl* retCtrl = new GuiPopUpMenuCtrl(); |
| 59 | |
| 60 | GuiPopUpMenuCtrl *menu = dynamic_cast<GuiPopUpMenuCtrl*>(retCtrl); |
| 61 | |
| 62 | // Let's make it look pretty. |
| 63 | retCtrl->setDataField( StringTable->insert("profile"), NULL, "GuiPopUpMenuProfile" ); |
| 64 | _registerEditControl( retCtrl ); |
| 65 | |
| 66 | // Configure it to update our value when the popup is closed |
| 67 | char szBuffer[512]; |
| 68 | dSprintf( szBuffer, 512, "%d.apply( %d.getText() );", getId(), menu->getId() ); |
| 69 | menu->setField("Command", szBuffer ); |
| 70 | |
| 71 | //now add the entries, allow derived classes to override this |
| 72 | _populateMenu( menu ); |
| 73 | |
| 74 | // Select the active item, or just set the text field if that fails |
| 75 | S32 id = menu->findText(getData()); |
| 76 | if (id != -1) |
| 77 | menu->setSelected(id, false); |
| 78 | else |
| 79 | menu->setField("text", getData()); |
| 80 | |
| 81 | return retCtrl; |
| 82 | } |
| 83 | |
| 84 | void GuiInspectorTypeMenuBase::setValue( StringTableEntry newValue ) |
| 85 | { |
nothing calls this directly
no test coverage detected