Icons size in window
</> Source
<!DOCTYPE html>
<html>
<head>
<title>Icons size in window</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<link rel="stylesheet" type="text/css" href="../../../codebase/fonts/font_roboto/roboto.css"/>
<link rel="stylesheet" type="text/css" href="../../../codebase/dhtmlx.css"/>
<script src="../../../codebase/dhtmlx.js"></script>
<style>
div#winVP {
position: relative;
height: 350px;
border: #c0c0c0 1px solid;
border-radius: 2px;
margin: 10px;
}
</style>
<script>
var myToolbar;
var tbIconSize = null;
var tbXML = "dhxtoolbar_button.xml";
var dhxWins, w1;
var myGrid;
var loadData = {};
function doOnLoad() {
dhxWins = new dhtmlXWindows();
dhxWins.attachViewportTo("winVP");
w1 = dhxWins.createWindow("w1", 20, 30, 400, 280);
w1.setText("dhtmlxToolbar");
w1.button("close").disable();
//
myGrid = w1.attachGrid();
myGrid.setImagePath("../../../codebase/imgs/");
myGrid.load("../common/grid.xml");
myToolbar = w1.attachToolbar();
myToolbar.attachEvent("onXLE", function(){
loadData.toolbar = true;
});
loadToolbar(tbIconSize||18, true);
}
function loadToolbar(size, force) {
if (tbIconSize == size && force !== true) return;
if (!checkLoadState()) return;
loadData.toolbar = false;
myToolbar.clearAll();
myToolbar.setIconSize(size);
myToolbar.setIconsPath("../common/icon_size/material/"+size+"/");
myToolbar.loadStruct("../common/"+tbXML);
tbIconSize = size;
}
function setXML(xml) {
if (tbXML == xml) return;
if (!checkLoadState()) return;
loadData.toolbar = false;
tbXML = xml;
myToolbar.clearAll();
myToolbar.loadStruct("../common/"+tbXML);
}
function checkLoadState() {
var s = true;
for (var a in loadData) s = s&&loadData[a];
return s;
}
</script>
</head>
<body onload="doOnLoad();">
<div style="padding-bottom: 10px;">
<input type="button" value="18" onclick="loadToolbar(18);">
<input type="button" value="24" onclick="loadToolbar(24);">
<input type="button" value="32" onclick="loadToolbar(32);">
<input type="button" value="48" onclick="loadToolbar(48);">
<input type="button" value="with labels" onclick="setXML('dhxtoolbar_button.xml');">
<input type="button" value="without labels" onclick="setXML('dhxtoolbar_button2.xml');">
</div>
<div id="winVP"></div>
</body>
</html>
Documentation
Check documentation to learn how to use the components and easily implement them in your applications.