“RowOver” is a term I’m officially coining right now. 😉
It’s that visual cue that you see when you’re moving the mouse over the rows in a datagrid (tabular or grid-style datawindow for you PB folks), and the row under the mouse pointer gets highlighted ever-so-delicately.
Here’s a picture. (The screen capture doesn’t grab the cursor – it’s over row 2):
Step 1: Paint a grid or tabular datawindow.
Step 2: Go to the properties of the Detail band, and set the background color to your favorite color. Depending on the color chosen, this could make further development on that datawindow difficult (as you can no longer see the objects in the detail band), so slide the Transparency slider all the way to the right (100% transparent).
Step 3: Drop a datawindow control onto the surface of a window, and bind that to the datawindow object you created in step 1.
Step 4: By default, there’s no MouseMove event defined for a datawindow control, so let’s define one. In the Script painter for the datawindow control, define a new event, and select the event_id pbm_dwnmousemove. Name it something creative, like “mousemove”.
Step 5: Add the following code to the new mousemove event:
bandAtPointer = this.getBandAtPointer()
// the string is ~t
if pos( bandAtPointer, "detail", 1 ) > 0 then
// we're over the detail band.
tabPos = pos( bandAtPointer, "~t", 1 )
rowNum = Integer( Mid( bandAtPointer, tabPos + 1 ))
/* if the current row is the one we're over,
change its transparency to 75% */
this.Modify( 'datawindow.detail.transparency="100~tif(getRow()=' + string(rowNum) + ', 75, 100)"' )
VOILA! The user gets a nice little visual cue as the mouse moves over the grid. You can play with the transparency percentage and color to get it looking exactly the way you want.
It’s important to note that this doesn’t change the “current row”, or override any row selection logic. This is purely visual eye-candy.
To download a simple example showing the gradient/transparency features of 11.5, and the “rowOver” technique, go to the Box widget and grab the Tips n Tricks.zip file.