How to use Ant Design custom scrollbar outside of select? - antd

Antd uses custom scroll bar in selects. Is there any way to replace default Windows scrollbar with it in other Ant scrollable lists and tables?

Related

Alignment of Vaadin custom fields

I'm trying to create a delete button that fits nicely into a Vaadin form (and maybe in the future even more custom fields). I can't seem to get the alignment correctly. How should this be done properly?
See click me button in:
https://vaadin-example-cknsvo.stackblitz.io
https://stackblitz.com/edit/vaadin-example-cknsvo?file=views/engatta-app.ts
If you wrap those elements with a flexbox, such as a vaadin-horizontal-layout or just a div with display:flex they will align vertically.

Right align ComponentRenderer in a Vaadin TreeGrid

It is possible to align text content in a Vaadin TreeGrid column using setTextAlign(ColumnTextAlign.END), however this does not work if the column is using a ComponentRenderer, in my case it is rendering a MenuBar component.
Does anyone know if it is possible to right align a ComponentRenderer without resorting to a template or wrapping it in a HorizontalLayout?

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

How do I group iOS ui controls into a panel?

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

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