Ingo Chou Posted December 23, 2015 Share Posted December 23, 2015 Hello, CASTORGUI::GUISelect works well in web client , but does not work if it is added in a panel of a window. var myselect = new CASTORGUI::GUISelect("myselect", {x:5, y:5, w:100, h:40}, guisys, function(){alert("changed")}, true); myselect.addOptions("a","a"); myselect.addOptions("b","b"); This code works. But the following code does not run. var mywindow = new CASTORGUI::GUIWindow("mywindow",null,{x:0,y:0,w:400,h:600},guisys); var mypanel_1 = new CASTORGUI::GUIPanel("mypanel_1",{x:0,y:50,w:400,h:550},guisys,false); mypanel_1.setVisible(true); mywindow.add(mypanel_1); var mypanel_2 = new CASTORGUI::GUIPanel("mypanel_2",{x:80,y:0,w:300,h:500},guisys,false); mypanel_2.setVisible(true); mypanel_1.add(mypanel_2); var myselect = new CASTORGUI::GUISelect("myselect", {x:5, y:5, w:100, h:40}, guisys, function(){alert("changed")}, false); myselect.addOptions("a","a"); myselect.addOptions("b","b"); mypanel_2.add(myselect); The GUISelect can not be displayed. Thanks for your help. Quote Link to comment Share on other sites More sharing options...
Dad72 Posted December 23, 2015 Share Posted December 23, 2015 Ok, this is fixed. PS: It would be easier to read your code if you put it in code tag: [code ] your code [/ code] //no spaces before and after code Quote Link to comment Share on other sites More sharing options...
Ingo Chou Posted December 24, 2015 Author Share Posted December 24, 2015 OK, thank you. I'll try to put my code between and next time. Perhaps, there is a problem in the latest CASTORGUI code . Now, my panel can not be displayed. It seems like "element.style" is undefined in function GUIPanel.add(). CASTORGUI.GUIPanel.prototype.add = function(element){var contentPanel = this.getElementById(this.id);contentPanel.style.zIndex = this.zIndex + 1;element.style.zIndex + 2;element.addElement(false, contentPanel);}; Quote Link to comment Share on other sites More sharing options...
Dad72 Posted December 24, 2015 Share Posted December 24, 2015 Fixed. The latest version 1.5 has been much change with the theme system that is still experimental. So add the themesGUI folder that is in dist / on GitHub. it reference a css and you can create your own theme file. Quote Link to comment Share on other sites More sharing options...
Ingo Chou Posted December 28, 2015 Author Share Posted December 28, 2015 OK, thanks for your help. It works now. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.