Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Dynamically change color and tab order

1,467 views
Skip to first unread message

Laurel

unread,
Dec 9, 1997, 3:00:00 AM12/9/97
to

I want to change the color of my columns and the tab order (to 0),
depending on a runtime variable. Is there anyway to access data outside of
a dw from an expression? And, is there any way to change the tab order
dynamically?

For the background color, I'd like to do something like
IF(<view_only>,<number for button face>,<number for windows background>)

The <view_only> is the runtime value I'd like to test.

One thought I had was to make a computed column and set it to "view" or
"true" or something in all the rows at runtime, depending on my "view"
variable. Is that the best solution?

Then, of course, my other problem is the the tab order isn't in the list of
things that will take expressions. I can never find the modify attributes.
I'm hoping
this.modify("taborder=0") will do it. If not, could someone point me to
that documentation location?


Saxon D'Aubin

unread,
Dec 9, 1997, 3:00:00 AM12/9/97
to

Use the Protect and Background.Mode expressions. For example
dw_1.Modify("column_1.Protect = '0~tif (view_only = 1, 1, 0)'
column_1.Background.Mode = '0~tif (view_only = 1, 1, 0)'")

Setting Background.Mode equal to 1 turns the column background transparent.
The advantage of this is that the actual tab order and background color is
preserved, so you can flip between edit and read only modes without having
to store this info.

Also, if you want to turn the whole DW readonly, use
dw_1.Modify("datawindow.readonly = yes")
You'll still have to set all column background modes. For ex.

For i = 1 To li_ColumnCount
dw_1.Modify("#" + String(i) + ".Background.Mode = '0~tif (view_only =
1, 1, 0)'")
Next
Hope this helps..
- Saxon

Laurel wrote in message <01bd04b9$1091e6a0$3a00...@laurel.quodata.com>...

Laurel

unread,
Dec 10, 1997, 3:00:00 AM12/10/97
to

Thanks so much! I used your suggestion to examine the export file to find
out how the arrow is made visible and invisible (it's "useasborder"... go
figure). I also bumped into a weirdness. If you set "useasborder" to 'no'
on some non-dddw/ddlb columns, it puts a visisble arrow on them(!). In my
case, the column happened to have an edit mask on it. But I didn't
research to see if that was really the culprit. I just put in the test for
dddw's and ddlb's. Another weirdness is that trying to access ddlb.name on
a non-ddlb field gives you "!", while doing the same thing for dddw.name
returns a "?".

// of_SetReadOnly() - LAS - 12/97
Integer li_Column, li_column_count
string ls_junk, ls_dddw_name, ls_ddlb_name, ls_debug

idw_requestor.Modify("Datawindow.ReadOnly = yes")

li_column_count = Integer(idw_requestor.Describe &
("Datawindow.Column.Count"))

For li_Column = 1 To li_Column_Count

// Turn the color to transparent

idw_requestor.Modify("#" + String(li_Column) &
+ ".Background.Mode = 1")

// If the column has a dddw or ddlb edit style, then set
// "always show arrow" to 'no'
ls_dddw_name &
= idw_requestor.Describe("#" + String(li_Column) &
+ ".dddw.name")
IF (ls_dddw_name <> "?") AND (ls_dddw_name <> "!") THEN
idw_requestor.Modify("#" + String(li_Column) &
+ ".ddlb.useasborder = no")
END IF

ls_ddlb_name &
= idw_requestor.Describe("#" + String(li_Column) &
+ ".ddlb.name")
IF (ls_ddlb_name <> "?") AND (ls_ddlb_name <> "!") THEN
idw_requestor.Modify("#" + String(li_Column) &
+ ".ddlb.useasborder = no")
END IF

Next

Return 1


Saxon D'Aubin

unread,
Dec 10, 1997, 3:00:00 AM12/10/97
to

This is probably a little cleaner.....

ls_EditStyle = Lower(idw_requestor.Describe("#" + string(li_Column) +
".Edit.Style"))

if ls_EditStyle = 'ddlb' Or ls_EditStyle = 'dddw' Then
idw_requestor.Modify("#" + String(li_Column) + "." + ls_EditStyle +
".useasborder = no")
End If

If a column isn't a dddw, all column.dddw.expression describes will return
an error(!).
- Saxon

>dddw's and ddlb's. Another weirdness is that trying to access ddlb.name on
>a non-ddlb field gives you "!", while doing the same thing for dddw.name
>returns a "?".

> ls_dddw_name &

0 new messages