Highlighted
Absent Member.
Absent Member.
316 views

[archive] Grid columns width

[Migrated content. Thread originally posted on 09 September 2008]

I wrote acu code to implement a "combo" inside a cell grid.

Using a floating windows without border and system menu, containing a simple grid displayed at x,y pixel coordinates where the specific cell is clicked I simulate the combo function. I don't use a list-box because it's impossible to catch the different events of Mouse Click and MsgValidate of up/down arrow.

I succesfully compute exact y pixel for the correct row computing screen line of the window + grid line * cell height + height of textsize("0") * row + separation + row divider spacing.

But my problem is to find exact x pixel.

My form and my grid use MS Sans Serif 10 Normal font.

Using width of textsize("0") units, I get unexpected values compared to real cell width.
Example: a 3 column width cell is exact 23 pixel on screen, while a 32 column width cell is 255.
Using textsize("000") I obtain 21 and texsize("00000000000000000000000000000000") = 224.

So, I've tried some compensation like this:
Using textsize(str) using a substring of this special string
str = "0123456789:;?@ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".
I got more approssimated results, but not exact pixel.

My question is:
Wich algoritmn Acu runtime use to compute exact cell pixel coordinates and widths?

Thank's in advance.
Maurizio Barbagin
0 Likes
1 Reply
Highlighted
Absent Member.
Absent Member.

RE: [archive] Grid columns width

hi, try this.
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.