Textfield Spacing with "Stretch on Overflow" buggy? - jasper-reports

I am currently designing a report using iReport 4.7.0. At the moment I am trying to figure out how to dynamically adjust the height of a textField, if its contents is too big for the initial height. It seems, that the option Stretch on overflow achieves this. But I am having problems with that.
If a textField is not stretched, the spacing before and after the text is good, because its achieved by setting the textField height higher than the font size. But if the textField gets dynamically bigger because the containing text is to long to display with the initial height, the lines seem awfully packed, there is no spacing whatsoever.
I tried so resolve this by setting Spacing before and Spacing after for the specific textField but this seems to end in JasperReports thinking, that the textField doesn't need to re-size at all, even if the text is not fitting.
Is it possible, that the size created by the Spacing before and Spacing after option is taken into account on calculating, if a textField needs to be resized on overflow? Or am I doing something wrong here?

Use padding:
Right-click an element
Select Padding and Borders
-or-
Right-click an element
Select Show Properties
Click the Borders tab
Set padding values as required
This should provide a constant spacing even if box resizes. For complex layouts, experiment with float position of elements, as described here.

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.

NSTableView: second Column appears when it shouldn't

I have an NSTableView with only one column. When I change the Windows size, the TableView sticks to the Windows borders, as it should:
ScreenShot Small
However, when I expand the windows frame to much (for example, when using full screen) suddenly a second column appears:
ScreenShot FullScreen
I have no idea, why this is happening. I can't expand the first cell manually using this little resize indicator, it seems like the cell inside the tableview just wouldn't be able to grow more...
Here is a picture of the TableViews Attributes Inspector:
ScreenShot AttributeInspector
I didn't find any constraints or width settings that would explain this.
I would be really greatful for any kind of help.
Try changing the column sizing of tableView to Uniform in attributes inspector.
Also in your size inspector, check and adjust maximum width for the column depending on your window max allowable width.

CodeMirror: auto-resize horizontally, without scrollbar

I need a CodeMirror editor which starts with a certain width and then grows automatically to the right to match the maximum line length. I.e. roughly what CodeMirror does when height is set to auto, but with width.
Here's a self-contained example. The editor grows automatically along the y-axis fine, but not along the x-axis. By tweaking the CSS, I can either have a fixed width editor with a scrollbar, or one which fills the entire width of the browser, but not one which grows as you type. I assume overflow-x is relevant, but I don't understand how it interacts with other CSS size properties set on parent elements. I also tried setting that property on CodeMirror-scroll, but it didn't help.
I believe this can be done using CSS properties alone. In fact I have this behaviour in my application already, but growing to the left, rather than the right, but I don't understand why it happens, or how to reproduce it in a small example.
This question is essentially the same, but for the vertical scrollbar.
Simply add float:left to the CodeMirror div.
<div id="here" style="float:left"></div>
This is not something CodeMirror supports. You may be able to get something working by setting .CodeMirror's width to (-webkit-)fit-content, but there will likely be corner cases where this breaks the scrollbars or cursor placement.

how to get the rendered width of internationalized button text in GWT?

While testing our app with a new set of translations, I found that the translated text for some of the buttons are significantly wider than the english. The result is that the button text wraps to a 2nd line, which is either cut off by the button, or floating below on a 2nd line. It seems like I need to get the rendered width of the text in order to dynamically resize the buttons, assuming there's space in the layout for a wider button.
Is there a way to get the width of the rendered text of a button?
Unless you are using a monospace font for the buttons (why not do so, actually?), and render it using CSS en / em / ex units, you cant really predict the text width, only make an educated guess.

Variable height UILabel

I'm working on a iPhone product page where some of the fields can be fairly long (product name etc.) I've created the page layout in IB, and use UILabels to show the text fields. For those long text labels I'd like the height of the label to scale and push the other labels further down. Is this possible using IB, or would I have to do everything in code? (Compute height and position of all the UILabels.)
I'm presently able to get the text in the labels to wrap and fill the available space, but I have to reserve space for this. When the label is only one line it leaves lots of unused space before the next label.
You will have to calculate the heights dynamically in code. I'm not sure what you're doing exactly, but you may want to start using a UITableView and return variable height cells. I wrote a blog post on how to do this at Cocoa Is My Girlfriend.
It did some searching for this same thing and as far as I can tell you have to manually resize and position the labels.
If you want to know how to dynamically resize a label, this is how I am doing it:
myLabel.frame = CGRectMake(227.0, 12.0, 22.0, 21.0);
I am happy to be wrong on this one, since I don't like having to do this either.