Altova XMLSpy 2025 Professional Edition

Availability of a command may vary with every mouse click or keystroke. The custom event OnUpdateCmdUI of XMLSpyControl gives us an opportunity to update the enabled/disabled state of buttons associated with XMLSpy commands. The method XMLSpyControl.QueryStatus is used to query whether a command is enabled or not.

 

<!--  custom event 'OnUpdateCmdUI" of XMLSpyControl object  -->
function objXMLSpyX::OnUpdateCmdUI()
{
  if ( document.readyState == "complete" )// 'complete'
  {
    // update status of buttons
     btnWellFormed.disabled =  ! (objDoc1.QueryStatus(34049) & 0x02);   // not enabled
     btnValidate.disabled =  ! (objDoc1.QueryStatus(34174) & 0x02);   // not enabled
  }
}

 

© 2018-2024 Altova GmbH