SWT resize dynamically scroll of composite - scroll

I have created a composite which has three children - Composite 1, 2 and 3. The children try to recreate the functionality of expand items in an expandbar. I want to make my parent composite scrollable vertically, so that all children are visible when expanded. I also want the size of the scroll to be changed dynamically as the composite gets bigger because it is possible to expand only one item, or two, or all three of them (see pictures for demonstration). How can I achieve that? Thanks in advance.

Related

Xamarin.UITest: Retrieving elements hidden from screen

I want to write a UI test for my Xamarin.iOS app to make sure that all tableview elements/cells exist on a screen. I could use app.Query(e => e.All()), but this will only retrieve elements that are currently visible on the screen. Is there a way to retrieve all elements (including the ones hidden from the view) in order to assert that the retrieved elements are as expected, without initiating a scroll action?
Any suggestions are greatly appreciated.
There isn't a way to do it directly, but there are methods to scroll list views down to get more items, but the original ones will then be removed from the visual tree.
Table views use cell recycling, so they only creates enough cells to fill the screen. As you scroll cells that are scrolled off the top are 'recycled' and shown on the bottom with new data. This means that the cells of screen actually don't exist - so there is nothing that UI test can access.
I've done it in the past by getting the items and caching some values, scrolling, getting more items, scrolling etc, building up a list of items as I go. Then once there is no more to scroll, checking the values.

Swap children's depth

I am using canvas and createjs. I have a container that has an eventListener attached to it so that any child in that container can be selected. When a child is selected I can drag it around on the stage but it is relative to its index so it is above some children and below others. I would like to move the above child to the top index. In flash I was able to swap the depth of that child and I was wondering if there is something similar in Javascript?
Thx.
All you gotta do is:
yourContainer.addChild(selectedChild);
this will pull your object to the top of your display list.

Layout horizontally and multiple lines

I'd like to layout a bunch of child Views horizontally. If children fill a row, they should allocate more space and continue the render process in the next row. This process should continue, as long as children are left to get rendered.
May I use this using Xamarin.Forms views?
There are no wrapping layouts currently in Xamarin.Forms, but you can achieve this quid easily with a RelativeLayout, as it allows to have constraint for childs relative to its parent.

VB / C#: Resizing two controls equally

I have made a window in which I will be having two groups/panels and some buttons in between them. I want to code the resizing behavior in a way that when the window expands, the two panels increase their widths while keeping the distance between them constant.
Please see this mockup:
As you see above, I want the 'Local' and 'Server' Panels to resize while keeping the distance in between them same. If I use anchors (Top+Left+Right+Bottom), the left panel will overlap the right one and the right's width one will go out of the window. I want them to share the increased width of the window equally.
As for the buttons in between, I have kept ancors as Top only. By removing Left anchor from button, it automatically places itself in the center of the window when window is expanded, which is just the way I want it to be.
Any ideas how to manage resizing of panels?
Thanks.
Use the TableLayoutPanel control.
First add the TableLayout to the Form and set its Dock() property to Fill.
Next you'll need to setup 3 columns and two rows. Add the two buttons to the middle column with each one is in its own row. Afterwards, setup the column values so they are like this:
Leave the rows at 50% on both.
Now add your two GroupBoxes to the 1st and 3rd columns in the 1st row.
For both GroupBoxes, set Dock() to Fill, and RowSpan() to 2.
For the top Button, turn on only the Bottom Anchor.
For the bottom Button, turn only the Top Anchor.
For the TableLayoutPanel, set Padding() to 5,5,5,5.
Here is what it looked like when I was all done:
Resize the window and observe how the controls behave...

Xcode: how to re-arrange elements not auto-moved to the center?

When I try to re-arrange the elements in Xcode 4.2 interface builder (put something as a subview of another etc.) it places elements in the center, not preserving it's current position.
Is it possible to re-arrange the elements in Interface Builder with preserving their position in main UIView?
It's not entirely possible to rearrange elements in the way you want. The best you can do is to select one or more elements and choose Editor > Embed In > View. That will put the selected elements in a new UIView without changing the on-screen position of the elements. But the new UIView will not tightly wrap the embedded elements.

Resources