Control won't span 2 rows in FireMonkey GridPanelLayout - firemonkey

I'm working in Rad Studio C++ (Tokyo 10.2.3). I have a FM form with a TGridPanelLayout control on it with 2 rows & 2 cols. I have two listboxes and a memo field that I want arranged like this:
Under the GridPanelLayout's ControlCollection I have col 0 set with RowSpan 2.
It works perfectly in Windows and ListBox1 fills up entire left half of the Grid. In IOS on iPhone ListBox1 only fills up top left cell.
What is the trick to making this function correctly on IOS like it does in Win32? I tested it on Android and it works correctly so this is just an IOS related bug.
I saw this related post (Why won't controls span multiple columns or rows in an Android FireMonkey app? about similar issue on Android) but I can't figure out how to solve my case.

Ok, it looks like the bugs referenced above are still in play. To solve this I put a 2 column 1 row GridPanelLayout control down. In the left column I put my ListBox1 and set it to align to Client. In the right column I put another GridPanelLayout control and set it to have 1 column and 2 rows. In it's top row I put ListBox2 and in bottom row Memo1 - setting both to align to Client.
The only confusion in this approach was that Rad Studio as insisting on the second GridPanelLayout go into the leftmost column. I finally figured out to click on that columns control item and then click the "Control" pulldown and set it to ListBox1. Do the same for the other one so it's Control will be the second GridPanelLayout.

Related

How to identify WinEdit and WinComboBox objects embedded in a WinListView control in UFT?

I'm automating tests for a desktop application on Windows platform. I'm using HP UFT and VBScript.
In a WinListView control which is used to display a multi-valued list(Each row in the list has four columns in it). After hovering on each row to select it, when mouse click operation is performed on any of the four cells the respective control in that cell shows up(an editbox or a dropdown list)
It seems that the developers have embedded temporary WinEdit and WinComboBox controls in the cells of each row which makes it difficult to use Object spy on them. I succeeded in getting object spy to work on those by holding control key, but the properties of those objects are not unique, for instance ComboBox in the third cell in different rows has the same properties.Posting ObjectSpy results here.
**ComboBox in Row 1 Cell 3**
"Class Name:=WinComboBox",
"abs_x:=1041",
"abs_y:=551",
"all items:=Hours\nMinutes",
"attached text:=",
"enabled:=True",
"focused:=True",
"height:=21",
"hwnd:=7602202",
"items count:=2",
"nativeclass:=ComboBox",
"object class:=ComboBox",
"regexpwndclass:=ComboBox",
"regexpwndtitle:=Minutes",
"rightaligned:=False",
"righttoleftlayout:=False",
"righttoleftreading:=False",
"selection:=Minutes",
"text:=Minutes",
"visible:=True",
"width:=90",
"window id:=7988488",
"windowextendedstyle:=0",
"windowstyle:=1342177987",
"x:=354",
"y:=257"
**ComboBox in Row 5 cell 3**
"Class Name:=WinComboBox",
"abs_x:=1041",
"abs_y:=619",
"all items:=Hours\nMinutes",
"attached text:=",
"enabled:=True",
"focused:=True",
"height:=21",
"hwnd:=11601852",
"items count:=2",
"nativeclass:=ComboBox",
"object class:=ComboBox",
"regexpwndclass:=ComboBox",
"regexpwndtitle:=Minutes",
"rightaligned:=False",
"righttoleftlayout:=False",
"righttoleftreading:=False",
"selection:=Minutes",
"text:=Minutes",
"visible:=True",
"width:=90",
"window id:=7988488",
"windowextendedstyle:=0",
"windowstyle:=1342177987",
"x:=354",
"y:=325"
I have tried selecting rows using WinListView.GetItem but that gives hold of the first cell only which is an editbox and it works. For the remaining three columns I can't find any workaround.
I have tried performing clicks using WinListView.GetItem().Select operation providing offset in pixels to click on each cell but that doesn't activates the embedded controls although I see the mouse moving and performing clicks when the test runs.
Record and play didn't provide much insight either as the play operation doesn't replicate the actions successfully every time and uses same and generic names for actions on cells of different rows.
WinListView("WinListView Name").WinEdit("Edit").Set "20"
DialogObject.WinComboBox("ComboBox").Select "Hours"
Image 1 The basic WinListView looks like this
Image 2 After selecting a row and clicking on a cell the ComboBox or EditBox appears

IcCube - Treefilter without scrollbar and with only limited number of elements

We try to use the treefilter in IcCube to show categories with subcategories. Now we discovered two problems, we don't know, how to fix:
We have 15 categories on level 1, but only the first 11 of them show. There is some space underneath, so it doesn't seem to be cut due to rendering:
We are not able to activate a vertical scrollbar, so when we unfold the tree, there are parts we cannot see anymore. The hotizontal scrollbar is there, but once the tree is too big (image 2) it can't be used anymore as well.
Did we do something wrong and there are options we didn't see, or are our problems due to some bugs in this widget?
Point 1)
Try to increase Max Member Count property on the Query Wizard tab of the widget (this number is for all the members to be managed, not only level 1 items)
Point 2)
Try adding {"cssStyle":"overflow:auto"} in the Content CSS property of the Box tab of the widget.

List Control Adds a Space for an Image to Column 0 When Subsequent Columns Have Images

I’ve come across a problem with Windows list controls (I am specifically using MFC, but it looks like it applies to all list controls in the Windows common controls library).
In my specific case, I want to create a list control that has two or more columns. The first column (0) is text-only and is used to allow the user to jump to entries by typing the text in that row. Column two (or three, or four, or whatever) has an image (or an image and text; either way).
This much is all well and good and can be done easily without problem, however the final list control then ends up having a space to the left of the text in column 0 (it may be on the right on an RTL system). This spacer appears to be reserved for an image and I cannot figure out a way to prevent it. (Arranging the specific order of the columns did not change anything.)
Looking around, I found some other people complaining of the same thing, specifically this thread which leads to this thread. The proposed solution does not work because as was stated, simply shrinking the width of column zero merely cuts off the text rather than the image spacer (plus, you then have to prevent and/or process any changes to column widths that the user tries to make).
Does anyone have any ideas of how to fix this bug short of writing a list control from scratch or using one of the too-fancy grid controls on CodeProject/CodeGuru/etc.?
Thanks a lot.
Did you try to change the iIndent member of the LVITEM struct? MSDN says this:
iIndent Version 4.70. Number of image widths to indent the item. A
single indentation equals the width of
an item image. Therefore, the value 1
indents the item by the width of one
image, the value 2 indents by two
images, and so on. Note that this
field is supported only for items.
Attempting to set subitem indentation
will cause the calling function to
fail.
Column 0 is special in a ListView. As soon as you assign a small image list to the ListView, the control expects you to show an image in column 0, so it leaves space for it.
Solutions:
make column 0 zero-width, give it the value you want the user to be able to type. Column 1 becomes your "first" text column. Columns 2+ are for your images. You need full row select style for this to work. Yes, you have to prevent the user from resizing column 0. Yes, that is a pain.
make a column that does have an image to be column 0 and use LVM_SETCOLUMNORDERARRAY to rearrange the display order
owner draw the items.
give column 0 an icon (just to cover all bases)

What are ways to reduce the number of columns in a table/grid?

I have a datagrid with many columns. This makes it pretty wide. Now we want to add more information to the table. Aside from removing or shortening existing columns what are some ways we might be able to add additional information without adding new columnes.
The data we want to add would be one of several values. For example:
Projected
Actual
Other
For other cases when the value was an off/on or true/false we would change the color of the row. In this case that doesn't seem to be a good option.
Another thing we considered is using an icon to indicate the information.
Any other ways this could be done?
A solution i've seen implemented with grid components is to have a column chooser - some sort of popup dialog that lists the columns and you can select which ones you would like to see in the grid. You should be able to invoke this popup by triggering it from the grid, e.g. it might appear as an option when the user right clicks and causes the context menu to appear.
Can you group related information into tabs?
an overflow area? ie a number of fields underneath the table that populate based on the selected row.
or just only show the minimum needed info and the have full details in a popup when doble clicked or something..
1) Popup on row hover
2) Drop open inline in the grid with extra info on row click
One technique I've used in the past was to create a "container" type of class that has its own labels and textboxes, and you can arrange them however you want, then insert this class into a single grid column. You still have to do some tricks on binding multiple controls that are not native "grid column" controls, but should help you along. Then, you can actually have each row a single container control in a single grid column...
You can't add completely new data to a grid without reserving a column to display it. The best solution I've seen is to provide only the essential information in the grid displaying all records, and then create a drilldown view that shows all of the data for one row. The drilldown can either be a new view in the same form, a popup for an additional window, or perhaps a mouseover popup.
I've worked on systems that use all sorts of shortcuts to display every last bit of information on a single page, and I found that it just made everything more confusing and harder to use. "Oh, that little icon there means that <insert something totally unrelated to the icon picture>."

Expression Blend: Insert a row into a grid at design time

Ok, so I have a grid with lots of controls. And oops, I missed something and need to move everything down one row...
type type type
My mistake, I needed two rows...
type type type
Ok, this really sucks. So, how do I insert a row in a way that will move everything down.
Not sure which version of Blend you are on, but in version 4 I can click to the left of the grid to divide a row into two. This has three effects:
creates a new row in the Grid.RowDefinitions section
adds 1 to the Grid.Row attributes of all rows beneath your division (moves them all down a row)
adds 1 to the Grid.RowSpan attribute of all controls in the row you have divided
You can now manually change the the RowSpans back to their original value and voila - you have a blank row.

Resources