How to get text size or resize the widget according to the text size? - unreal-engine4

I am creating widgets in runtime and then change texts in them by using setText. The problem is the Size Box which contains the text doesn't update as "Size to Content" after i changed the text. is it possible to update this so it can resize according to the text?
I tried to get string size with getTextSize blueprint node, but it only works at drawHud event and hard to use outside of HUD blueprint (which i believe is almost obsolute after UMG?)
Any solution in blueprint or C++ is appreciated.

Related

Why does the same exact material-ui text field's height shrink in one spot and not another?

I am using the Material UI Text Field component as a search bar in my app. On one of the pages, I have it in 2 spots, one on the outside of the page, and another inside my DevExtreme Data Grid.
See here
For whatever reason, this shrinks the search bar, despite it being the exact same component being used in 2 spots.
My question is, what causes MUI to shrink the height of their text input field so that I can fix it accordingly inside of my data grid?
I've tried adjusting line-height, padding, margin's, etc all inside the data grid, unfortunately to no avail. The only thing I've noticed is that deep in the inspector tool, the shrunken search bar has a height of 1.435em, and checking that off will cause the search bar to correct itself to the standard height.

Dynamically Resize Controlled TinyMCE React Component

Background: we have TinyMCE React inside a few contexts where the parent element is manually resized by the user (resizable modal dialog, etc.) and we want the TinyMCE component to resize appropriately. In older versions, we did this using the resizeTo functionality documented here. However, that no longer seems to be available after the upgrade.
My previous attempt to resolve this involved using a key based on concatenating the width and height of the editor with a debounce while it was resizing. Basically, whenever the size changed by enough, I tore down the old component and rendered a new one whose config options included the new size. While this is largely effective, it causes an issue where, when you attempt to edit the field after resizing, it flickers and loses focus initially.
Unfortunately, we are using pixel-based size calculations, so specifying the height in percentages instead of pixels won't work.
What is the new official way to do this? Ideally, there would be some new version of editor.theme.resizeTo that we could use instead and dispatch with the key-based solution entirely, but I was unable to find it in any of the documentation.
Just wrap the editor in a div which has the calculated height and width, and then set the editor to height and width of 100%.

How to set a fixed part sash container data value

I am trying to make different UI layouts for my e4 RCP application depending on the resolution. I am trying to set a fixed container data value for my parts but have no idea how to do this. Basically in the layout below I have a partstash container with a part and another partstash with two parts. I want the partstashes to be a fixed size and not resizeable. How do i achieve this? Alternatively is there a way to ensure that the content within a stash container will auto resize and always fit?
Add the tag NoMove to the 'Part Sash Container' containing the parts that should not be resizable.
So here:
Setting the NoMove tag prevents the child part stacks and sash container from being resized

How can I create a fixed size Gtk.TextView in Gtk+3?

I have a Gtk.TextView inside a Gtk.Fixed and I set it its width and height and wrap mode.
My problem is that I need to avoid the TextView expanding when the user inserts more text than what fits in the set size. In that case I just need to prevent the user from keeping writing.
Any help?
If you have a single line entry as input better use textentry instead of textview.
For text entry your can set the maximum length of textentry.
For development of UI using glade.
Moreover if your UI changes depending on configuration file from server,
there is a solution for this also, have all the widgets in the window, show/hide the widgets depending on the config file from server.
why dont you use GLADE for UI development ?.
It provides more handy ways to achieve your task.
In glade you have all the options to set, you can cross verify and check in real time.

How to set initial size of a TreeViewer?

I'm using a TreeViewer within a jface WizardPage and the initial input into the tree causes the WizardPage to grow vertically so that it can show all of the tree's values. When expanding one of the tree's values, then the vertical scrollbar works as expected. I'd like to be able to set the tree's size initially so that it is fixed and the scrollbar is already shown when the WizardPage is first drawn, but doing this isn't particularly obvious to me - the setSize method on the TreeViewer's Tree doesn't seem to do anything.
Any help would be appreciated!
Just for the records for this old question:
We solve this problem in our applications by using an own layout manager which we can set fixed sizes for certain controls (with Swing we had done that by using component.setPreferredSize(size)). If no such fixed size is used, we calculate the preferred size of the control while performing the layout. This prevents making controls getting more and more space depending on the control's content when the user resizes the application window or dialog.