How do I group iOS ui controls into a panel? - ios

In Windows I can put several controls into a panel/container such as a Grid, StackPanel, or WrapPanel. In Android I put the controls into a RelativeLayout, LinearLayout, etc. Then I can hide the panel or disable the panel and all the controls within are hidden or disabled. Changing child controls can be laid out relative to the panel and so changes to the panel position actually move the child controls.
I am having a difficult time figuring out what the similary concept would be for iOS.

Since iOS 9 is available UIStackView (documented here: https://developer.apple.com/reference/uikit/uistackview). I really recommend for your purpose. For grid layout you can make UIStackView full of other UIStackViews.
Also UIStackView handle rotations and can easily handle animations: https://medium.com/#nrewik/easy-animation-with-uistackview-8878b2856ae2#.l9g3me214

Related

How do I move a control in Vaadin designer without changing which component it is a child of?

I am trying to use the latest Vaadin Designer (v8) to layout a bunch of controls in an absolute layout. I also have a horizontal layout that is on the same layout.
My problem is I just want to move a label to an absolute x,y position within absolute layout. I know I can achieve this by hand or by nudging the label to the x,y I want with the arrow keys. When I try to drag it onto the layout however this happens.
Perhaps there is no way to do this. I was thinking there should be a feature like holding down alt-key while dragging keeps the control within its current layout?
You are completely right. You can achieve it by using arrow key or Position property (if you are in an AbsoluteLayout) but currently, there is no way to do that by dragging the components.
Whenever you drag some components over a layout, it will be always hooked into that layout.
Your suggestion about using ALT-key to avoid this problem is very nice. The team would very much appreciate if you can fill in an issue (https://github.com/vaadin/designer/issues/new) as a feature request/improvement which we can consider later on.

Vaadin 8 Drag & Drop - how to switch items in vertical layout?

I need to accomplish very simple drag and drop of panels in vertical layout.
each panel is set as DragSourceExtension
vertical layout is set as DropTargetExtension
Now when I have a several panels in vertical layout and I drag panel above another one and drop it my dropListener runs and here I'm not sure how to manage what I require. I simply need panel to move on proper place based on mouse pointer. Can anyone share some code how to accomplish this using Vaadin 8.2 ? Should I switch panels manualy? If so how can I detect the place mouse points to in the vertical layout?
dropTarget.addDropListener(event -> {
Optional<AbstractComponent> dragSource = event.getDragSourceComponent();
if (dragSource.isPresent() ) {
# I can remove dragged panel from layout using this code
fieldsLayout.removeComponent(dragSource.get());
## how to place dragged panel into proper place ??
}
});
Not sure if it's overkill, but in Vaadin 7 we always used the DragDropLayouts addon to simplify code.
We also used it in Vaadin 8 projects recently and it just works ;)
https://vaadin.com/directory/component/dragdroplayouts

Main Menu Button Grid iOS

There are plenty of good grid-of-button controls out there (such as GMGridView) and tutorials around UICollectionView (here).
However, they all seem to focus on imitating the look and feel of the Springboard of Photos app.
I'm looking for something that is more like the main menu you might see in a game. Where if I had one button, I want it to fill my view and be centered. Two buttons I would expect to share the space. Five buttons would have either a button on top (or below) a box of four buttons centered.
Is this sort of dynamic sizing of buttons to fill its parent container and centered of controls into columns easily accomplished with UICollectionView or would it be better to head down the path of something custom where I have a fixed layout support for, say, 1 - 5 button configurations.

Can TSizeGrip be used to move and resize components at runtime (within FireMonkey)?

FireMonkey's predecessor advertised that it could be used to create CAD and GIS programs. I've been exploring FireMonkey and thinking about how to create a simple CAD program. A basic function is to move shapes around on the screen using the mouse. FireMonkey includes a TSizeGrip component, which I suspect may be applicable to moving shapes and providing nodes at corners and edges of a shape for a user to click on. However, the documentation for TSizeGrip hasn't been completed.
Can TSizeGrip be used to allow end-user movement of FireMonkey shapes? If so, how?
No.
TSizeGrip is provided specifically to act as a "grab handle" for resizing a form, not arbitrary FireMonkey controls or containers.
You can see this quite easily by creating a new FireMonkey HD application. Drop a TPanel on the form and then drop a TSizeGrip onto that panel.
Run the application and you will find that when you mouse over and click on the size grip and drag, the form is resized, not the panel. A size grip control would normally be anchored to the lower right of a form.
If you are wondering why you need a control with such apparently limited use when resizable forms can just be resized using their border, the answer is that it can sometimes be useful to have a form be resizable without having the full draggable border style. e.g. modal dialog boxes.
No - with one exception.
If you create a new component in which you use TPanel and TSizeGrip – TSizeGrip will control TPanel's size, not TForm's size.
If you put TPanel and TSizeGrip on a Form
the TSizeGrip controls the size of the form and NOT the panel
I've just tried it

Delphi - How to set vertical scrollbar in TStringGrid, always visible

I'm using Delphi 2007 for Win32 and need to set the vertical scrollbar in TstringGrid to always be visible. How do you do that?
You can hide scrollbars with the Scrollbar property set to either ssNone, ssHorizontal, ssVertical, even when the number of rows and / or columns would normally make them appear.
You can however not force one or both scrollbars to be always visible but disabled, without creating a new descendent class and overriding methods. Unfortunately the standard grid controls have not evolved much since the days of Delphi 1, so your best bet is using some third party grid control instead. Preferably one that does also show proper proportional scroll thumbs.
There is a scrollbar property that can be set to ssNone, ssHorizontal, ssVertical or ssBoth.

Resources