Why is the Designer in Codename one not reporting the attributes I set? - codenameone

I started a Codename One project with the "Hello World bare bones". I used to define the styles in the Theme tab from the Designer but now it is becoming tedious.
Actually for some selectors, even if I override (unchecking the Derive box) some properties the style is not changed in the Designer (see below) or in the app itself.
However, in the list of selectors, the color is not the one I selected but the alignment seems to be it.
It seems that the theme is locked somewhere. Do I make a mistake, or should I set a constant to "unlock" the theme, or even should I clear some directories?
Please note that I am using NetBeans with designer V 1.1
.
Edit March 1st 2017
Following #Diamond's great tips, I was able to change the foreground color by setting the Border to empty (instead of NULL). However now the alignment is still not what I expect (see below). How can I do for this property ?
Any help appreciated,

In the Designer, Border is superior to background color and background image. Which means if the border image is set, a background color will have no effect unless the border is just a stroke or line.
Always solve this with these few steps:
Go to the Border tab and uncheck the override.
Click the ... button next to Border Help and a new Dialog will show.
Change the Type (First line) to Empty and click Ok.
Your background color will now have an effect.

Related

Why ALL styles in my theme.res file have border mode set to top-only?

Today I found out I have all styles, that have set rectangle border, set it's border mode to top-only. When I click to choose other border mode, and confirm OK to Border dialog window, it doesn't change that border mode. It stays top-only. So I can't change border mode.
When I was working with it on Friday, it worked.
Was there a change/update of cn1 framework between Friday-Monday?
We recently made a fix for this feature (or two fixes) and it might have broken the designer tool which relied on the original behavior. Please file an issue on that so we can keep track of this.

How to change the border color in DB-Visualizer?

I am using DB-Visualizer 9.2.10 and I want to change the border color of the editor but I don't see any border option to change. Below image shows the options colors and borders but in my pro version I don't see this option. Is there any other way to accomplish the same.
Thanks
You should be able to change the border by going to Tools -> Properties.
You can either select one of the predefined styles or specify a small image file to use for the border.
You should also be able to change it by going to Database -> Connections

Specifying animations and Toolbar items in the resource editor

I'm getting the hang of using themes to change my app's look and feel, but there are still a few mysteries. Right now, in the SocialBoo theme, the button to show the overflow menu is way too small, even though it's the right size in any other theme. Also, the overflow menu pops up with a nice animation on the other themes, but not in the SocialBoo theme. Can anyone tell me how to modify the theme to fix the size of the overflow button and specify an animation for the overflow menu?
SocialBoo is a pretty old demo that still uses the old GUI builder. We are slowly migrating away to the new GUI builder which was slated for the 3.4 release but is currently still considered beta status.
The new GUI builder standardizes on Toolbar which didn't exist when we developed the old GUI builder.
The icons for overflow/side menu can be customized via theme constants specifically sideMenuImage and menuImage.
I was able to partly fix this in code like this:
Hashtable<Object, Object> newThemeProps = new Hashtable<>();
// I need to start these with #, which tells the addThemeProps() method
// that these are theme constants, not theme properties.
// (The # character gets stripped out.)
newThemeProps.put("#menuTransitionIn", "bubble");
newThemeProps.put("#menuTransitionOut", "fade");
UIManager.getInstance().addThemeProps(newThemeProps);
This gave me the animations I wanted. I still don't know how to change this in the resource file.
As for the buttons, I fixed this in the Resource Editor by opening the TitleCommand style and setting the Background Image type to [empty] in the "..." button. This didn't improve the size of the button, but it removed the too-small button image, so it looks more professional. Here's what it looks like before the fix:
This is after the fix:
(Yeah, I added another item to the menu, too.)
It retrospect, I could probably have just checked the Derive button in the Background Image tab.
I also changed the TitleCommand foreground color to white (not shown), because the black buttons were practically invisible.
Finally, I changed the FontImage Icons to white with this piece of code:
/**
* The icon created by this method gets passed to the Command constructor.
*
* #param icon The FontImage constant for the desired icon
* #return The icon as an Image.
*/
#Nullable
public static Image createClearMaterialIcon(char icon) {
materialIconStyle = UIManager.getInstance().getComponentStyle("TitleCommand");
// materialIconStyle.setBgTransparency(0, true);
if (icon == 0) {
return null;
} else {
return FontImage.createMaterial(icon, materialIconStyle);
}
}
The transparency of the style needs to be set to zero (transparent). This can be done using the setBgTransparency() call in the line that's commented out, or it can be done by setting the TitleCommand resource's transparency to 0 in the Color tab.
Thank you, Shai, for pointing me in the right direction.

Change border brush from skyblue in wizard control of extended wpf toolkit

I'm using Wizard control of Extended wpf toolkit package.
I would like to change color of the border. See sky blue in image below:
I tried set broder brush\background to wizard\wizard page\window controls, but it failed.
Anybody know how to change it?
Your assistance is appreciated!
Now that you have provided more info, I can see that your question title does not match what you asking to change. You are not asking to change the color of the border of the Wizard Control, you are asking to change the color of the WPF Window.
It takes some time to get things right, and I highly discourage doing this if you app will be used by people with disabilities, who need high contrast, who customized their desktop to a certain color because of color blindness, and the list goes on...Microsoft has worked very hard to address such issues with the defaults.
BUT...you can change this by restyling your Window Style. You can find plenty of code examples.
Here are two:
Can i set the window border color in WPF?
How can I style the border and title bar of a window in WPF?

WPF: Changing the look of a Surface Listbox "click-effect"

I'm changing the look of some Controls that I use in my Microsoft Surface Application at the moment. And today I'm working on a SurfaceListBox.
I have the template for it and already changed background and borders and other stuff.
But I really cannot find where I can change the color of the rectangle that appears on the ListBoxItem when you touch the ListBox. At the moment it's just white and I want to change that.
It's not something like the effect that you can see when the item is selected. I already found that and changed that so my selected item now appears in a different color. But the effect in the second when you touch the item stays white.
So where can I change this effect?
If you mean the bright, white highlight that happens when you press your finger against an item you should look into the SurfaceShadowChrome. It's used by (almost) all surface controls to give feedback when the user is pressing on a control.
It does have a Color property that you can modify to suit your needs. Apart from the color, and the tweaking of corner radius and shadow offset, it's not a very flexible decorator. But hopefully, you'll be able to make it do what you need.

Resources