cxGrid expand row height to new line with enter - delphi

This is a little hard to explain so please bear with me. When I am editing a text field in one of the columns I would like to,when I hit enter, go to new line under the edited text so the grid basically expands.
Options-View-CellAutoHeight set to true expands the cell but editing is terrible.Cant
see a thing where the first line is,where it ends,etc...
Here is the grid:
I can not go after the last letter 'a' with my mouse cursor and hit enter so another line gets added. Which settings regulate this ? I know it can be done since I had a grid once and could do this.
EDIT: This requires no code just applied settings.

Just tested it with DevExpress VCL 13.2 and it can be easily done without coding (if I understood what you want to achieve).
Basically, you need to set following properties:
Assign a Memo to the Properties of your column and make sure its WantReturns property is set to true.
In your TableView set the OptionsView.CellAutoHeight property to true.
Also in your TableView, set the OptionsBehavior.EditAutoHeight to either eahEditor (editor is sized vertically to fit the content) or eahRow (the entire row is sized when editing) as needed.

Related

Display a value that may be copied but not modified (Swift)

I want to display a calculated result that can be copied to pasted elsewhere (e.g., another app), but that can not be edited/modified. I would also like to indicate if that result has more character than fit in the view.
Is it better to use a UILabel, UIButton, UITextField, or UITextView?
So far, the only one I've found to work is the UITextView by setting:
textView.isEditable = false
textView.isEditable.isUserInteractionEnabled = true
However, as an example, the view initially appears like this:
, which seems to indicate that the result is 8,872,750 - there is no indication that there may be more digits.
In fact, the actual result is 8,872,750,000,000,000,000,000.
If I double-click on the textview, I get:
and can copy the contents.
Clicking elsewhere then back in the textview, I get:
. While I can scroll by dragging the cursor up or down, I can not if using up or down arrows.
On the other hand, a UITextField shows like this: . The contents may be copied - but they may also be modified or deleted.
How do I display a result that may be copied, may not be modified, and gives some indication if the value extends beyond the view?
I suggest using a UITextView with isSelectable set to true and isEditable set to false.
A text view can be set up to add a scroll bar if desired.

Angular UI-grid, how to tell what the next column in the scroll is

I have a ui grid that has 20 columns, and I would like to be able to tell what the next column will be as I scroll through the horizontal axis so that I can have some text that will tell the users what the names of all the columns they can't see are.
Anyone know if this is possible? As I watch the the inspector and scroll through the columns, I see html attributes changing.
---UPDATE 1----
This is what is all looks like (where it says "home #" is dynamic and will change to show the next column that is out of site)
Based on the ui-grid configuration that you use to render the grid, you already know the order of the columns. You can use this information together with the visible on each column added by the gird itself.
What you need to do is bind a event handler on scroll to iterate over the columns on each change and check the visibility of them. Then the first one with visible === false is the upcoming.
Here is a working Plunker where is used this flag.

iOS - How can I hide text inputs without leaving gaps?

I am creating a form in my iOS app in which certain text fields need to be hidden depending on the number that was entered in the previous field. For example if 1 is entered there will be one field, if 4 is entered there will be four fields etc. all the way up to 25. I understand how to hide the buttons depending on number...the problem is when I hide the buttons they still leave the white space because all the fields are set up to position at x and y height. I have tried to put the inputs into a table view because I thought it would allow me to hide each table view cell containing the input and then move the rest up. But XCode gives me an error saying I can't connect IBOutlet to repeating content. Positioning the x and y height in the code won't work either because I need to do this a few times and there would be too many variables.
I have looked for a solution everywhere and haven't been able to find a solution. Does any one know how to hide text fields and make everything else below move up?
You could use autolayout by anchor each textfield to the one above.
Or you could give a tag to each textfield and then iterate with a cycle for till the index of your previous view to setHidden:false to the textfields

Positioning of custom list box item components in Delphi XE5, Firemonkey

I've customised the style of a Firmeonkey list box item in such a way that now it can consist of 4 TLables in it. Each of the lable has Alignment as alNone.
I'm setting position of each of them in my code whenever i need to add any item. I've observed that when my list has scroll bar and if first component is not visible (i.e. i've scrolled down enough) at that time if i re-add all the items again in list box, then the position of TLabels in first items (or items which are not shown) get distorted.
For setting positions I am using below code :
(tmpListBoxItem.FindStyleResource('txtCol2') As TLabel).Position.X :=
(tmpListBoxItem.FindStyleResource('txtCol2') As TLabel).Position.X + (tmpListBoxItem.FindStyleResource('txtCol2') As TLabel).Width;
Any suggesstions, how can i overcome this issue.
Regards,
Padam Jain
Firemonkey styles are repeatedly 'applied' and 'freed' as components appear and disappear from screen.
It is not enough to simply set properties of style objects once and expect those values to be remembered. What you need to do is either listen to the OnApplyStyleLookup event or override the ApplyStyle method of a custom component and use the same you have above to set the properties again.
This means you'll need somewhere to store the values you are going to set.
I would suggest for your situation that you subclass TListBoxItem so you can add suitable properties or fields and put your code in ApplyStyle.

Delphi 7 - cxDBGrid Column : How to display a check mark next to some character string

I have to display in a cxdbGrid column 'Test √', and I got the check mark by using a symbol font but the rest of the characters changed.
I don't have an answer if you do actually need to have the check as part of actual text in the text column. I don't think I've ever seen an app that did it that way though. The usual way of doing this is to add a column to the left or right of the text column in question and have the new column use a checkbox control. Then just set the value of the checkbox column to true or false.
It's quite common to include some type of image to represent the state of a column in a grid control. You could implement your own OnCustomDrawCellEvent to put an icon image there, instead of text and a font. Below is a link to a tutorial of how to accomplish this.
How to draw an icon along with the text in a grid cell

Resources