DataWindow Alternate Column And Row Color Highlighter
Example Event ItemFocuschanged
1 2 3 4 5 6 7 8 9 10 11 12 |
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" ) If (ls_colName = String(dwo.Name)) Then This.Modify(ls_colName+".Background.Color='11665407'") Else This.Modify(ls_colName+".Background.Color='255~t if(Getrow() = currentRow(),11665407,if(mod(getrow(),2 ) =0,rgb(231, 255, 231),rgb(255,255,255)))'") End If Next |
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 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 |
forward global type w_main from window end type type st_4 from statictext within w_main end type type dw_1 from datawindow within w_main end type type st_3 from statictext within w_main end type type st_2 from statictext within w_main end type type st_1 from statictext within w_main end type type dw_columnrow from datawindow within w_main end type type dw_column from datawindow within w_main end type type dw_row from datawindow within w_main end type end forward global type w_main from window integer width = 3081 integer height = 2880 boolean titlebar = true string title = "Alternate Column And Row Color Highlighter" boolean controlmenu = true boolean minbox = true boolean maxbox = true boolean resizable = true long backcolor = 67108864 string icon = "AppIcon!" boolean center = true st_4 st_4 dw_1 dw_1 st_3 st_3 st_2 st_2 st_1 st_1 dw_columnrow dw_columnrow dw_column dw_column dw_row dw_row end type global w_main w_main type variables String is_colold, is_colold2 end variables on w_main.create this.st_4=create st_4 this.dw_1=create dw_1 this.st_3=create st_3 this.st_2=create st_2 this.st_1=create st_1 this.dw_columnrow=create dw_columnrow this.dw_column=create dw_column this.dw_row=create dw_row this.Control[]={this.st_4,& this.dw_1,& this.st_3,& this.st_2,& this.st_1,& this.dw_columnrow,& this.dw_column,& this.dw_row} end on on w_main.destroy destroy(this.st_4) destroy(this.dw_1) destroy(this.st_3) destroy(this.st_2) destroy(this.st_1) destroy(this.dw_columnrow) destroy(this.dw_column) destroy(this.dw_row) end on type st_4 from statictext within w_main integer x = 1573 integer y = 64 integer width = 1138 integer height = 64 integer textsize = -10 integer weight = 400 fontcharset fontcharset = ansi! fontpitch fontpitch = variable! fontfamily fontfamily = swiss! string facename = "Tahoma" long textcolor = 33554432 long backcolor = 67108864 string text = "Current/Alternate Column Color Highlighter" boolean focusrectangle = false end type type dw_1 from datawindow within w_main integer x = 1536 integer y = 160 integer width = 1463 integer height = 1184 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, ll_colidx String ls_colName, ls_type, ls_visible ll_columns = Long(This.Object.DataWindow.Column.Count) For ll_i = 1 To ll_columns ls_colName = This.Describe( "#" + String( ll_i ) + ".Name" ) ls_type = This.Describe(ls_colName + ".type") ls_visible = This.Describe(ls_colName + ".visible") If ls_type = "column" And ls_visible = "1" Then ll_colidx++ If Mod(ll_colidx, 2) = 0 Then This.Modify(ls_colName+".Background.Color='15204327'") Else This.Modify(ls_colName+".Background.Color='16777215'") End If End If Next end event event itemfocuschanged;Long ll_columns,ll_i, ll_colidx String ls_colName, ls_type, ls_visible ll_columns = Long(This.Object.DataWindow.Column.Count) For ll_i = 1 To ll_columns ls_colName = This.Describe( "#" + String( ll_i ) + ".Name" ) ls_type = This.Describe(ls_colName + ".type") ls_visible = This.Describe(ls_colName + ".visible") If ls_type = "column" And ls_visible = "1" Then ll_colidx++ If (ls_colName = String(dwo.Name)) Then This.Modify(ls_colName+".Background.Color='11665407'") Else If Mod(ll_colidx, 2) = 0 Then This.Modify(ls_colName+".Background.Color='15204327'") Else This.Modify(ls_colName+".Background.Color='16777215'") End If End If End If Next end event type st_3 from statictext within w_main integer x = 1573 integer y = 1408 integer width = 1367 integer height = 64 integer textsize = -10 integer weight = 400 fontcharset fontcharset = ansi! fontpitch fontpitch = variable! fontfamily fontfamily = swiss! string facename = "Tahoma" long textcolor = 33554432 long backcolor = 67108864 string text = "Curent/Alternate Column And Row Color Highlighter" boolean focusrectangle = false end type type st_2 from statictext within w_main integer x = 73 integer y = 1408 integer width = 919 integer height = 64 integer textsize = -10 integer weight = 400 fontcharset fontcharset = ansi! fontpitch fontpitch = variable! fontfamily fontfamily = swiss! string facename = "Tahoma" long textcolor = 33554432 long backcolor = 67108864 string text = "Current Column Color Highlighter" boolean focusrectangle = false end type type st_1 from statictext within w_main integer x = 73 integer y = 64 integer width = 1056 integer height = 64 integer textsize = -10 integer weight = 400 fontcharset fontcharset = ansi! fontpitch fontpitch = variable! fontfamily fontfamily = swiss! string facename = "Tahoma" long textcolor = 33554432 long backcolor = 67108864 string text = "Current/Alternate Row Color Highlighter" boolean focusrectangle = false end type type dw_columnrow from datawindow within w_main integer x = 1536 integer y = 1504 integer width = 1463 integer height = 1184 integer taborder = 20 string title = "none" string dataobject = "d_dataex" boolean hscrollbar = true boolean vscrollbar = true boolean livescroll = true borderstyle borderstyle = stylelowered! end type event clicked;/* 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" ) If (ls_colName = String(dwo.Name)) Then This.Modify(ls_colName+".Background.Color='11665407'") Else This.Modify(ls_colName+".Background.Color='255~t if(Getrow() = currentRow(),11665407,if(mod(getrow(),2 ) =0,rgb(231, 255, 231),rgb(255,255,255)))'") End If Next */ end event 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(Getrow() = currentRow(),11665407,if(mod(getrow(),2 ) =0,rgb(231, 255, 231),rgb(255,255,255)))'") Next If ll_columns > 0 then is_colold2 = This.Describe( "#1.Name" ) This.Modify(is_colold2+".Background.Color='11665407'") End If end event event itemfocuschanged;/* 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" ) If (ls_colName = String(dwo.Name)) Then This.Modify(ls_colName+".Background.Color='11665407'") Else This.Modify(ls_colName+".Background.Color='255~t if(Getrow() = currentRow(),11665407,if(mod(getrow(),2 ) =0,rgb(231, 255, 231),rgb(255,255,255)))'") End If Next */ String ls_colName ls_colName = String(dwo.Name) If IsNull(ls_colName) Or Len(Trim(ls_colName)) = 0 Then Return If is_colold2 = ls_colName Then Return If IsNull(is_colold2) Or Len(Trim(is_colold2)) = 0 Then This.Modify(ls_colName+".Background.Color='11665407'") Else //This.Modify(is_colold+".Background.Color='16777215'") This.Modify(is_colold2+".Background.Color='255~t if(Getrow() = currentRow(),11665407,if(mod(getrow(),2 ) =0,rgb(231, 255, 231),rgb(255,255,255)))'") This.Modify(ls_colName+".Background.Color='11665407'") End If is_colold2 = ls_colName end event type dw_column from datawindow within w_main integer x = 37 integer y = 1504 integer width = 1463 integer height = 1184 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 String ls_colName ll_columns = Long(This.Object.DataWindow.Column.Count) If ll_columns > 0 then ls_colName = This.Describe( "#1.Name" ) is_colold = ls_colName This.Modify(ls_colName+".Background.Color='11665407'") End If end event event clicked;/* 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" ) If (ls_colName = String(dwo.Name)) Then This.Modify(ls_colName+".Background.Color='11665407'") Else This.Modify(ls_colName+".Background.Color='16777215'") End If Next */ /* String ls_colName ls_colName = String(dwo.Name) If IsNull(ls_colName) Or Len(Trim(ls_colName)) = 0 Then Return If ls_colName = "datawindow" Then Return If dwo.band <> "detail" Then Return If IsNull(is_colold) Or Len(Trim(is_colold)) = 0 Then This.Modify(ls_colName+".Background.Color='11665407'") Else This.Modify(is_colold+".Background.Color='16777215'") This.Modify(ls_colName+".Background.Color='11665407'") End If is_colold = ls_colName */ end event event itemfocuschanged;String ls_colName ls_colName = String(dwo.Name) If IsNull(ls_colName) Or Len(Trim(ls_colName)) = 0 Then Return If is_colold = ls_colName Then Return If IsNull(is_colold) Or Len(Trim(is_colold)) = 0 Then This.Modify(ls_colName+".Background.Color='11665407'") Else This.Modify(is_colold+".Background.Color='16777215'") This.Modify(ls_colName+".Background.Color='11665407'") End If is_colold = ls_colName end event type dw_row from datawindow within w_main integer x = 37 integer y = 160 integer width = 1463 integer height = 1184 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(Getrow() = currentRow(),11665407,if(mod(getrow(),2 ) =0,rgb(231, 255, 231),rgb(255,255,255)))'") Next end event |
Datawindow 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 |
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" ) 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="1073741824" ) 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="1073741824" ) 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="1073741824" ) 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="1073741824" ) 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="1073741824" ) 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" ) 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