CodenameOne Cannot Add Image to Button Using GUI Builder - codenameone

I am using the CodenameOne GUI builder to add an image to a button.
I added the image to the res file and then clicked [Pick Image] in the Property Inspector (see my screenshots). The button image (a plus sign) appears in the GUI.
I hit 'save' in the GUI Builder and then close it, then go back to NetBeans and run a debug simulation, and the icon appears, so far so good. .
But now I run the debug simulation again and the button image is gone!
I open the GUI Builder and it's gone there as well: the button has reverted to [Pick Image] and, when I click [Pick Image], my image is missing from the res file.
What is going on here? I repeated this three times with the same result- I literally ran the Debug sim twice without doing anything in between and the icon disappears, and there is no indication in the Output messages to indicate that there is a problem.
The Form1.gui file shows a reference to the icon image so maybe the resource file is being cleared in between makes?
<component type="Button" icon="resFile:plus.png" name="Up" actionEvent="true">
</component>
[EDIT] I found that if I add the images using the CNO Designer on the theme.res file, the images 'stick' and I can get a good build.
HOWEVER, when I make code changes and then open the GUI Builder again the images are removed from the res file.

can you add a code snippet of how you add the image ...
According to the error message, you may have chosen the incorrect path, or maybe you have added the path incorrectly in the code.

Unfortunately, the old CN1 Designer is not compatible with the CSS compiler. If your project uses CSS, you should add images to the resource file directly in CSS (e.g. by adding it as a background-image on some element), or import it via the GUI builder, as, adding it that way will also add a reference to the image inside the .css file.
This stems from the CSS compiler pruning "unused" images in the resource file. If the image isn't referenced in the CSS file anywhere, it will be removed from the output .res file.

Related

How do I find the source code, in VS code, for a component, after running and seeing it locally?

I am working on my first front-end project for someone and he send me the souce code to modify some buttons, but because is the first time for me, I cannot find them in the source code due to the app having a lot of files, is there any way to do this in a smart way ?
Open the folder that contains the project in VS Code. Click the search icon, type a fragment of the jsx used to render the component in question, like <MyButton and you should see all of the instances of it. Click on one to open it in the editor and then rightclick on <MyButton in the source code and click "Go to definition."
If you don't know the name of the component then you can do basically the same thing with the caption for the button or its image file name.

Does changes backgorund in theme file cause problems to images?

I made some changes on boackground color to theme.res and all all of sudden my stoped working.
I check the debbuging console and showed me that could not find an images from res.
I tried to open gui builder but it did not open. So I deleted the component that used this image from the xxxx.gui file.
My app start working and crashes again on another point that needs another image.
Gui builder still is not working.
Any help is aprecciated

correct way to add js in sencha architect (ExtJS)?

This thread works well in a mobile app but in a desktop app it would seem I cant add the reference to the external JS in an extjs desktop app.
The instructions from Sencha somehow don't correspond or it doesn't work for me when I try and follow them. So, I am selecting Resources->Library and can see the attribute Include JavaScript (ticked) and Library Base Path:/ext.
The JS file I am using I use in a phone app and its fine - I added it to the app.json in that and compiling the app copies the file over to the target and defers the loading.
In this case with SA I am not seeing the file copied to the target - nor can I follow the instructions with SA 3 that are documented. The only way I can add an external JS is by dropping it onto the filesystem into the ext folder manually. Again, it doesn't appear in the target and certainly errors when I run the app with
Uncaught ReferenceError: hex_sha512 is not defined
This JS has been used in other apps, is proved and tested but just relates to SA or my wrong use of SA.
The proper way to add a resource in Sencha Architect, regardless of framework, is to add it as a JS resource.
This is most easily done by hitting ctrl-t (or cmd-t on a mac) and typing "js resource" (or some shortened string thereof to get autocompletion)...
Alternatively, you can use the toolbox, click "Resources", and drag out or double click "JS Resource"
These are just different user interfaces to accomplish the same task.
Once you've added your JS resource using one of the above methods, you need to set the URL in the config pane (at bottom right unless you've configured Architect to swap the left and right panes)...
The URL is to be set relative to your project folder. If you copy the JS file into your project root under a folder called "lib" for example, then you'd set the url config to "lib/foo.js" - where foo.js is the filename, of course.
Hope that helps!
My lack of understanding of the instructions or they are not clear:
It would seem the way to do it is take eyes up to the top right of SA and spot the + button as shown in the image.
Add the JS resource and scroll up because it may be hidden behind the property inspector.
On setting the url field under properties, the source of the JS appears in the main editing window.
Certainly works fine after the app is built.

Wijmo and Dotnetnuke 7. Has anyone tried it? Not working

Has anyone tried using the wijmo widgets in DNN 7.+ ?
For my example I'm trying to use the upload widget.
If I upload to a path on my server and test, it works (As in the dialog appears to choose a file... the popup)
If I load it within a page on the site, the button shows but nothing happens when clicked.
All script files and necessary markup are correct.
No console erros, nothing. Very confusing.
Wijmo widgets work in DNN 7.+.
The “action” option should be changed to the server’s address of upload.ashx file.
Note: the upload sample can’t be opened by file path(d:/……/upload.html), please make sure it is opened on server.
Thanks,
Richa

Getting IE Browser to open the File

I embed the default Internet Explorer in my win32-C Application via COM/OLE.
I display a web page having a link (anchor tag) to save/open a file.
When i click on the link, It does some processing in the background but does not give me a dialog box asking to save or open the file. From Fiddler I come to know that it is writing to the cache but not able to access it or show any popup.
I expect to see the dialog box asking me to either save or open the file (default)
If i do this from the IE browser then everything works fine.
EDIT : I tried a sample code in which I do get to see the Dialog Box providing me with the option of saving, opening the file although tallied everything with my code I still fail to see the box.
I was thinking of the Modeless Dialog Box issue but I can see a Message Box in my code. So modeless dialog box is not disabled.
Not able to get how to get it to work.
(Note: Please see the attached images)
EDIT: I edited the The EmbedBrowser Function in my code, my browser was not given a pointer to my IOleClientSite object
New Code :- http://paste.ubuntu.com/1062010/
But problem persists!
I figured out the issue.
The interface DWebBrowserEvents2's invoke method was implemented to not display the File download Box while downloading.
Modified it to allow the same.

Resources