Any Interest in WebSDK 2.0 wrap of Web1.0 controls?

I was playing with this concept of wrapping the new Web2.0 WebSDK classes be method/event mapped with the old WebControlWrapper.

Ideally this would allow you to import your old WebControlWrapper classes and change its subclass and just have them work. Granted they’d work with the less efficient back and forth rendering of the Web1.0 design.

Also after thinking about this I wondered if something similar could be done for all Web1.0 controls. WebTextfield -> WebLegacyTextFieldLegacy
These controls could be updated in your old project with a find/replace and then copied over to a Web2.0 project. (Probably couldn’t use the convert project as this messes with methods and naming too much)

Again these controls would be a performance step backwards from Web2.0 but would allow the 1.0 benefits of properly resizable controls etc…

It would be a pretty big undertaking and might just be worth writing new 2.0 controls that have the functionality we want, but just wanted to check interest and see if anyone else had any thoughts or suggestions. Web2.0 is too rough for me at the moment to convert my project and have it function the same

As much as I really do appreciate all your work and hints, this idea is of less interest for me, as the above would be my showstopper. I really like the new performance of Web 2.0. My Web 1.0 projects are all in sole “maintenance” mode. On top of that they are all using heavily GraffitiSuite, so I would rather convert those apps and using the new release of GS, once the performance bottlenecks are fixed in GS.

This said, I really like the idea in principle of wrapping the old Web1 stuff. I can imagine that others might have good use for it. But I don’t.

Thanks @Jeannot_Muller - that’s exactly why I was looking for feedback - good to hear!

2 Likes

Being an egoist I want to see your talent in continuing to do good stuff for Web 2.0 ;-).

3 Likes

My 2CENT
I only have one Web 1 in-production project. I had to add a lot of workarounds for stuff that didn’t work. Now I’m facing more workarounds in Web2. Mostly in lost mouse move/click events that are now removed. So several JavaScript functions added to the header to work around the Framework to give me that functionality back.

I’m not to the point where I think Web 2 is viable enough to convert my Web 1 project completely at this point.

So how would you deal with missing event triggers or other missing functionality? I also dabbled a bit with copying styles from my Web 1 project, and they did paste into Web 2 project - although the IDE didn’t know what to do with it now. Modifying bootstrap styles in the header - I haven’t quite grasped that yet. Sure globally you are fine, but I had same type controls on different pages with their own styles before and I don’t know how you’d do that now.

I don’t know if it’ll help you now, but I’ve got a small collection of Web 2.0 patches I call TP_WebKit. When you find issues in the framework it’s always best to file a ticket, but sometimes you just need something fast and that’s how I ended up with TP_WebKit.

Currently, I’ve got patches to fix or restore:

  • KeyDown
  • WebTextField.GotFocus
  • WebTextField.LostFocus
  • MouseDown
  • MouseEnter
  • MouseExit
  • MouseMove

https://strawberrysw.com/tp-webkit

Some things I can make patches for until Xojo gets to them. Send me an email with the features and functions you’re looking for :slight_smile: support@strawberrysw.com

3 Likes

Try this code for example (in the show event of your button)

me.style.Value("border-width") = "5px"
me.style.Value("border-color") = "red"

That will change your standard button to:

Bildschirmfoto 2020-12-01 um 23.38.44

with objectXY.style.value you can change a lot of parameters, not all of them but many.

Why not in the Opening event?

Good question. I don’t know. During testing there were thing only working in either opening event or showing event. This one is working in both. Do you have a rule of thumb or something sustainable? I know you have deep dive into Web 2.0 as well.

Honestly I’m still switching both events. I even have feedback case in mind, which I can’t yet reproduce. I have for instance the situation that a listbox is not attaching to the bottom, even though I’ve put a lock on it. I noticed that when I’m adding a shown event to it (even if there is no code inside) it magically works. But again, unfortunately I can’t reproduce it only empty project. This has lead to the effect that I have a lot of Shown events, and if have to put code in, that’s then the first place, as I have the event there anyways ;-). Not a good practise, as I remember that Geoff has pointed out, that for better performance we should reduce the amount of used events …

I just wrote another article showing you how you customise individual controls a bit, perhaps it might help you. You can’t do everything, but still a lot.

https://medium.com/learn-xojo/how-to-customize-xojo-web-2-objects-41d859c53673?sk=8922d9d46caf9d413344f088c6f09a92

1 Like

Thank-you Jeannot and Tim this is really good stuff on the Styling.

1 Like

I think it’s a great idea, not so much for the production environment but to be able to grow the web 2.0. I think that many of us had to find alternative ways to overcome certain limits of Web 1.0, but at the same time, are the ones that block the conversion of these projects to version 2.0 (even if still raw). If you could use all the controls created with version 1, you could test version 2.0 heavily rather than wait for the rewriting of all the projects which in some cases is crazy…