Ingo Chou Posted October 20, 2015 Share Posted October 20, 2015 Hi, Can I add panel into a dialog or window in CASTORGUI? Thanks! Quote Link to comment Share on other sites More sharing options...
Dad72 Posted October 20, 2015 Share Posted October 20, 2015 Yes you can. This works like a boutton. You must add your elements has a panel, then add a panel dialog or/and window Quote Link to comment Share on other sites More sharing options...
Ingo Chou Posted October 20, 2015 Author Share Posted October 20, 2015 Thanks , Dave. But I can not move the panel when I move it's parent - the dialog / window. What should I do? Quote Link to comment Share on other sites More sharing options...
Dad72 Posted October 20, 2015 Share Posted October 20, 2015 Excuse me, I have some difficulty understanding English. Have you an example of what you want to do more detail or explanation of what you want to do. Quote Link to comment Share on other sites More sharing options...
Ingo Chou Posted October 20, 2015 Author Share Posted October 20, 2015 Sorry, I did not express myself clearly. var mywindow = new CASTORGUI::GUIWindow( "window" ,{ x:0, y:0, w:500, h:300 }, gui ) var mypanel = new CASTORGI::GUIPanel( "child" ,{ x:0, y:50, w:500, h:200 }, gui , false ) mywindow.add(mypanel) mypanel.setVisible(true) mywindow.setVisible(true) The question is : The panel "mypanel" can not be moved to new position when I drag "mywindow" . "mywindow" changed it position, but the "mypanel" NOT. Quote Link to comment Share on other sites More sharing options...
Dad72 Posted October 20, 2015 Share Posted October 20, 2015 I have send fix. For your problem, it works after test. here's how I did.var form = new CASTORGUI.GUIWindow("form", {x:(guisystem.getCanvasWidth().width / 2 - 100), y:200 , w:200, h:200}, guisystem); // creat window var optionsGUIText = { x: 10,y: 35, text: "- This window is draggable with panel.<br />", color: "white", size: 12 };// Options textvar textForWindow = new CASTORGUI.GUIText("textInfo", optionsGUIText, guisystem, false); //creat text var panel = new CASTORGUI.GUIPanel("p", {w:200, h:200, backgroundColor:"red"}, guisystem); // creat panel redform.add(panel); // add panel in windowpanel.add(textForWindow); // add text in panel panel.setVisible(true);form.setVisible(true);I add a function to add GUIPanel if you want to add Elements Quote Link to comment Share on other sites More sharing options...
Ingo Chou Posted October 21, 2015 Author Share Posted October 21, 2015 OK, let me try. thank you very much! Quote Link to comment Share on other sites More sharing options...
Ingo Chou Posted October 26, 2015 Author Share Posted October 26, 2015 Hi, Dave Thanks for your help! Now I can add panel into window, and can move them together. But there is a new problem, would you please fix it for me? After adding a panel in window, now I add a GUITextures into my panel like this: var img = new CASTORGUI::GUITextures("img","img/img.png",{x:0,y:0,w:64,h:64},gui, function(){alert("clicked")}, false); mypanel.add(img); But the image can not be displayed. It can be displayed if use this: var img = new CASTORGUI::GUITextures("img","img/img.png",{x:0,y:0,w:64,h:64},gui, function(){alert("clicked")}, true); And, it is displayed not only in my panel, but also in the main window (web client). And the callback does not work. Quote Link to comment Share on other sites More sharing options...
Dad72 Posted October 26, 2015 Share Posted October 26, 2015 Hi York, I fixed two problem you mentioned. This works now.var img = new CASTORGUI::GUITextures("img","img/img.png",{w:64,h:64},gui, function(){alert("clicked")}, false);mypanel.add(img);mypanel.setVisible(true);I also fixed any other element that had the same problem when they were added to another container. CastorGUI is now in Version 1.3 Quote Link to comment Share on other sites More sharing options...
Ingo Chou Posted October 27, 2015 Author Share Posted October 27, 2015 OK. Thank you very much! Quote Link to comment Share on other sites More sharing options...
Ingo Chou Posted October 30, 2015 Author Share Posted October 30, 2015 Hi, Dave There is a bug with GUICheckbox. The GUICheckbox has been displayed in both main window (web client) and panel after I added it in the panel. It should not be displayed in main window (web client). Thanks for your help. Quote Link to comment Share on other sites More sharing options...
Dad72 Posted October 30, 2015 Share Posted October 30, 2015 Ok, I'll watch that. Quote Link to comment Share on other sites More sharing options...
Dad72 Posted October 30, 2015 Share Posted October 30, 2015 after testing it works well for mevar form = new CASTORGUI.GUIWindow("form", {x:(guisystem.getCanvasWidth().width / 2 - 100), y:200 , w:200, h:200}, guisystem);var checkbox = new CASTORGUI.GUICheckbox("check", { x: 10, y: 35}, guisystem, null, false);form.add(checkbox);form.setVisible(true);Attention:Error => CASTORGUI.GUICheckbox("check", { x: 10, y: 35}, guisystem, false);Ok => CASTORGUI.GUICheckbox("check", { x: 10, y: 35}, guisystem, callback, false); Quote Link to comment Share on other sites More sharing options...
Ingo Chou Posted October 31, 2015 Author Share Posted October 31, 2015 Ok. thank you. I made a mistake. I forgot to add the parameter "callback". In addition, there is an other problem relating to parameter "size" if I set size more than 1 : It works well when use: CASTORGUI.GUICheckbox("check", { x: 10, y: 35, size:1 }, guisystem, callback, false); But the checkbox will be displayed at wrong positon when use: CASTORGUI.GUICheckbox("check", { x: 10, y: 35, size:2 }, guisystem, callback, false); I just want to scale the checkbox size around it's center. thank you for your help. Quote Link to comment Share on other sites More sharing options...
Dad72 Posted October 31, 2015 Share Posted October 31, 2015 ok, I resize the checkbox instead of the scale. the problem is fixed 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.