Is it possible to manipulate the layout in react and save it? - reactjs

I want to make a layout with a flexible partitioning in ReactJS.
Elements should change their size by dragging (or equal operation).
When working with fat clients (desktop applications), it is possible to manipulate the layout of the application. E.g. is adjusting the size of a section by pushing the the left mouse button at the border of the section and keep it hold. Moving to the left or right direction will shrink or increase the size of the section. Another handy example is the cell in Excel. You can define it's size by manipulating the row or column size (thus affecting the positioning on any following columns/size).
Is this possible (in ReactJS)?
Is this a ReactJS problem? (or simply affects only CSS or any other technology?)
Let's say you adjusted
the size elements for yourself. Is it possible to save the
customization, so that I as user don't have to adjust it again?

As I found out, it isn't a specific reactjs problem. It's about JS in general.
If you want to store a customized layout with its values, you should use
https://developer.mozilla.org/de/docs/Web/API/Window/localStorage

Related

Codename one SpanLabel text does not occupying full width

I'm using the SpanLabel Component, but on the screen the text content does not occupying the full width when text size is lower
Someone can help please?
This can happen if the width isn't deterministic. The SpanLabel won't be able to reflow and at best will cause only its own Container to resize. There are two solutions:
Deterministic hierarchy - this is generally best but not always possible
Use TextArea - sometimes this works around the issue by reducing the hierarchy depth.
Deterministic layout means that the size of the elements is determined in a clear way by the hierarchy. E.g. BoxLayout.Y is deterministic on the X axis as it gives the components on the X axis all available space. FlowLayout isn't deterministic as it gives components their preferred size.
Some layouts can go back and forth and vary in determinism based on their axis.
This is important because when we layout the components we go from top down. So we go through the Form to its children asking each for their preferred size. If at this point the SpanLabel doesn't know its size it can give the wrong value and we can't really fix that later as we don't reflow the UI. Reflow would create a potential infinite loop and a performance problem at best.
We try to workaround some of this behavior by making a revalidate() call within TextArea but that has its limits. If the hierarchy is too deep the preferred size is already set and won't adapt. SpanLabel is just a Container with a TextArea and a Label (for the icon). So by only using a TextArea you'd slightly simplify the hierarchy and it sometimes might be enough. E.g.
TextArea t = new TextArea(myText);
t.setEditable(false);
t.setFocusable(false);
t.setUIID("Label");

Setting minimum size for component in codenameone

Is there a way to set the minimum size of a component instead of just the preferred size?
I am currently setting the preferred size by overriding the calcPreferredSize method on the component, but the layout shrinks it to an unknown minimum regardless of the preferred size during certain scenarios.
I am using code, not the UI builder.
No, we don't have a way to do that.
We didn't copy the minimum/maximum concepts from AWT/Swing since those never made sense there either and were used in different ways by the layouts. If a component is in a situation where it can't fit we have a problem regardless of the minimum value. You need to place it in a scrollable Y container or give it more space.
Preferred size is a hint the eventual determination of size is done by the layout manager logic.
If you have a specific example of something that misbehaves in terms of layout I'd be happy to help with that.

Why are panelGridLayouts overlapping?

I am building a form which contains two forms adjacent to each other. Hence I used PanelGridLayout and placed two panelFormLayout in each 50% width gridCell of first gridRow of a PanelGridLayout. This works perfect with respect to alignment but in a smaller resolution both the gridcell's are overlapping and the fields of left form are overlapping with the labels of the right form.
How can I resolve this issue?
Any ideas on which layouts I can use?
What would you expect it to do in such a case where there is basically not enough space to show the fields in one of the sides?
ADF won't automatically shrink or eliminate fields in such a case.
Acc to the Geometry Management of <af:gridCell>
Beware that if you attempt to use width="auto", halign="center", halign="end" in conjunction with cell content that uses unstable, percentage-based widths, you may experience different results in different browsers. If you wish to use these settings, be sure to constraint the width of that cell content.
Possible Workaround
instead of halign="end" change it to halign="stretch"
source : https://docs.oracle.com/cd/E35521_01/apirefs.111230/e17491/tagdoc/af_gridCell.html

iOS 6 AutoLayout Scale and Translate Animation

My aim is to have 3 images shrink, grow, and move along a horizontal axis depending on selection. Using Auto Layout seems to make the images jump about as they try to fulfil the Top space to superview / Bottom space to superview constraints.
So to combat this I have put all the images inside their own UIView. The UIView is set to the maximum size the images can grow to, it is centred on the horizontal axis. So now all the images must do is stay centred inside their corresponding UIView. This has fixed my problem as the UIViews perform the horizontal translation, while the images shrink/grow inside while remaining centred. My question is - is this the correct way to do this? It seems very long and like I am perhaps misusing the ability of Auto Layout. I have to perform similar tasks with more images and so any advice is welcome! Thanks.
I've just written a little essay on this topic here:
How do I adjust the anchor point of a CALayer, when Auto Layout is being used?
Basically autolayout does not play at all well with any kind of view transform. The easiest solution is to take your view out of autolayout's control altogether, but alternatively you can give it only constraints that won't fight back against the particular kind of transform you intend to apply. That second solution sounds like just the sort of thing you're doing.

Increasing the size of a WPF application

I've just created my first WPF application (3 calculators inside 3 different tabs).
The entire application has been built using widths/margins/paddings as static values, since I originally didn't know that dynamic values can be used by just putting an asterix after the value.
The client has come back to me though and has asked me to increase the size of the app, that includes form fields, tabs, font-sizes, grids etc...
What would be the easiest (and/or quickest) way to do this? I'd hate to go value by value resizing every single element since there are quite a few.
I can provide code but there is lots of it and I'm not sure of how much help it would be.
Appreciate your help,
Marko
Put it all in one ViewBox, play with viewbox size to change the app size
Write an XSLT transform to take your XAML as input and spit out appropriate modified XAML, which you put back in your app.

Resources