No more MouseUp for WebLabels?

Um. I noticed that MouseUp is no longer an Event Handler that we can choose for WebLabel controls.

Why was this functionality removed?

1 Like

Just another bad decision based on the opinion of just a couple of people who thought xojo users weren’t using WebLabels as a clickable elements :man_facepalming:

3 Likes

There are formatting options for WebLabels that buttons simply do not have. For example, text could change from a description to a link to documentation. A click on that link would then either trigger code (e.g. a dialogue box displaying) or a different web page opening something (e.g. a user manual).

[added] A button would be … awkward… in some circumstances.

1 Like

Note that WebButtons now have a “Link” style which might work for you in some cases:
image

It gives the button a borderless look with blue font.

3 Likes

Did they also do away with assigning a WebStyle to WebButtons, too?

My experience of Web 2 is that it’s both easier and harder than Web 1. If you are OK with the built-in styles, then Web 2 is quite easy to use. If you want to go beyond that, then Web 2 gives you easier access to the “bare-metal” (javascript and CSS) in a way that Web 1 didn’t.

Lots of changes overall. Aside from a few killer bugs and missing features, I’m liking Web 2, but the transition from Web 1 is not trivial.

2 Likes

Web2 is a totally different animal. How do you assign styles to a WebButton in 2?

My app in development that has extensive work put into it (easily over 200 hours) makes extensive use of webstyles.

1 Like

Short answer: you don’t! Longer answer; you can customize the theme by putting in a custom version of Bootstrap. THere’s a disucssion here https://forum.xojo.com/t/web-2-0-quick-tip-create-your-own-bootstrap-styles/53497 but that’s for beta testers only.

Maybe Xojo can link to some documentation or exmaples?

2 Likes

I am surprised they flat took out the Styles options for those of us using WebStyles. It’s an amazing feature, and I am sure there is a way to add in CSS some other way. Bootstrap looks a little complicated.

You can use
Me.Style…
and autocomplete will suggest several options.

https://documentation.xojo.com/api/user_interface/web/webstyle.html

In Web2, almost none of these styles are exposed in the IDE at design time, which means that you can add code like this to a button:

  WebButton1.Opening
    me.Style.FontName ="Courier"
    me.style.FontSize=9

And it works just fine.

But there’s no way to set the WebButton font in the IDE.

And yet, if you are editing a WebLabel, then the IDE shows a Font section with all of these properties.

Is this an oversight? Is the IDE is just missing features? Or is this intentional?

1 Like

The WebLabel Font section was not there at the beginning, it was added later. My guess is that a Font section will be added to other controls on the next release.

It’s not so much that this functionality was “removed”, because Web 2.0 is a ground-up rewrite. It’s more that it hasn’t been added to the new framework yet. Mouse events for Labels and other controls will be back in a future release. See https://blog.xojo.com/2020/08/27/converting-web-projects-to-web-framework-2-0/

3 Likes

The low level details of why it doesnt are something Xojo users are frequently told we dont need to know / understand / care about (ie we’re not supposed to need to know JS /CSS / HTML )

It used to exist
It doesnt any longer
It appears as if it was removed either way

1 Like

That blog post is VERY useful. Xojo should promote the heck out of it!

2 Likes

@Paul_Lefebvre will need to write a collection of

In web1 you did :ribbon:, in web2 you need to do :gift:

And put it in a pdf manual “Web1 to Web2 Migration” with more tips.

1 Like

Personally, I think there should be a migration assistant that will convert old code to what is expected - like subbing in Var for all of the eleventy-billion Dim within my app. As in, everything that coders would not know - all of those subs get made at the same time, as an extension of the debugger function.

Similar to the VB migrator, we could have a Welcome to 2020 migrator LOL

Personally I hope not.
Code converters between so different apis can possibly generate many problems very hard to fix.

3 Likes

Well… If they did it, in 2023 we would be beta testing 2020R1 conversion tool 1.0.0.3452345 because no one can cover all code styles, tricks, unusual things people will continuously show us.

It’s a question of priority. That’s all. Notice there are no mouse events for the canvas control either. That doesn’t mean there will never be any.

2 Likes