Jump to content

CASTORGUI::GUISelect not work in a panel of a window.


Ingo Chou
 Share

Recommended Posts

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.

Link to comment
Share on other sites

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);};
Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...