Delphi VirtualStringTree - Indenting Problem - delphi

Hey S.O! I realized my child nodes are not being indented - they are on the same level as the root nodes. Here's a screenshot:
As you see, the childnodes are on the first level's Indent. FixedIndent is OFF, so thats not whats causing it..
Any suggestions?
Thanks!

It looks like the check boxes are indented slightly. Keep in mind that the control only indents one column. All other columns are treated like ordinary table columns. Set the Header.MainColumn property to 1 if you want the "Full Name" column to be the one showing indented items. Then set the Indent property.
You can also handle the OnBeforeCellPaint event. Adjust the dimensions of the ContentRect parameter.

Related

how can i combine cells in fastreport?

i have a table. to print like this
https://up.djelfa.info/uploads/155762484493151.png
I want to make the observation take the whole table means it remains empty. The empty box takes all the table.
https://up.djelfa.info/uploads/155762492124361.png
im working with fastreport 5 vcl
master data
https://up.djelfa.info/uploads/155762509600791.png
Per your last link, it appears that you have hard-drawn the cell lines in your master data row. This means they will print for each row. There are, however, multiple ways to get around this:
Make the upper and lower lines for your Observation column separate objects (e.g. LineObsTop and LineObsBottom). Then, in the MasterData Band's OnBeforePrint, adjust the visibility of these based on the values of the column
Don't hard-code cell lines! Instead, make sure the cell fields all align perfectly and use the fields' Frame properties. Then use the Observation field's OnBeforePrint to adjust the frame based on value.
Similar to #2, but use conditional formatting for the cell, adjusting the frame.

Statsoc style package giving table positioning problems

I am formating a paper in statsoc style. I inserted a table. But it moves to the top of the page even though it should be placed in the middle of the page after some text.
I tried using float package with table options [H],[H!], [h]. But that results in printing [H] (or whatever the option i type) before caption like this:
[H] Table 1: table_caption
Please help. Really appreciate it.
Within the statsoc.cls, you need to change def\fps#table{tbp} to \def\fps#table{htbp}.

TcxGrid column is hidden when dragging to group row

I have two seemingly identical TcxGrids bound to two different tables. On one grid, when the column header is dragged and dropped to the group panel, a large X appears above the column being dragged, when it is dropped the column is immediately hidden. On the other grid a big circle with a line through it shows and it cannot be dropped on to the group panel. The Options.Grouping for both columns is false. Why the difference in the two behaviors ? I cannot see a property setting difference but I'm sure there must be one somewhere that causes this behavior. What property is it ?
John
Inspect the properties of the column which won't group in the Object Inspector. Probably, you'll find that its DisableGrouping property is set to True. If it is, set it to False. If that doesn't work, a) I'll take this answer down and b) edit your q to add the contents of your DFM.
There are two places in DX grid that control the ability to group columns. First is at the grid level and it takes precedent over the columns' individual Options.Grouping settings. Second is at the column level. Look at .OptionCustomize.ColumnGrouping. It may be set to False.

Add gui components from bottom up instead of top down

Is it possible to add gui components to blackberry screen beginning from the bottom instead of the top ?
Thanks
A quick response would be no but let me explain why and suggest afew work arounds;
Screens don't actually handle the laying out of fields onto themselves, to do this they delcare a delegate manager which can be any type of manager, vertical, horizontal etc. The problem is all managers begin painting themselves from the top left. For a manager to paint fields starting from the bottom it would have to know exaclty where the bottom is located and add components up rather than down which goes against all the low level code inside the manager class. You can read more on managers in the BlackBerry API documentation.
You could still achieve an effect similar to this though by tweaking how you add fields and playing with field styles. For example consider this code:
add(new LabelField("field 1"));
add(new LabelField("field 2"));
This would give us the results;
field 1
field 2
because field 1 is drawn then field 2 below it. However if we were always to insert fields at the begining of our manager e.g. position 0 like so:
insert(new LabelField("field 1", FIELD_BOTTOM), 0);
insert(new LabelField("field 2", FIELD_BOTTOM), 0);
We would get the results;
field 2
field 1
Which is the results you'd expect from a screen described in your question.
I'm not really sure how you'd get the fields to paint to the bottom of a screen though, you could try researching the "position relative bottom" styles but I'm honestly unsure.
You are probably using a VerticalFieldManager, and the documentation on that says:
A vertical field manager lays out
fields top to bottom in a single
column.
So if you
manager.add(field1);
manager.add(field2);
manager.add(field3);
The order of the fields on the screen will be just that.
But you could do something like this:
Vector v = new Vector();
v.add(field1);
v.add(field2);
v.add(field3);
for(int i=v.size()-1;i>=0;i--) {
manager.add((Field)v.elementAt(i));
}
Sort of. You can use the Manager#insert(Field, int) method and always insert at the zero index. If you do this with a VerticalFieldManager, it would simulate a bottom-up adding of Fields to the Manager.
Some of the answers so far are to use Manager.insert(Field, int), and keep inserting at position 0. This will work, but the running time of the insert is linear in the number of elements already added to the manager. Meaning this solution will have an overall quadratic running time. Not a big deal if you're adding under 10 fields, but if you're planning on adding more than that, the insert overhead will be substantial.
If you can do the inserts top to bottom, by reordering the fields as Muger's solution suggests, the running time will be much improved.
Finally, you can write your own BottomUpVerticalFieldManager that does the layout the way you want. When you write your own manager, you can layout the fields in whatever way pleases you. In this case, it would be bottom to top. Writing your own manager may seem daunting, but it will give you considerable freedom in the future when trying to solve layout issues.

How to do word wrap in a DevExpress TcxGrid?

I've got a long line of text that would be a lot easier to view if it would just word wrap around multiple lines, but I can't seem to find the option for it. Does anyone know how to enable word-wrap functionality?
Set the OptionsView.CellAutoHeight of the view you're working on?
From the help: "If the widths of the View’s columns are insufficient to display their entire content, then text clipping occurs. Use the CellAutoHeight property to prevent this. If this property value is True, then the cell content is displayed in multiple lines where necessary."

Resources