Subject Re: [IBO] Field Properties, Column Attribute - Question
Author Helen Borrie
At 01:35 PM 13/10/2004 +1000, you wrote:


>Hi,
>
>I am currently using a TIB_Cursor in combination with a TIB_CursorGrid.
>
>I have tried to set the "FieldProperty" as well as the "ColumnAttributes" a
>number of different ways, but they are not behaving as documented or
>expected. As I have tried setting numerous "Field Properties" I will only
>mention one of them here, and one "Column Attribute" so the email is as
>short as possible.
>
>Field Property:
>
>I have tried to set the Visible property as follows:
>
>(1) I have tried setting this property on the TIB_Connection, using the
>Object Inspector
> R_IB=FALSE
> But it did not work.

The property you want is FieldsVisible (not Visible!!). If you are going
to do this on the Connection, you must set each field like this in
IB_Connection's FieldsVisible by qualifying the column name with the table
name, e.g.
MYTABLE.R_IIB=FALSE


>(2) I have tried setting this property on the TIB_Cursor, using the Object
>Inspector
> R_IB=FALSE
> But it did not work.

Again, use FieldsVisible, not Visible. If you set it at dataset level, you
don't need the table qualifier.


>(3) I have tried using the TIB_Cursor Editor - Query Forms - Field Property
>- Visible
> But it did not work.

The editor for the TIB_Cursor doesn't provide an interface for the Fields
and ColumnAttributes. Query Forms is a totally different thing: it's an
on-line utility that allows you to run queries - an "in-place IB_SQL". It
has no effect on the property settings of the ib_cursor object.


>(4) I have used the following function(s) to set this Field Property in the
>code
>
> crsCVDBCursor->FieldsDisplayWidth->LinkValues["R_ID"] = 0;
> crsCVDBCursor->FieldsDisplayWidth->LinkValues["R_CREATED_BY"] = 0;
>
>It is the only way it will work. However, it is not very efficient way of
>doing things.

Of course, these properties are available to run-time code, but why not set
them straight into the FieldsXxxxx properties in the Object Inspector?


>Column Attributes:
>
>I have tried to set the Boolean attribute for a field so that the
>TIB_CursorGrid will display this field as a CheckBox.
>
>(1)I have tried setting this Attribute on the TIB_Connection -
>ColumnAttributes, using the Object inspector
> R_SHARED=BOOLEAN=0,1
> But it did not work.

Again, you need table qualifiers at this level. You really MUST read the
help text for this.


>(2)I have tries setting this Attribute on the TIB_Cursor - ColumnAttributes,
>using the Object inspector
> R_SHARED=BOOLEAN=0,1
> But it did not work.

Read the help text and see the examples in the TechInfo sheet on datasets.


>(3) I have tried using the TIB_Cursor Editor - Query Forms -
>ColumnAttributes - BOOLEAN
> But it did not work.

See above.


>(4) I have tried using the following function(s) to set this
>ColumnAttributes in the code as per the documentation.
>
> crsCVDBCursor->ColumnAttributes->LinkValues["R_SHARED"] =
>IB_BOOLEAN;
>
> it did not work so I tried:
>
>
>crsCVDBCursor->ColumnAttributes->LinkParamValue["R_SHARED"][IB_BOOLEAN] =
>"0,1";
>
> it did not work so I tried:
>
> crsCVDBCursor->FieldByName("R_SHARED")->AttributeParams[IB_BOOLEAN]
>= "0,1";
>
>Thus, I have not been able to get The ColumnAttribute BOOLEAN to behave as
>required.

Examples of the correct syntax for applying these properties in run-time
are in the TI sheets on Datasets - also in the Help, although the examples
in the Help tend to be a bit obscure...

And note that the FieldsXxxx properties are grid properties. So, if e.g.
you set FieldsDisplayWidth, it only affects grid displays, not any
customEdit controls.

The Cursor_Grid is a pretty dumb control. It's quite likely that some of
the FieldsXxxx properties won't work with the cursor grid. I never use it,
since I never have any design requirement that needs cursor output in a grid.

ColumnAttributes, on the other hand, are properties of the data, and they
apply everywhere.

HB