Datawindow Change Color Modified
In the Color property of a column, enter the expression IF (column_name <>column_name.Original, 14745599, 67108864). This will change the color of the column to, in this case, Light Yellow if the user changes the value and Button Face if the column has not been modified. The trick here is that column_name <> column_name.Original compares the current column value with the original column value.
Window Example
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
forward global type w_main from window end type type dw_1 from datawindow within w_main end type end forward global type w_main from window integer width = 1559 integer height = 1812 boolean titlebar = true string title = "Color Modified" boolean controlmenu = true boolean minbox = true long backcolor = 67108864 string icon = "AppIcon!" boolean center = true dw_1 dw_1 end type global w_main w_main on w_main.create this.dw_1=create dw_1 this.Control[]={this.dw_1} end on on w_main.destroy destroy(this.dw_1) end on type dw_1 from datawindow within w_main integer x = 37 integer y = 32 integer width = 1463 integer height = 1664 integer taborder = 10 string title = "none" string dataobject = "d_dataex" boolean hscrollbar = true boolean vscrollbar = true boolean livescroll = true borderstyle borderstyle = stylelowered! end type event constructor;Long ll_columns,ll_i String ls_colName ll_columns = Long(This.Object.DataWindow.Column.Count) For ll_i = 1 To ll_columns ls_colName = This.Describe( "#" + String( ll_i ) + ".Name" ) This.Modify(ls_colName+".Background.Color='255~t IF ("+ls_colName+" <>"+ls_colName+".Original, 14745599, "+This.Object.DataWindow.Color+")'") Next end event |
datawindow
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
release 10.5; datawindow(units=0 timer_interval=0 color=67108864 processing=1 HTMLDW=no print.printername="" print.documentname="" print.orientation = 0 print.margin.left = 110 print.margin.right = 110 print.margin.top = 96 print.margin.bottom = 96 print.paper.source = 0 print.paper.size = 0 print.canusedefaultprinter=yes print.prompt=no print.buttons=no print.preview.buttons=no print.cliptext=no print.overrideprintjob=no print.collate=yes print.preview.outline=yes hidegrayline=no grid.lines=0 selected.mouse=no ) header(height=84 color="536870912" ) summary(height=92 color="536870912" ) footer(height=0 color="536870912" ) detail(height=92 color="536870912" ) table(column=(type=char(10) updatewhereclause=yes name=col1 dbname="col1" ) column=(type=char(10) updatewhereclause=yes name=col2 dbname="col2" ) column=(type=char(10) updatewhereclause=yes name=col3 dbname="col3" ) column=(type=number updatewhereclause=yes name=col4 dbname="col4" ) column=(type=number updatewhereclause=yes name=col5 dbname="col5" ) ) data("cola1", "colb1", "colc1", 1, 1, "cola2", "colb2", "colc2", 2, 2, "cola3", "colb3", "colc3", 3, 3, "cola4", "colb4", "colc4", 4, 4, "cola5", "colb5", "colc5", 5, 5, "cola6", "colb6", "colc6", 6, 6, "cola7", "colb7", "colc7", 7, 7, "cola8", "colb8", "colc8", 8, 8, "cola9", "colb9", "colc9", 9, 9, "cola10", "colb10", "colc10", 10, 10, "cola11", "colb11", "colc11", 11, 11, "cola12", "colb12", "colc12", 12, 12, "cola13", "colb13", "colc13", 13, 13, "cola14", "colb14", "colc14", 14, 14, "cola15", "colb15", "colc15", 15, 15, "cola16", "colb16", "colc16", 16, 16, "cola17", "colb17", "colc17", 17, 17, "cola18", "colb18", "colc18", 18, 18, "cola19", "colb19", "colc19", 19, 19, "cola20", "colb20", "colc20", 20, 20, "cola21", "colb21", "colc21", 21, 21, "cola22", "colb22", "colc22", 22, 22, "cola23", "colb23", "colc23", 23, 23, "cola24", "colb24", "colc24", 24, 24, "cola25", "colb25", "colc25", 25, 25, "cola26", "colb26", "colc26", 26, 26, "cola27", "colb27", "colc27", 27, 27, "cola28", "colb28", "colc28", 28, 28, "cola29", "colb29", "colc29", 29, 29, "cola30", "colb30", "colc30", 30, 30, ) text(band=header alignment="2" text="Col1" border="6" color="33554432" x="14" y="8" height="64" width="274" html.valueishtml="0" name=col1_t visible="1" font.face="Tahoma" font.height="-10" font.weight="400" font.family="2" font.pitch="2" font.charset="0" background.mode="2" background.color="67108864" ) text(band=header alignment="2" text="Col2" border="6" color="33554432" x="302" y="8" height="64" width="274" html.valueishtml="0" name=col2_t visible="1" font.face="Tahoma" font.height="-10" font.weight="400" font.family="2" font.pitch="2" font.charset="0" background.mode="2" background.color="67108864" ) text(band=header alignment="2" text="Col3" border="6" color="33554432" x="590" y="8" height="64" width="274" html.valueishtml="0" name=col3_t visible="1" font.face="Tahoma" font.height="-10" font.weight="400" font.family="2" font.pitch="2" font.charset="0" background.mode="2" background.color="67108864" ) text(band=header alignment="2" text="Col4" border="6" color="33554432" x="878" y="8" height="64" width="219" html.valueishtml="0" name=col4_t visible="1" font.face="Tahoma" font.height="-10" font.weight="400" font.family="2" font.pitch="2" font.charset="0" background.mode="2" background.color="67108864" ) text(band=header alignment="2" text="Col5" border="6" color="33554432" x="1111" y="8" height="64" width="219" html.valueishtml="0" name=col5_t visible="1" font.face="Tahoma" font.height="-10" font.weight="400" font.family="2" font.pitch="2" font.charset="0" background.mode="2" background.color="67108864" ) compute(band=summary alignment="1" expression="sum(col4 for all)"border="0" color="33554432" x="873" y="4" height="64" width="224" format="[general]" html.valueishtml="0" name=compute_1 visible="1" font.face="Tahoma" font.height="-10" font.weight="400" font.family="2" font.pitch="2" font.charset="0" background.mode="2" background.color="67108864" ) compute(band=summary alignment="1" expression="sum(col5 for all)"border="0" color="33554432" x="1106" y="4" height="64" width="224" format="[general]" html.valueishtml="0" name=compute_2 visible="1" font.face="Tahoma" font.height="-10" font.weight="400" font.family="2" font.pitch="2" font.charset="0" background.mode="2" background.color="67108864" ) column(band=detail id=1 alignment="0" tabsequence=10 border="0" color="33554432" x="14" y="8" height="76" width="274" format="[general]" html.valueishtml="0" name=col1 visible="1" edit.limit=0 edit.case=any edit.focusrectangle=no edit.autoselect=yes edit.autohscroll=yes font.face="Tahoma" font.height="-10" font.weight="400" font.family="2" font.pitch="2" font.charset="0" background.mode="2" background.color="67108864" ) column(band=detail id=2 alignment="0" tabsequence=20 border="0" color="33554432" x="302" y="8" height="76" width="274" format="[general]" html.valueishtml="0" name=col2 visible="1" edit.limit=0 edit.case=any edit.focusrectangle=no edit.autoselect=yes edit.autohscroll=yes font.face="Tahoma" font.height="-10" font.weight="400" font.family="2" font.pitch="2" font.charset="0" background.mode="2" background.color="67108864" ) column(band=detail id=3 alignment="0" tabsequence=30 border="0" color="33554432" x="590" y="8" height="76" width="274" format="[general]" html.valueishtml="0" name=col3 visible="1" edit.limit=0 edit.case=any edit.focusrectangle=no edit.autoselect=yes edit.autohscroll=yes font.face="Tahoma" font.height="-10" font.weight="400" font.family="2" font.pitch="2" font.charset="0" background.mode="2" background.color="67108864" ) column(band=detail id=4 alignment="1" tabsequence=40 border="0" color="33554432" x="878" y="8" height="76" width="219" format="[general]" html.valueishtml="0" name=col4 visible="1" edit.limit=0 edit.case=any edit.focusrectangle=no edit.autoselect=yes edit.autohscroll=yes font.face="Tahoma" font.height="-10" font.weight="400" font.family="2" font.pitch="2" font.charset="0" background.mode="2" background.color="67108864" ) column(band=detail id=5 alignment="1" tabsequence=50 border="0" color="33554432" x="1111" y="8" height="76" width="219" format="[general]" html.valueishtml="0" name=col5 visible="1" edit.limit=0 edit.case=any edit.focusrectangle=no edit.autoselect=yes edit.autohscroll=yes font.face="Tahoma" font.height="-10" font.weight="400" font.family="2" font.pitch="2" font.charset="0" background.mode="2" background.color="67108864" ) htmltable(border="1" ) htmlgen(clientevents="1" clientvalidation="1" clientcomputedfields="1" clientformatting="0" clientscriptable="0" generatejavascript="1" encodeselflinkargs="1" netscapelayers="0" pagingmethod=0 generatedddwframes="1" ) xhtmlgen() cssgen(sessionspecific="0" ) xmlgen(inline="0" ) xsltgen() jsgen() export.xml(headgroups="1" includewhitespace="0" metadatatype=0 savemetadata=0 ) import.xml() export.pdf(method=0 distill.custompostscript="0" xslfop.print="0" ) export.xhtml() |
Find Projects On Github click here
Good Luck!
Subscribe
Login
0 Comments
Oldest