How to remove for default images from skin folder provided by smart Gwt - smartgwt

Can we remove default images from skin folder in Smart Gwt I have tried to remove or override that image with same name but for that time it worked fine but when i compile again then all skin default images will be come

You will have to create you own skin. Otherwise every time you compile the "default" SmartGwt skin will be reapplied. To do so read for more details and paradigms at the SmartGwt's skinning "manual"

Related

CN1 - unable to use localization after activating css

Recently I switched over from the legacy css integration to using the current method of css support via the CN1 Preferences dialog. Ever since then, I've had repeated problems accessing strings from the localization resource file.
A few important points:
I have two theme files, but even importing the strings as a csv file into the theme generated by css doesn't work
I've tried all possible combinations of theme initialization with the two theme files, including initializing just one of them, with no consistent success (occasionally it works, but then if I modify the css and the theme file gets regenerated it stops working again)
I created a brand new project and copied my code into it, imported the string files, and it worked - until I turned on css support. Then I was back to square one
When it fails to work, the method UIManager.getL10NResourceNames() returns an empty array
Any help would be greatly appreciated!
CSS controls the file and as a result you can no longer change the theme.res file by other means. You need to keep a separate localization.res file and load that strictly for the localization functionality of your application. You can use Resources.open("/localization.res") to load an arbitrary resource file.
After much poking around, I found the solution. It turns out my situation was the result of a few non-standard things I did. First of all, I had a theme.res file which I renamed using IntelliJ's Refactor >> Rename function, which renamed the hardcoded css theme name in the build.xml file to my new name. I needed to manually revert that string in order to prevent the css compile task from overwriting my theme file. The second thing I noticed is that sometimes (I'm not clear on what caused this) the theme file was not being refreshed in the /out directory when running the app locally. This would manifest itself, for instance, when I would add an image in the theme file, but when running the code it wouldn't be able to find it in the Resources hashtable. Every time this happens, I now know to just delete the contents of /out, thereby forcing the IDE to rebuild/recopy the theme file (I could probably just copy it manually to the /out directory, but I think deleting it is safest).

Appcelerator App Designer assets path issue and RGBA

I have an issue with Appcelerator App Designer.
I have an image path in assets like app/assets/iphone/images/MainBG.png
In xml i need to use path like /images/MainBG.png
But App Designer set path like /iphone/images/MainBG.png that does not work when i run my app... Yes, i can change this path, but after that i cant see image in App Designer view.
And second question:
App Designer cant use alpha... Yes, i can manualy set BGcolor like rgba(150,0,0,0.5) but in App Designer view i cant see result.
Can any one help me?
Sorry for my English))
Though I have not used App Designer, but following might help you:
put all your image files in app/assets/images folder
now set path in XML like image='/images/MainBG.png'
Set background color manually, you can use following combos:
you can use backgroundColor:"#fff"
also you can use backgroundColor:"#ffffff"
this one also works backgroundColor:"white"
this one works for alpha - backgroundColor:"#abcd", in this syntax, alpha will be 'aa' & r/g/b will be bb/cc/dd.
so this one will also work for alpha - backgroundColor:"#aabbccdd", 2 digits for each alpha/red/green/blue

Load many pictures in a form

I was asked to develop a game called "Flag Quiz" in which the player have to guess the correct name of the flag that appears in the middle of the screen.
Of course I have a lot of pictures (221 flags) and I have to put them inside the program because, when the button Play is pressed, the program has to pick randomly 10 of these flags.
Problem
I was thinking to use an ImageList but the flags are 480x311 and so Delphi asks me to separate the picutre in 30 different bitmaps. Can I do anything about this?
My idea, to avoid that problem, was the following (although I think that it's not very good): create 221 TPicture components (invisible to the user of course) and load in each of them a picture of a flag.
I'd prefer not using the last idea I had. Do you know any improvement?
This sort of problem is simply not suited to the form designer. You want to store 221 images, and managing that in the IDE will be horrible. Once you've got them all in you won't be able to see them readily because they will be base 16 encoded in a .dfm file. Under revision control it will be a mess because you won't be able to change individual images in a manageable and traceable manner.
The accepted way to do this is to use resources. If it were me, I'd arrange for my images to have predicatable names. For instance, flag1, flag2, etc. I'd generate a resource script (.rc) that listed all the flags. I'd compile that resource script to a compiled resource (.res) which is linked to the executable. I'd have the resource script and the image files committed to revision control.
Then at runtime you have a single TImage control to display the flag. Every time you need a new image you load it with TResourceStream, and push it into the TImage control.
Devexpress has a Componnect named cximagecolletion that you can put your images on it and save and load images from/to file
or you can save all flags in small access db and load it when you need using tadodataset
there is no doubt that if you put your images direct on your form your dfm grow very high and so you Get Into trouble
Personally I would store each file as an image in a dedicated subdirectory, using the country as a file name. Then I would read the subdirectory file names on entry to the program (so I have a list of countries that I can randomly choose from) and use TImage.LoadFromFile to display the flag. This is far easier to extend than using a resource file (IMHO).

How to add favicon in rails 3.2

I know new rails apps come with an empty favicon.ico file. I want to know how I go about adding a favicon. I know you can use the favicon_link_tag helper, but I am not sure how to populate the favicon.ico file. Do you use favicon generators? If so, which one is best?
I also want to be able to cache it, does rails do that automatically as well?
Thanks
Simply add this to the <head></head> section of your layouts:
<%= favicon_link_tag 'favicon.ico' %>
Place the favicon.ico image in /app/assets/images/ if you are using the asset pipeline, and in /public/images/ if you are not.
Also, there is a bug if using Ruby 2.0 with Rails 3.0.20 (and maybe also 3.0.x), that will throws an exception when trying to render favicon.ico.
The fix is to place the following code into application_controller.rb:
config.relative_url_root = ""
generate your favicon for example here: http://www.favicon.cc/
and put in to public/ directory
UPDATE
Favicon in public folder is not precompiled and it may be cached for a long time.
It looks like it is better to use favicon_link_tag to avoid favicon updating problems. I do not know browsers needed favicon in root. According to favicon wiki all modern browsers maintains
<link rel="shortcut icon" href="favicon path" /> (favicon_link_tag)
While all these answers are saying to create a 16x16 icon, the reality is you should be creating both a 16x16 and 32x32, in order to support retina displays. None of the online generators did a very good job with this.
On Mac, there is a great $5 app called Icon Slate, which allows you to easily create both formats in a single ICO file.
On Windows, I've used Axialis IconWorkshop with great success, but it's a much heavier-duty tool, and is significantly more expensive at about €50.
Both will create an ico file with both 16x16 and 32x32 images within it.
If you're using the asset pipeline, use the app/assets/images folder rather than /public. The number of fringe browsers that ignore the link tag is rapidly approaching zero, so jumping through hoops to accommodate them isn't worth it.
As mentioned in other answers, use this in the head to display it:
<%= favicon_link_tag 'favicon.ico' %>
I highly recommend this option. It was easy to use and free
http://converticon.com
write in application.html.haml:
= favicon_link_tag '/images/favicon.ico'
place file favicon.ico in dir:
project/public/images
You pretty much need a 16x16 pixel image file called favicon.ico and it must be available publically in the root of your site.
You can always use a major image editor to convert your logo or other image to the .ico format. There are free options like Gimp that can make such great icons based on existing image better than online icon generators.
I tried the links above and the services were not very simple to use. I find this link on another site and it copied over my .png file flawlessly and was very simple to use. I thought I would share this link too, as I think it is a better service.
http://www.chami.com/html-kit/services/favicon/
Haven't done it for years, but Gimp is capable of saving .ico files with multiple images having different sizes.
You just need to export to .ico format with some visible layers.
To generate a favicon for all platforms (not only for desktop browsers), you can use RealFaviconGenerator and the rails_real_favicon gem:
Go to RealFaviconGenerator and submit your picture. You can craft your icon, platform per platform: iOS, Android, etc.
Once your icon is ready, click the "Rails" tab to get the steps to install your favicon in your Rails project. Basically, you will be asked to:
Add the rails_real_favicon gem to you Gemfile
Create a new file named favicon.json. This file describes the icons you've just designed.
Run rails generate favicon to actually create the icons and HTML code.
Add render 'favicon' in your layouts to insert the HTML code in your pages.
The advantage of this solution is that it injects the favicon files (favicon.ico, apple-touch-icon.png, but also browserconfig.xml and manifest.json) in the asset pipeline.
Full disclosure: I'm the author of RealFaviconGenerator.
The solution I found that worked for me was to do the following:
Go to http://realfavicongenerator.net/favicon_checker and confirm you have a good favicon. If you don't, then use their tool to create one (plus many other useful and related icons). Note: this requires that you have a good icon (e.g. PNG) to use as a basis for the favicon.
Take advantage of http://realfavicongenerator.net suggestion to use ?v=version option to help defeat the browser caching issue. This helped me.
Copy the favicon.ico to public and app/assets/images. You'll only need one but if you don't know which one, copying to both places doesn't hurt...or you can experiment to see which one works - take advantage of the ?v=version to perform your test.
Add the following line in the <head></head> section of your layouts in app/views/layouts files (e.g. application.html.erb):
<%= favicon_link_tag 'favicon.ico' %>
Hopefully that provides a simple recipe. I'm sure if I missed anything, someone can and will improve on this answer.
I had a problem when I put file into /public/favicon.ico, I am using AWS EBS.
I could fix the mistake.
The better solution for me was put the file into /app/assets/images/favicon.ico and to use = favicon_link_tag 'favicon.ico'
In rails 6, simply place it inside the public folder and reload the page.

How does theming for ziya charts work?

I'm implementing charts using The Ziya Charts Gem. Unfortunately, the documentation isn't really helpful or I haven't had enough coffee to figure out theming. I know I can set a theme using
chart.add(:theme, 'whatever')
Problem: I haven't found any predefined themes, nor have I found a reference to the required format.
If you install the ZiYa plug-in into your Rails application there should be a themes directory where you said. Just copy one of the existing themes, change its name to whatever you want, and then modify it however you like.
Another options for nice Flash charts is Open Flash Chart. I moved from Ziya/SWF Charts to Open Flash Chart when working on Flash charts in a Rails app I was working on. There is also a Rails plug-in for Open Flash Chart. Besides the fact that it is easier to work with, Open Flash Chart is open source, so if you can hack Flash you can customize it.
As I understand it, the themes are used by initializing the theme directory in your ziya.rb file like so:
Ziya.initialize(:themes_dir => File.join( File.dirname(__FILE__), %w[.. .. public charts themes]) )
And you'll need to set up the proper directory, in this case public/charts/themes. It doesn't come with any in there to start with as I recall. Are you having problems past this?
To partly answer my own question, there are some themes in the website sources which can be checked out at
svn co svn://rubyforge.org/var/svn/liquidrail/samples/charting
(then go to /public/charts/themes/)

Resources