nuxil 2 Posted March 31, 2008 alright i get straight to it. i need to change a dialogs position from time to time. depending on what im doing. instead of making many many new classes. i was thinking of somehow changing the current class info's X and Y pos. i tried using ctrlSetPosition but that didnt go well at all.. so i came up with this idea. <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> class Info { idc = 858; type = 0; style = 0x01; colorText[ ]={ 1,1,1,1 }; colorBackground[ ]={ 0,0,0,0 }; font = "Zeppelin32"; sizeEx = 0.02; lineSpacing = 0; x = 0.26; y = 0.26; w = 0.32; h = 0.05; border = 1; borderSize = 5; text = "Info"; }; can i do it like something this? <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> class Info { idc = 858; type = 0; style = 0x01; colorText[ ]={ 1,1,1,1 }; colorBackground[ ]={ 0,0,0,0 }; font = "Zeppelin32"; sizeEx = 0.02; lineSpacing = 0; x = InfoX; y = InfoY; w = 0.32; h = 0.05; border = 1; borderSize = 5; text = "Info"; }; where i change InfoX & InfoY from within a script to change the position of dialog "Info". i tried it like this but it dosent seem to work with putting global variables in there. is there another workaround? Share this post Link to post Share on other sites
loyalguard 15 Posted March 31, 2008 I am pretty sure that a (dialog) class definition can't read variables...a nice try though! I have never used ctrlSetPosition but I have read about other people who have. Did it not work at all or were the results not what you were looking for. Did you use ctrlCommit along with it? Post your code and let's take a look. Share this post Link to post Share on other sites
nuxil 2 Posted March 31, 2008 right. exaclty what i thought. but the idea was good yes i used ctrlCommit along with it. you dont by any chance remember where you read about this? and who did it? i would like to know i have some more idea to test out before i post more code. if i dont get it to work. i post code of the all ways i tried. Share this post Link to post Share on other sites
loyalguard 15 Posted March 31, 2008 I'll see if I can find the earlier references of use. I may experiment myself a little. In the end it may just be easier to define additional dialog classes with controls at different positions, even if only while you continue to look for another solution. Share this post Link to post Share on other sites
kronzky 5 Posted April 1, 2008 All you need is ctrlPosition & ctrlCommit. You may just have a typo in there, or a wrong control ID. Check out my Object Browser, where the main menu can be hidden via a button. It's pretty straightforward: Share this post Link to post Share on other sites