Slyling codename one application using .css text files - codenameone

A few of months ago I watched this vido Steve Hanna video.
It describes a good way to apply style in a "Codename One application" using .css text files.
Does current version of "Codename One Plugin (3.6)" allow me to do that?
Do I need to install some .cn1lib module to make this feature work?

I would have written this as a comment, but I don't have enough reputation.
I would be very happy if you adopted Steve's cn1-css plugin into Codename One. I use it every day, and vastly prefer it to messing with the GUI theme/resource editor.
I use a lot of "custom" rounded rectangles with background color, and I'd much rather make a quick edit to a text file (.css) than "start over" in a paint application, divide image into pieces, etc. CSS is quicker and a lot less error prone (for me, at least).
Perhaps I am missing an "obvious" solution to this problem of "I want to try out a different bg color, or a different border radius," or maybe cn1-css is this obvious solution?
I am very grateful to Steve for writing this cn1-css plugin!

This is a feature Steve worked on in his spare time and integrated via an extensions which you can install with these instructions. We are looking for feedback on this feature and we are trying to gauge the desire to roll it into Codename One proper.
We know a few people use it but we're still looking for feedback.

Related

Add comments to Codename One build hints

I'm starting a new project with Codename One. I was pleased to see that there have been significant improvements in Codename One. About the various ways to edit build hints (https://www.codenameone.com/blog/build-hints-editor.html), I would like to know if there is at least a way to insert comments in build hints.
The problem occurs because, sometimes, the customization of build hints is very complex. That's why it is appropriate to note the meaning and motivation of each build hint.
You can comment in codenameone_settings.properties when editing it directly but that might be discarded by an editor as you work on it. This isn't something I tried in the past.

Basic text formatting during text input with Codename One

I know that is possible to programmatically format a text in Codename One using something like "Rich Text View". But in my use case the user can do basic formatting of the text.
For example, see the following two screenshots of the Protonmail app. How can I do something similar with Codename One?
In the first screenshot, "Taglia" means "Cut" and "Copia" means "Copy".
In the second screenshot, "Grassetto" means "Bold" and "Corsivo" means "Italic".
We don't support that. This behavior is very inconsistent between platforms and pretty limited in all native platforms so implementing it in a cross platform way isn't practical.
However, since all platforms have good HTML5 support it's pretty easy to implement it with a WebView by embedding a web based rich edit widget. Since these consistently work with HTML the results are cross platform and should be easy to work with. In the past we had a CKEditor cn1lib but I think it's out of date by now. The core concept should work though and should be much easier to implement as we now support the html package for deploying web resources. So you can take any HTML based text editor and just place the files under the src/html directory then open that hierarchy for editing.

Is there a tool for helping the extraction of localizable text from Xaml?

I am tasked with the localization of a Windows Phone 7 application. The first step is to replace the actual visible text with an ID and put the ID and the text in a resource file.
This is a very tedious work and I was wondering if there are tools for this to automate?
I am thinking along the lines of the gettext package and .po files used in the linux world.
Here is a codeplex project that may help you some. http://xlocalization.codeplex.com/. To use this method, each control that is to be localized must have the name property assigned.
I tried it with my existing project, and got results that were mixed, but in the long run, I decided to do it by hand. I don't remember specifically what the problems were that I had, but if you want to try it on a copy of your project, it won't take much time. If it works for you (and if your controls to be localized all have names), it could save you time.
Also, I don't know how familiar you are with localizing, but I wrote a blog on the subject that takes you from start to finish. It's at http://www.hopnet.mobi, click Blogs.
Hope this helps.
I know this will get a lot of traditional answers, but I would also like to put forward something completely original we tried (and succeeded) doing ourselves for more efficient localisation of Silverlight using Attached Properties instead of binding:
Localisation of Silverlight projects after completion
To pre-populate the database we wrote a XML parser to find our markers in all our project's XAML files (XAML is just a subset of XML after all). We could not find any existing tools to do what you suggested, but our requirements were simplified by our new method of localisation (no resource files and no horrid bindings).
(yes, this is almost the same answer as a previous one of mine today, but it seems to fit again).
Also for future reference keep an eye out for this tool: http://www.neovelop.com/ This tool will go in private beta soon and looks very promising. Judging from their preview movie this will do exactly what you asked for.

Is there a tool that can convert C# 1.1 Forms design to the more recent standard?

The old code, as we know, is dangerous because both GUI layout and business logic are mixed into one. Separating the two can be a tedious and an error-prone task. Is there a tool that can do this for me?
Thanks.
EDIT: The pretty obvious way of keeping the UI and the logic separate is through introduction of a partial class. I hope that clarifies the question. I suppose I am simply trying to go from 1.1 to 2.0 way of doing things. Simply opening and saving the old design in VS2008 does not do what I want.
No tool, but easily accomplished with cut-and-paste text editing. Add a new form to your project. In the Solution Explorer, open the node next to the form and double-click the Designer.cs file. Cut and paste the InitializeComponent() method from your old form to that file. Cut and paste the rest of your code. Remove the old form, change the class name of the new one.
There is no "standard", but lots of standard like ways people separate logic from UI. It forces you to design a particular way. So its a bit impossible to automatically redesign your software.
The best you have is refactoring tools, check out something like Resharper, makes it a bit safer to make some transformations.
No. Sry to say but there is no such tool, that is still manual work. If you're looking into doing it anyway I would suggest looking into WPF development, since the separation is much easier to realize there.

PowerPoint and WPF

I really need a way of loading a .ppt document in my wpf application. Can anyone give me a hint, code sample?
Checkout the following discussion thread. Also Dr.WPF got an interesting article that might help you as well: Hosting Office in WPF Application
However consider license costs will be quite high for your scenario...
According to this artice the DSO Framer is no longer supported. Have to look for something else.
You may need to elaborate a bit more on your particular need to get a practical answer.
I don't think hosting PowerPoint (ppt) is a good option because it requires ppt to be installed on the target machine.... and if the target machine has ppt then you can use its API to save the document as HTML and open it in a WebBrowser control.
If the target machine doesn't have powerpoint you may look into some online file conversion service and try hooking up there to convert to HTML and still use WebBrowser control.
I definitely don't recommend wasting your time with DSOFramer - it's very unstable at best and it will just feel like you're one step away from making it work for a while but it doesn't work.
Another option is of course to write your own parser for ppt files, the OfficeOpenXML version of the files is definitely "parseable". I've done that for Word docx and it's relatively easy to get the course data out of the document - say shapes, text... - but the devil there is in the details. There are a zillion little features to implement.

Resources