Hello,
I’m currently trying to convert my Web 1.0 project to Web 2.0.
When I’m just opening my Web 1.0 project in Xojo 2020.1, the styles will be still in the project.
When I’m trying to assign them to an object, I’m getting the error message:
Expected a value of type class WebStyle, but found a static namespace reference to class NaviButton.
What can I do to fix this?
I did also try to rebuild my styles using definitions, but there aren’t all the stylefeatues available which were available at Web 1.0 (e.g. round corners or gradient background)
Well, you cannot easily do that. Web 2.0 did away with Web 1.0 styles as you know them. You must use a bootstrap theme. That is fine if you like crayola colored buttons… But I digress. @AlbertoD showed a way in an other post (possibly only visible to testers) to import Web 1.0 styles. Basically, you copy the underlying javascript of your styles (from a saved text file), and add them to your selected bootstrap theme. Then you code the style to each control that needs it. Cumbersome at best, but feasible.
For developers creating applications that run in a browser, as opposed as web applications that go together with a website, importing styles is almost a must have feature that I do not understand to be in the plans at all.
Some of what is discussed there dates when we could not simply add the bootstrap theme to the project, but the general idea still makes sense. I believe also that others such as @Brock_Nash did something similar using dictionaries to hold styles and add them programmatically if and when needed. I don’t have a specific link for that.
I “solved” it like AlbertoD.
In my mainpage I created a method named “Style_Navibutton” using the Attribute Object as Webbutton.
In the method i’m declaring the style definitions like this: