src/Screens/ModelEditorScreen.cpp
// draw an editor for top-level selected Component members (e.g. name)
draw an editor for top-level selected Component members
draw an editor for top - level selected Component members
void drawTopLevelMembersEditor(UndoableUiModel& st) {
        OpenSim::Component const* selection = st.getSelected();
        if (!selection) {
            ImGui::Text("cannot draw top level editor: nothing selected?");
            return;
        }
        ImGui::Columns(2);
        ImGui::TextUnformatted("name");
        ImGui::NextColumn();
        char nambuf[128];
        nambuf[sizeof(nambuf) - 1] = '\0';
        std::strncpy(nambuf, selection->getName().c_str(), sizeof(nambuf) - 1);
        ImGui::SetNextItemWidth(ImGui::GetContentRegionAvailWidth());
        if (ImGui::InputText("##nameditor", nambuf, sizeof(nambuf), ImGuiInputTextFlags_EnterReturnsTrue)) {
            if (std::strlen(nambuf) > 0) {
                st.updSelected()->setName(nambuf);
            }
        }
        ImGui::NextColumn();
        ImGui::Columns();
    }
void drawTopLevelMembersEditor ( UndoableUiModel & st ) { OpenSim :: Component const * selection = st . getSelected ( ) ; if ( ! selection ) { ImGui :: Text ( " " ) ; return ; } ImGui :: Columns ( 2 ) ; ImGui :: TextUnformatted ( " " ) ; ImGui :: NextColumn ( ) ; char nambuf [ 128 ] ; nambuf [ sizeof ( nambuf ) - 1 ] = ' \0 ' ; std :: strncpy ( nambuf , selection -> getName ( ) . c_str ( ) , sizeof ( nambuf ) - 1 ) ; ImGui :: SetNextItemWidth ( ImGui :: GetContentRegionAvailWidth ( ) ) ; if ( ImGui :: InputText ( " " , nambuf , sizeof ( nambuf ) , ImGuiInputTextFlags_EnterReturnsTrue ) ) { if ( std :: strlen ( nambuf ) > 0 ) { st . updSelected ( ) -> setName ( nambuf ) ; } } ImGui :: NextColumn ( ) ; ImGui :: Columns ( ) ; }
draw an editor for top-level selected Component members (e.g.
draw an editor for top - level selected Component members ( e . g .