Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

grids & epilepitc seizures

Status
Not open for further replies.

jayjay555

Programmer
May 4, 2009
13
CA
HI,

I managed to make certain rows in my grid "red+bold" from a certain conditions in the fields. Now my client wants that specific row to blink (flash) as well. Can that be done? Anvody know how to do that one?

FYI: I've got the rest down packed in my grid row with no problems and I know how to make labels blink but I totally clueless on how to make specific rows in a grid to blink upon a certain condition.


Thanks,
jj
 
The only way I know to make things blink in VFP is by using a timer. In the Timer method, you toggle the forecolor (or backcolor, I guess) of the relevant item.

Tamar
 
You used to be able to blink in Foxpro for DOS, by setting one of the bits in the colour code. But it was officially depracated in Windows, and is no longer supported.

JJ, I'm curious about why you want to do this. It sounds like something that's guaranteed to annoy the users.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro tips, advice, training, consultancy
Custom software for your business
 
Just my two cents here. I agree with Mike about the flashing. And if the "red+bold" doesn't get their attention, then adding blinking probably won't either (Old DOS experience). If they really want to see the "Hot" exceptions, then create a procedure to show only the exceptions. I do this in some of my client's apps with buttons (or a combo box) that allows the user to select only records with a certain status (All, New, Ready, Shipped, Problem, etc.) to be displayed in the grid. Each status is assigned a separate background color so if they are all displayed it is still very easy to tell what the status is.

Auguy
Northwest Ohio
 
I actually agree with all you. The blinking is going to be very annoying but that seems to be what they want. I will just change the background color as well as add the forecolor red+bold. I think like you all said, it will become very annoying and I couldn't agree more. thank you.
 
As much as I agree with the above comments about how annoying this will be - If you really HAVE to give them flashing/blinking, I'd suggest that you follow Tamar's suggestion above and put a Timer onto the Form.

At a certain interval, change the value of a memory variable, form property, etc. which works as an additional part of the control expression for the Grid Column's DynamicBackColor and/or DynamicForeColor and/or FontBold, etc. periodically.

Good Luck,
JRB-Bldr
 
Just my two cents here...

I can understand the sentiment behind someone wanting blinking items in a grid.
At our company, we have a custom dispatch application which basically, shows every location requesting our service. Depending on the priority of the request and the service level of the customer, the item is flagged on with a certain color.
The monitor displays all service requests in grids, and the monitor isn't a 'main' screen for the user. In other words, it's a monitor sitting on the side of the desk with the status grids displayed, but the users' focus in on their workstation.
Now if a service request comes in with an extremely high priority, or a request becomes overdue, the item starts blinking to sort of catch the eye of the user and alert them that the request needs a little more attention.

Anyway, it's not something I would want to watch on a regular basis, and I definitely wouldn't throw something like that in an application without a specific request, but our dispatchers appreciate that functionality.



-Dave Summers-
[cheers]
Even more Fox stuff at:
 
FWIW, I'm generally in the no-blink crowd. But in an application I'm working on, blinking is just the right choice in _one_ place. In that case, the user is linking two objects (shapes) in a form. To do so, he right-clicks on one and chooses the menu item for linking, then clicks on the other. After he chooses the first object, we blink the outline of that one until he clicks on another.

That said, this isn't your run of the mill application. You can see a couple of the forms from this app at
Tamar
 
Every thing and anything can be done...This is how you do it:

I am assuming your grid is populated by a table, The table has a logical / numeric field and if a certain condition is met that row should blink right?

Ok,

Create a property on the form call it "nt" or whatever and set it default value to 1

put a timer on the form, set the interval to 300 and in the timer() method put the the following code:

thisform.grid1.Refresh(thisform.nt)

In the grid.init() put the following code:
this.refresh
In the grid.refresh() method put the following code:
Code:
Lparameters pdoit
If Empty(pdoit)
	This.SetAll("dynamicforecolor", "IIF(employee.loggedon, rgb(0,0,160), RGB(0,0,0))", "Column")
	Thisform.nt = 1
Else
	This.SetAll("dynamicforecolor", "IIF(employee.loggedon, rgb(255,0,0), RGB(0,0,0))", "Column")
	Thisform.nt = 0
Endif
change the colors to whatever you want
NOTE: Employee.loggedon is a logical field from one of our tables, put your condition here

Thats it...blink away to your hearts content :}

 
sorry: you wanted it bold too:

In the grids.refresh()
Code:
Lparameters pdoit
If Empty(pdoit)
	This.SetAll("dynamicforecolor", "IIF(employee.loggedon, rgb(0,0,160), RGB(0,0,0))", "Column")
	This.SetAll("dynamicfontbold", "IIF(employee.loggedon, .t., .f.)", "Column")
	Thisform.nt = 1
Else
	This.SetAll("dynamicforecolor", "IIF(employee.loggedon, rgb(255,0,0), RGB(0,0,0))", "Column")
	This.SetAll("dynamicfontbold", "IIF(employee.loggedon, .t., .f.)", "Column")
	Thisform.nt = 0
Endif
 
JJ,

An alternative approach would be to place an animated GIF in the grid.

You can create an animated GIF in a paint program or icon editor. Place an image control in the grid, and set its Picture property to point to the GIF. Use DynamicActiveControl to activate it for the rows in question.

It won't make the entire row blink, but with a bit of ingenuity, you should be able to create a design that will attract the user's attention.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro tips, advice, training, consultancy
Custom software for your business
 
I'm in the no blink camp. There's a reason blinking was basically depricated in Windows...Millions of dollars in UI research spent by Microsoft showed people generally hated it.

That said, if there's no other way, do it....just be prepared to change it back when the users revolt.

Craig Berntson
MCSD, Visual FoxPro MVP,
 
you guys are the best. thanks all for all your help sand patience.
 
Please be aware of falling foul of AMERICANS WITH DISABILITIES ACT OF 1990, AS AMENDED when designing this type of display.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top