How to achieve spacing between containers - codenameone

Please how can I achieve this kind of spacing between containers. I also notice the containers have some kind of Bevel raise. How can I achieve that too (from code).

This looks like a Tabs container which you can use to achieve that look. However you can do a custom version with a simple grid layout so something like this:
Container cnt = GridLayout.enclose(4, home, alarm, search, settings);
Will produce the grid effect where they take up the space. You might need to center align the buttons within that grid.
To me the line at the bottom seems like just a line in a solid color which you can achieve with the underline border on your style followed by a gray spacer.

Related

Applying Style Dynamically To MultiButton LineX Labels

I want to apply RoundBorder style to MultiButton Line2 label when horizontal layout is set to true but calling mb.setHorizontalLayout(true); but I can't because LineX labels are not accessible outside the MultiButton.
I know that I can create curved border using theme designer and applying the uiid to the label using any of the setUIIDLineX() method but I don't want to use it because it didn't give me what I want in some device pixel density.
Is there any other way to style MultiButton internal components(Labels) through code?
Again, why is it that LineX labels are not exposed like icon label?
Exposing the LineX labels will equally enable developers to set icons for the individual labels depending on what the developer want to accomplish.
Thanks.
No one asked for that so we didn't add such getters. You can file an RFE for that or submit a pull request which will probably be quicker.
Notice you can style the round border in the current version of the designer so you can use a the UIID's to set the round border too.

WPF Grid Lines show across childrent element with span > 1

Are there any way to make grid to not show over grid children?
I mean, I want grid lines to be visible, but when a children has rowspan or columnspan over 1, I want it to hide the grid lines.
I tried setting the children (it's a label) opacity to 1 but it didn't work.
Any help will be welcome.
No there is not. From MSDN:
Only dotted lines are available because this property is intended as a design tool to debug layout problems and is not intended for use in production quality code. If you want lines inside a Grid, style the elements within the Grid to have borders.

partial font styling in spanlabel

I want a spanlabel show text like
codename one
and code is blue and bold, name is red and bold. How do I achieve this?
That isn't supported by SpanLabel. You can either use a BrowserComponent and style the entries or use several different labels in a FlowLayout Container thus giving each of them the ability to be styled on its own.

Custom variantion wp7 slider

How would you guys go about creating a slider where the thumb stays centered, but the image or background of the slider slides with a slide gesture.
The only real example I could find is here, in the second screenshot:
http://www.windowsphone.com/en-US/apps/5ffe35e4-8e43-e011-854c-00237de2db9e
Basically the slider "thumb" would stay in place, but the numbers on the scale move with a finger swipe.
Just looking for some direction here on how you would approach this. What control would you recommend I start with? Or would it be easier to create a custom control?
I haven't tried it but a slider might be too hard because of the way it is constructed; the area/scale that you want to slide consists of two repeat buttons and those do not easily slide. So it might be best to NOT use the slider because the code of the Slider class expects these template parts to be present.
I'd try with plain, templated control. The thumb is pure decoration. I'd add the 'scale' in a scrollview without scrollbars.

Anchor in WinForms==Horizontal(+Vertical)Alignment in WPF?

Can't find anchor property in WPF, was it reconstructed to Horizontal and Vertical Alignments?
Is it the same?
I wanted to stretch my control in both sides (right and left), but it worked rather different than anchor
You can do something like Anchor like this
<...HorizontalAlignment='Stretch' VerticalAlignment='Stretch' Margin='50,50,50,50'.../>
The Anchor and Dock properties of Windows Forms are replaced by appropriate layouting containers in WPF. Depending on what exactly you need you should be able to create your desired layout in WPF with the Grid or DockPanel containers.
There are small white circles at the edges of the control. Click them, and they will be converted to triangles which mean the edge is anchored.

Resources