Subject | Re: [IBO] GridColWidth |
---|---|
Author | Lucas Franzen |
Post date | 2000-12-20T12:55:07Z |
Helen Borrie schrieb:
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.
through three mirrors????
Luc.
>Helen,
> >But only if it differs from the DefaultWidth ...
> >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.
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 theIsn't that a little bit like shooting yourself in the foot by aiming
> >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...
through three mirrors????
Luc.