Control Arrays (and events)

I created a class called MyWebShellControl which is a WebObject that has a shell.
I implemented all the properties, events and methods.

I had a few questions about the scope of properties and methods.
I made them all protected. Should the have been pubic?
[h]Also there are ‘new’ events now that it is a WebObject.[/h]

Close Open RenderChildrenJavascript RenderCSS RenderHTML RenderJavascriptContructor RenderPropertyChange
I was scratching my head about implementing the close method as I was afraid that it might be ‘bad’ thing to call it as there was a Close event defined in the WebObject class.

I had to use addHandler to hookup the wrapped shells events. The shell itself was created in the constructor, not sure if there is anything I should do in the destructor or in the other events of the WebObject.

My Web Shell Control

[quote]I made them all protected. Should the have been public?[/quote]Yes.

[quote]I was scratching my head about implementing the close method as I was afraid that it might be ‘bad’ thing to call it as there was a Close event defined in the WebObject class.[/quote]No problem there. But you should also call Self.Close() in the Close() event.

[quote] The shell itself was created in the constructor, not sure if there is anything I should do in the destructor or in the other events of the WebObject.[/quote]No problem either. My personal opinion is to either use Constructor/Destructor combination, or the Open/Close event one. I usually use Open/Close for controls and Constructor/Destructor for other classes, but it’s ok to mix.

Another thing you could do is wrap your control using the WebSDK. one of the reasons I say this is that it will allow you to make items that show up only in the tray, and those events you see in WebObject have been translated into something that you can actually use (and is a more supported way of doing this).

Tell me of this WebSDK…
Is this not part of the Professional Edition Distribution?

[quote=64218:@Brian O’Brien]Tell me of this WebSDK…
Is this not part of the Professional Edition Distribution?[/quote]
Its in every copy distributed
There should be a WebSDK directory next to your installed copy with docs & examples

Ahh … I see. I was expecting an application that did it for you…
Reading the PDF.

[quote=64239:@Brian O’Brien]Ahh … I see. I was expecting an application that did it for you…
Reading the PDF.[/quote]
We haven’t ever finished the ESP plugin that can read your mind & implement the code you’re thinking of :stuck_out_tongue:

No I was thinking that given a class there must be a simple way to produce a wrapper for say… shell.
but then you had know way of knowing that that was what I was thinking. :wink:

[quote=64248:@Brian O’Brien]No I was thinking that given a class there must be a simple way to produce a wrapper for say… shell.
but then you had know way of knowing that that was what I was thinking. ;)[/quote]
The SDK can be used to wrap a lot more than just something simple like shell
The YUI editor or jQuery controls or … well a LOT of existing web stuff can be wrapped
So automating it is really impractical

I mean like a wizard.
You select a class and it produces a new ‘wrapped’ class for you. (No UI)

[quote=64259:@Brian O’Brien]I mean like a wizard.
You select a class and it produces a new ‘wrapped’ class for you. (No UI)[/quote]
Still far too many possibilities for it to do correctly in all cases