Your browser does not seem to support JavaScript. As a result, your viewing experience will be diminished, and you have been placed in read-only mode.
Please download a browser that supports JavaScript, or enable it if it's disabled (i.e. NoScript).
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 18/04/2006 at 09:01, xxxxxxxx wrote:
User Information: Cinema 4D Version: 9.5 Platform: Windows ; Language(s) : C.O.F.F.E.E ;
--------- Hello everybody. I've just begun to try to make modal dialogs in COFFEE, so I've made a test plugin which creates a single ComboBox in a dialog window. But, my problem is that the dialog closes immediately after the user selects an item of the ComboBox. Here is my code :
class myDialog : GeModalDialog { public: myDialog(); CreateLayout(); Command(id,msg); } myDialog::myDialog() { super(); } myDialog::CreateLayout() { AddComboBox(1,0,0,0); AddItem(1,1,"Button A"); AddItem(1,2,"Button B"); AddItem(1,3,"Button C"); } myDialog::Command(id,msg) { } class myPlugin : MenuPlugin { public: myPlugin(); GetID(); GetName(); GetHelp(); Execute(doc); } myPlugin::myPlugin() { super(); } myPlugin::GetID() { return 1000001; } myPlugin::GetName() { return "myPlugin"; } myPlugin::GetHelp() { return "Something"; } myPlugin::Execute(doc) { var d=new(myDialog); d->Open(-1,-1); return; } main() { Register(myPlugin); }
I would appreciate your help. Thank you.
On 18/04/2006 at 17:43, xxxxxxxx wrote:
I wouldn't use '1' as an active gadget's id. Best to start at a value of '10000'. See the documentation under "Dialog Layout" subheading "Manual Layout" for an example of suggested numbering (or check out some of the example sources linked as well). For non-active gadgets, such as StaticText used solely as labels, '0' is fine.
Your gadget id may be conflicting with the default OK/Cancel id's which may explain the odd behaviour. I see that the Calculator example uses '1' to '14', but I wouldn't start that small.
On 19/04/2006 at 00:04, xxxxxxxx wrote:
You're right. Changing my gadget id to a value of 200 makes my dialog working. Thanks a lot for your help.
On 19/04/2006 at 00:35, xxxxxxxx wrote:
you should really use values greater than 1000 as lower values are used by Cinema 4D in some areas afaik.
On 19/04/2006 at 01:16, xxxxxxxx wrote:
Okay, thanks, I didn't know that.