subclassing WebToolbar?

Morning Folks,

I need to show the same toolbar across many pages. For some reason in the distant past I didn’t just drag it onto the page I embedded it into a container control which I instantiated on each window. This led to problems with it sizing properly across the window and I’m now trying to fix that. I was going to just subclass the toolbar to add all the items and handlers and methods that are common to all the pages and create events for the specific things.

The problem is that I can’t seem to actually edit the toolbar from a subclassed control. I can add events and methods and such, but I can’t actually add toolbar items via the edit interface that I get when the control is dragged into a window.

Is it just that there is no way to subclass the toolbar and include it’s toolbar items and menus and such? Or am I missing the secret menu item that switches the subclass to edit mode? I can, of course, cut and paste the toolbar from each window into each other menu but then if I have to make a change to the layout I have to make it in a dozen places rather than one.

File a report and I’ll have a peek in the IDE
Cant say I know off the top of my head

Been informed there is no support for this
Certainly not in the runtime javascript

So even if it worked in the IDE it wont work at run time

Place your Toolbar in a WebContainer.

[quote=223489:@Norman Palardy]Been informed there is no support for this
Certainly not in the runtime javascript

So even if it worked in the IDE it wont work at run time[/quote]

This is making me think I wasn’t clear in my initial question. I can’t imagine that what I was trying to do has anything whatsoever to do with the javascript runtime? What ends up on the browser or being sent to the browser would be no different if the toolbar was the result of a subclass or a base class once it’s been dragged into a window would it?

I can subclass a toolbar and it works just fine. I can add event handlers and methods to it and then drag that into a window. What I can’t do is add the toolbar items and names and such to the parent class. I can only do that once I drag it into a window. Why is it that there is no toolbar editor when it’s just a class the same as if it’s a class dragged into a window?

Thats fine, for now I’ve just cut and pasted the same subclass of the toolbar into all my windows, but that seems wasteful and if I ever want to make a change to the name of a toolbar item I’ll have to make it in one place and then cut and paste all over again. Or perhaps I should generate the toolbar items dynamically in code in the Open event or something :wink:

Michel, thats what I just stopped doing :wink: I could not get the toolbar to properly maintain it’s locked left and right position when it was inside a container control no matter what I did. It would NOT go to the edge of the window or it would not stop going past the edge of the window.

The locking mechanism is not perfect. You need to tweak controls size and placement to obtain better results. That is exactly how I came to develop RubberViews originally for my own use.

[quote=223495:@James Sentman]This is making me think I wasn’t clear in my initial question. I can’t imagine that what I was trying to do has anything whatsoever to do with the javascript runtime? What ends up on the browser or being sent to the browser would be no different if the toolbar was the result of a subclass or a base class once it’s been dragged into a window would it?

I can subclass a toolbar and it works just fine. I can add event handlers and methods to it and then drag that into a window. What I can’t do is add the toolbar items and names and such to the parent class. I can only do that once I drag it into a window. Why is it that there is no toolbar editor when it’s just a class the same as if it’s a class dragged into a window?
[/quote]
For the same reason you cant edit the UI of a subclass of something like a segmented control, pagepanel or tab panel
Its not supported

yes, I get that now. I just wasn’t willing to accept this was the same situation for some reason :wink:

sorry … web is special in some ways but not this one