Changing specific Multilist line UIID programmatically - codenameone

My problem is that layout of my application does not behave in a same manner on different platforms. etc. On Windows platform fonts are larger than on Android or iOS so I'm trying to fix this programmatically.
In case of MultiButton I used:
if (platformOS.equals("win")) {
findMultiButtonMainMenu1(f).setUIIDLine1("MultiButtonCustom");
}
I dont see that MultiList has method for changing specific line UIID.
Is there a way to change UIID of the specific MultiList line programmatically?
Is this the right way to go or I should try to use a different theme when application is running on Windows platform?

Personally I think its very wrong to use code like:
if (platformOS.equals("win"))
This will litter your code with such hacks. If you want all the OS's to look the same just remove the includeNativeBool from the theme or copy one of the native themes (e.g. the iPhone theme) to get a single look for all platforms.
As to your answer this isn't exposed as an API since the class was mostly designed for the GUI builder but you can call:
list.setPropertyValue("uiid1", "YourUIID");
To do it.

Related

Where to find a free style for my WPF applicaton?

I am not happy with the default style of my application and I'd like to add a style that makes it look more professional. I downloaded some themes but the ones I found kinda ruined my window interfaces.
Any idea where to find free recent WPF styles?
There does not exist anything like this, what you are describing. You can get Windows themes, which will impact your whole OS but also your application if you have been using system colors while developing.
There is no magic formula that would know how to style which button. This is something you have to implement on your own.
What you can do is to learn more about how to properly style an application using styles from from a external . In order to make your application more appealing you can download a color pallet and follow it. The designing you will, still, have to do on your own.
There are themes pre-made available on the internet. : http://brianlagunas.com/free-metro-light-and-dark-themes-for-wpf-and-silverlight-microsoft-controls/
You need to add them to you project.

Should I care about current theme?

Authoring a WPF control template, consisting of only a Grid, some TextBlocks and a couple of Buttons, do I really need to worry about the current theme on user's machine? Will it look crippled or otherwise imperfect on a machine running on Win8? I do not have access to a Win8 machine, so can't ensure, but this forum post suggests that "simple" controls are not affected by the current theme. If that is the case, which controls are included in the list of simple contorls?
I believe all standard controls come without any styles applied to them on Win8.
Update:
I am sorry it looks like I was wrong. There is a specific Theme for Windows 8. It is called Aero2.NormalColor.xaml
You can find more info about it here:
https://social.msdn.microsoft.com/Forums/vstudio/en-US/e3dd4221-af4d-4ae4-a983-895db12ebcd0/what-is-the-theme-name-for-a-wpf-application-on-windows-8
Here is where to find the theme file itself:
https://social.msdn.microsoft.com/Forums/vstudio/en-US/d05228d4-3dc2-4241-84a1-236a7a1f2d65/where-is-the-xaml-source-for-the-aero2normalcolor-theme
More here
http://brianlagunas.com/add-windows-8-aero-theme-support-to-your-wpf-custom-control/
Update 2:
And here is how to force your application to use specific Theme ignoring windows version:
http://www.kennethham.com/wp/2010/11/force-wpf-to-use-windows-7aero-theming-in-classic-mode/

Scalable themes in qooxdoo

I'm developing an interactive full-screen application using qooxdoo Desktop. The application should deliver consistent user experience on multiple devices, from 1024x600 netbooks to modern 2560x1600 "retina" displays.
The application uses custom widget theme. The problem is, to provide consistent look'n'feel across multiple resolutions we have to adjust parameters like border radius (for buttons) and font size. Do I have to maintain individual themes for each major resolution, or is there more elegant way to do the same?
If you want to have a couple of predefined steps your theme should have, you can use states for that.
Patch qx.ui.core.Widget and add the desired states for every widget in the constructor
You can access these states in the appearance theme and react set the desired values based on the given state.

Why WPF renders differently on different versions of Windows?

I read that WPF uses DirectX under the hood to perform its rendering, that it doesn't rely on the dinosaurian libraries that WinForms uses to render controls.
So I made my Presentation layer with WPF and it looks the way it should under Win8.
Then I deployed the project to Windows Server 2003... to find out that my nice little custom message box looks awfully WinForms-like and somewhat clunky; the button controls are VERY similar to the WinForms ones, the expander control is no longer shown as a circled ^ arrow and looks like it was drawn in 1998 (picture the ^ arrow on an ugly square flat button that pops up when your mouse hovers over it).
From the Pro WPF in C# 2010 Bible:
Part of the promise of WPF is that you don't need to worry about the details and idiosyncrasies of specific hardware. WPF is intelligent enough to use hardware optimizations where possible, but it has a software fallback for everything. So if you run a WPF application on a computer with a legacy video card, the interface will still appear the way you designed it.
So, is this a lie? To me it is, because it doesn't appear the way I designed it.
If not, then why/how doesn't the thing render identically regardless of the machine that's running it? Is the software fallback somehow designed to mimick Win32/GDI rendering? Is there a way to get my little custom message box to look identical on Win8 and WinServer2K3?
That has NOTHING to do with DirectX / Rendering / video card / any of that.
and EVERYTHING to do with WPF taking the DEFAULT appearance of ALL UI Elements from the Windows Theme.
If you don't want this behavior, you'll have to provide Styles and Templates for ALL UI element types, or otherwise find a way to include PresentationFramework.Aero.dll in your application and use that as the default theme library.
Take a look at this answer

using resource dictionaries in expression blend to handle light/dark themes in WP7

I've got several instances in my app where I'm using a png icon from the standard wp7 icon library. I need to be able to alternate between light and dark versions of this png depending on the theme that the handset device is set to.
Now, I know how to detect the theme. However, how should I handle alternating between two versions of my images?
Do I create 2 different resource dictionaries and programatically switch between them in code? (honestly I have no clue how to do this)
Do I set some static resource "flag" somewhere based on what theme is detected?
I'm having some difficulty with my approach here, and would appreciate some guidance.
Here are some solutions:
Option 1)
You could use one image and OpacityMask so that your icons will remain consistent in both light/dark themes.
Option 2) You can take a look at this discussion:
LockedHow to change Metro icons based on selected theme
If you are using the standard wp7 icons for the appbar then you only need to add the icons from the dark theme -- the phone will automatically switch them to the light theme without any additional programming.
However, if you are using custom icons you will have to do something along the lines of what BMiloshevska said and use the OpacityMask.

Resources