Make toggle button from fix up vector to show if it is on or off.
This commit is contained in:
parent
690452b3df
commit
1902ca43c4
BIN
website/images/fixupgray.png
Normal file
BIN
website/images/fixupgray.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 292 B |
@ -32,7 +32,7 @@ ImporterApp.prototype.Init = function ()
|
||||
importerButtons.AddLogo ('Online 3D Viewer <span class="version">v 0.5.1</span>', function () { myThis.WelcomeDialog (); });
|
||||
importerButtons.AddButton ('images/openfile.png', 'Open File', function () { myThis.OpenFile (); });
|
||||
importerButtons.AddButton ('images/fitinwindow.png', 'Fit In Window', function () { myThis.FitInWindow (); });
|
||||
importerButtons.AddButton ('images/fixup.png', 'Enable/Disable Fixed Up Vector', function () { myThis.SetFixUp (); });
|
||||
importerButtons.AddToggleButton ('images/fixup.png', 'images/fixupgray.png', 'Enable/Disable Fixed Up Vector', function () { myThis.SetFixUp (); });
|
||||
importerButtons.AddButton ('images/top.png', 'Set Up Vector (Z)', function () { myThis.SetNamedView ('z'); });
|
||||
importerButtons.AddButton ('images/bottom.png', 'Set Up Vector (-Z)', function () { myThis.SetNamedView ('-z'); });
|
||||
importerButtons.AddButton ('images/front.png', 'Set Up Vector (Y)', function () { myThis.SetNamedView ('y'); });
|
||||
|
||||
@ -171,6 +171,25 @@ ImporterButtons.prototype.AddButton = function (image, title, onClick)
|
||||
this.parent.appendChild (buttonImage);
|
||||
};
|
||||
|
||||
ImporterButtons.prototype.AddToggleButton = function (image, toggleImage, title, onClick)
|
||||
{
|
||||
var buttonImage = document.createElement ('img');
|
||||
var isOn = true;
|
||||
buttonImage.className = 'topbutton';
|
||||
buttonImage.src = image;
|
||||
buttonImage.title = title;
|
||||
buttonImage.onclick = function () {
|
||||
isOn = !isOn;
|
||||
if (isOn) {
|
||||
buttonImage.src = image;
|
||||
} else {
|
||||
buttonImage.src = toggleImage;
|
||||
}
|
||||
onClick ();
|
||||
};
|
||||
this.parent.appendChild (buttonImage);
|
||||
};
|
||||
|
||||
ImporterProgressBar = function (parent)
|
||||
{
|
||||
this.parent = parent;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user