在BIMFACE的模型中toolbar怎么增加button

怎么咋BIMFACE的模型的toolbar里面加自己的button?

clipboard.png

阅读 3.3k
2 个回答

var toolbar = app.getToolbar('MainToolbar');
var btnConfig = new Glodon.Bimface.UI.Button.ButtonConfig();
btnConfig.title = "Button";
var btn = new Glodon.Bimface.UI.Button.Button(btnConfig);
btn.setHtml(<button style="width: 50px; height:50px; left: -8px; top: -8px; position: relative; color: white; font-size: 18px;background: rgba(0, 0, 0, 0);opacity: 0.6;border: none;">Button</button>);
btn.addClassName('btn-test');
btn.addEventListener('Click', function() {

alert("我是一个新button"); 

});
toolbar.insertControl(2, btn);

添加图片按钮:

var btn = new Glodon.Bimface.UI.Button.Button(btnConfig);
      btn.setHtml('<img class="img-gbfm" src="../images/fmicon/gfmtest.png" alt="" width="32px" height="32px" />');
      btn.addClassName('btn-gbfm-test');

css:

.btn-gbfm-test {
  width: 50px;
  height: 50px;
  left: -8px;
  top: -8px;
  position: relative;
  color: white;
  background: rgba(0, 0, 0, 0);
  opacity: 0.6;
  border: none;
}

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题