Dialog Box like JOptionPane in Codenameone - codenameone

I am trying to add border like message box in windows using codenameone dialog box but I am not able to do it.
Can anyone give me some suggestion. This is what i tried. but its not
working properly.
final Dialog dialog = new Dialog("---MESSAGE---");
dialog.setLayout(new BoxLayout(BoxLayout.Y_AXIS));
dialog.getStyle().setMargin(2,250);
dialog.getStyle().setPadding(2,250);
dialog.show();

You need to use themeing http://www.codenameone.com/how-do-i---create-a-simple-theme.html
They go far beyond what's available in Swing's look and feel. The JOptionPane as it is was desktop specific and doesn't fit on mobile.

Related

How do you get ActionBar from SocialBoo theme to show up in your GUI?

Ok. Starting over with this. I see that the SocialBoo theme has something similar in what I want to achieve. If I find that I can work and improve. I Added a new socialboo theme and created blank GUI. Assumed it would be a Commandbehavior but that didnt do the trick, so did adding tabs. Seems like those components are not for that specific bar... However did notice another issue.
How do I get the social actionbar as displayed in the socialboo theme? (Screen shot). Assuming those images etc are part of the default theme, right.
Also, If I create a TouchCommand = bar, title or native. It displays fine in Gingerbread but not ICS. DO you know why is that? (screen shot)
Thanks, in advance.
Those images aren't a part of the theme, they are a part of the specific demo. If you add a Tabs component to the center of the border layout UI you will get thee tabs where the "icon" property will allow you to customize the unselected icon and you can customize the selected icon as well. You can see the full source/resource file of the social boo demo in the docs and demos zip in the download section.
Generally customizing commands is a bit complex because of platform specific constraints, when running on an Actual Android 4 device we use the native ActionBar by default to provide the experience Android users are used to. This is hard for us to simulate so you will only see this properly in the device build. I suggest not relying on commands, it seems that what you are trying to achieve is easily doable with tabs and its possible that's why you had difficulties in your other question.

Is it possible to make a Window as the SplashScreen for WPF Project

When I use the AddNewItem to add an splash screen to a project, It adds an image file to the project. But I want to know if it is possible to make a Window as the Splash Screen of a WPF project.
I tried to set the BuildAction property of a Window to SplashScreen but the project fails to compile.
The Andy Lang apparently explained to make the splash screen with this single steps.
Please refer
http://www.codeproject.com/Articles/38291/Implement-Splash-Screen-with-WPF
You need to create a normal window, put an image inside the window, and show and hide it at appropriate times. No such thing as 'Splash Screen' exists it .NET.

Scale up MessageBox

I've got zooming functionality in my application that works great, but when I open a MessageBox, the message box doesn't appear at the same zoomed level as the rest of the interface. Is there anyway I can scale the MessageBox along with the rest of my program? Or will I have to create a custom message box class that allows this?
Thanks. Let me know if I need to explain anything else.
You'll have to create a custom dialog to do this. I'd probably just create a window and then show it as a dialog.

Ensure WPF Taskbar Window Preview is actualized

How can I ensure that the hower preview of my WPF application (.net 4) is refreshed when the user places the mouse over the taskbar icon.
I have an app that visualizes some status values. If the app window is minimized and the user hovers over the taskbar button, the preview window that is shown shows the last view of the window at which the window was active. However I would like to have an actualized view.
Is there a possiblity to achieve that?
I believe you'd need to customize the preview, as described here (under the Customizing Preview section). Which leverages the Windows API Code Pack for Microsoft® .NET Framework.
An example can be found here, but looks like:
TabbedThumbnail preview = new TabbedThumbnail(parentForm.Handle, childForm.Handle);
TaskbarManager.Instance.TabbedThumbnail.AddThumbnailPreview(preview);
preview.TabbedThumbnailBitmapRequested += (o, e) =>
{
Bitmap bmp = new Bitmap(width, height);
// draw custom bitmap...
e.SetImage(bmp);
e.Handled = true;
};
Another example, can be found here which states:
The CustomWindowsManager class
provides an abstraction of a
customized window thumbnail preview
and live preview (peek), including the
facilities to receive a notification
when a preview bitmap is requested by
the Desktop Window Manager (DWM) and
to automatically grab the preview
bitmap of a window.
The download link for this code is here, which includes the CustomWindowsManager class. This appears to provide the live preview.
You probably can't. Windows 7 pipes the graphics of an open window to the live preview from the Taskbar. It can't know what the window now looks like while it is minimized because it isn't being drawn at all.
I guess it's not impossible to do custom thumbnails. Aside from CodeNaked's answer, I also found this article, which even includes multiple thumbnails from the same app.

Iphone Style checbox

I am developing a WPF application an need checkbox like we do inIphone interface.
I am able to get that done with help of this.
But I want user can silder the slider as they can do in Iphone. So they can either click or silder the slider to toggle the check box.
Thanks in advance
EDIT
Also found this link that enables to use WP7 togglebutton in WPF. But am unable to see any output.

Resources