Subject Re: [IBO] GridColWidth
Author Lucas Franzen
Helen Borrie schrieb:
>

Helen,

> >
> >Where is this property in the IB_Grids???? It vanished....
>
> It didn't vanish, it moved into the Dataset attribute
> FieldsDisplayWidth. Set this to the length that you get with
> 'molmolmol...' for the varchar size and you should be able to see the full
> width of any value in the column.

But only if it differs from the DefaultWidth ...

So that means in the OnMouse Move evnt you've got to:

a) get the the TGridCoOrd for the Mouse.x,y position
b) get the fieldname for this column
c) Look up the FieldDisplayWidth for an entry and if there's none you've
got to take the DefaultColWidth

hmm - this seems quite a lot of work compared to

myWidth := ColWidths[TGridCoOrd.x];


okay I can wokraound by getting the TRect of the column and a
subtraction:
TRect.Right - TRect.Left.



> >I can determine how wide the text in a column is when moving with the
> >mouse over the grid, but I can't see how to find out how wide the
> >current column in the grid (where the mouse is moving over) is.
> >
> >If the column size hasn't changed it seems to be the default width.
> >otherwise the width is in the FieldDisplayWidth-property of the
> >underlying query.
>
> Yes: and this is what you need to play with if you want to stretch or
> shrink the column at run-time. There was a thread about this not too long
> ago and I seem to recall Geoff Worboys posted an algorithm for getting at
> that attribute...

Isn't that a little bit like shooting yourself in the foot by aiming
through three mirrors????

Luc.