Subject | Re: Scaleby in a form with a TIb_Grid |
---|---|
Author | Marco Menardi |
Post date | 2003-12-09T21:47:40Z |
Can I suggest to Jason that it could be related to a bug I submitted
October 09, 2002 to this list?
The message was:
"I use trueType Arial 10 on my forms, and I've problems with column
width, since my font is larger than the one calculated by IBO when
calculates automatically column width of the grid, so very often the
glyph of the ordering column is hide, or the column name is trimmed. I
need to fix this, sooner or later, but I think you have to tell the
right direction... This particular probem can be avoided since in the
width calculation, as far as I remember, there are some constant
values (i.e. 100) used for minimal/additional space, that are
compatible only with the default form font. This could be translated
in a sort of "characters margin" and pixels recalculated based upon
actual font.
But for explicit column width, since it's in pixel, it can't be avoid
this way. Can we suppose it's for a MS Sans Serif 8 font and add a
property that let IBO recalculate the ration for the actual font?
Let me know what do you think about this, Jason or other (Geoff could
provide good input too ;)
thanks
Marco Menardi"
Jason repllied:
"That sounds like a good approach to solving this issue. I'd be
curious to see how this may come together. Though I am not going to
make it a priority to do it myself I will consider merging the efforts
of a contributor on this."
If you look at the code, AFAIR, the column with is get from:
function TIB_Column.CalcDefaultWidth( IsGrid: boolean ): integer;
and adjusted with some constant.
Further, the minimal width is set to 70, but it's too large if you
have really small columns (like flags values, Y/N, M/F, etc.). The
same is true if you have a boolean field displaied as checkbox.
I suppose that all IB_ controls don't scale perfectly, just that in
IB_Grids the error is multiplied by column number and "glyph" constant
space. In any case, it's better use TrueType fonts when you want to
scale things.
regards
Marco Menardi
October 09, 2002 to this list?
The message was:
"I use trueType Arial 10 on my forms, and I've problems with column
width, since my font is larger than the one calculated by IBO when
calculates automatically column width of the grid, so very often the
glyph of the ordering column is hide, or the column name is trimmed. I
need to fix this, sooner or later, but I think you have to tell the
right direction... This particular probem can be avoided since in the
width calculation, as far as I remember, there are some constant
values (i.e. 100) used for minimal/additional space, that are
compatible only with the default form font. This could be translated
in a sort of "characters margin" and pixels recalculated based upon
actual font.
But for explicit column width, since it's in pixel, it can't be avoid
this way. Can we suppose it's for a MS Sans Serif 8 font and add a
property that let IBO recalculate the ration for the actual font?
Let me know what do you think about this, Jason or other (Geoff could
provide good input too ;)
thanks
Marco Menardi"
Jason repllied:
"That sounds like a good approach to solving this issue. I'd be
curious to see how this may come together. Though I am not going to
make it a priority to do it myself I will consider merging the efforts
of a contributor on this."
If you look at the code, AFAIR, the column with is get from:
function TIB_Column.CalcDefaultWidth( IsGrid: boolean ): integer;
and adjusted with some constant.
Further, the minimal width is set to 70, but it's too large if you
have really small columns (like flags values, Y/N, M/F, etc.). The
same is true if you have a boolean field displaied as checkbox.
I suppose that all IB_ controls don't scale perfectly, just that in
IB_Grids the error is multiplied by column number and "glyph" constant
space. In any case, it's better use TrueType fonts when you want to
scale things.
regards
Marco Menardi
--- In IBObjects@yahoogroups.com, Apicito2003 <apicito2003@y...> wrote:
> I use Delphi 7 Pro.
> I use this procedure for adjust the forms according to
> the screen resolution. In each form:
> if screen.Width <800 then / / 800 x 600
> ScaleBy(100,100)
> else
> ScaleBy(128,100); / / Other 1024 x...
> Reescale well all components of TIB_. But the
> TIB_Grid.Col[x].width is not climbed correctly with
> regard to the mark of the grid.
>
>
> My apologies for my ignorance on this point.
>
> Will you please provide more details about this?
> What versions of Delphi support it, exactly what is
> not working on the
> TIB_Grid in regard to it.
>
> I'd like a sample app, or to have one of mine modified
> showing how this is
> done, etc. May seem dumb that I ask but it saves me so
> much time. Simple,
> easy to follow instructions are helpful too.
>
> Thanks,
> Jason
>
> ----- Original Message -----
> From: "Apicito2003" <apicito2003@y...>
> To: <IBObjects@yahoogroups.com>
> Sent: Tuesday, December 09, 2003 10:37 AM
> Subject: Re: [IBO] Scaleby in a form with a TIb_Grid
>
>
> > scaleby is not a component, it's a method of the VCL
> > of Delphi: See Delphi Help:
> > "Delphi syntax:
> > procedure ScaleBy(M, D: Integer);
> > ScaleBy resizes a control without moving its upper
> > left corner. This is similar to changing the
> Heightand
> > Width properties, but the control also attempts to
> > rescale and rearrange any child controls to maintain
> > their relative size and placement.
> > The M and D parameters define a multiplier and
> divisor
> > by which to scale the control. For example, to make
> a
> > control 75% of its original size, specify the value
> of
> > M as 75, and the value of D as 100. Any pair of
> values
> > that has the same ratio has the same effect. Thus M
> =
> > 3 and D = 4 also makes the control 75% of its
> previous
> > size.
> > To rescale the control's children without rescaling
> > the control itself, use ScaleControls."
> > This method works well with all the component TIB_
> > except with TIB_Grid. Work well on the box of the
> grid
> > but not the text.
> > Thanks.
>
>
> Yahoo! Groups Sponsor ADVERTISEMENT
>
>
___________________________________________________________________________=
> IB Objects - direct, complete, custom connectivity to
> Firebird or InterBase
> without the need for BDE, ODBC or any
> other layer.
>
___________________________________________________________________________=
> http://www.ibobjects.com - your IBO community resource
> for Tech Info papers,
> keyword-searchable FAQ, community code contributions
> and more !
>
> Your use of Yahoo! Groups is subject to the Yahoo!
> Terms of Service.
>
> _______________________________________________________________
> Yahoo! Sorteos
> ¡Ya puedes comprar Lotería de Navidad!
> http://yahoo.ventura24.es/