cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - When posting, your subject should be specific and summarize your question. Here are some additional tips on asking a great question. X

Change tiptext and statustext at runtime

gsilvamendoza
1-Visitor

Change tiptext and statustext at runtime

Hi guys,

I would like to change the tiptext and statustext of a button in a toolbar at runtime. Is it possible? Here is a snippet of the editWindow.xml.

<toolbar id="myToolbar" name="toolbarOpen" x="0" y="0"><?Pub Dtl?>

<button command="p2t" id="p2t" image="p2t" statustext="Print to Test" tiptext="Print to Test" withdraw="true"></button>

</toolbar>


The arbortext version is PTC Arbortext Editor Release 6.1 DateCode M030.


Thank you in advance


1 REPLY 1

Hi Gerardo--

Arbortext uses that XML document to build the toolbar, and it keeps the document in memory. The connection between the document and the rendered toolbar is live, so you can change the toolbar by changing the document in memory. You can use something like this:

function setToolbarTiptext(id, tiptext) {

  local docs[], d, dlgdoc;

  doc_list(docs);

  for (d in docs) {

    if (doc_name(docs[d])=="editwindow.xml") {

      dlgdoc = docs[d];

      break;

    }

  }

  local buttonoid = _xmldlg::getElementById(id, dlgdoc);

  _xmldlg::setElementAttribute("tiptext", tiptext, buttonoid);

}

setToolbarTiptext("Toolbar_Save","Save me!");

--Clay

Announcements

Top Tags