Community Tip - You can subscribe to a forum, label or individual post and receive email notifications when someone posts a new topic or reply. Learn more! X
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
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