Hot Topic (More than 10 Replies) Ues of Back/Fill colours for table view possible? (Read 2368 times)
carsten
Junior Member
**
Offline


Carpe Diem

Posts: 74
Location: Germany
Joined: Aug 24th, 2005
Ues of Back/Fill colours for table view possible?
Jul 20th, 2006 at 6:16pm
Print Post Print Post  
Is it possible to use back/fill colours in table view?
I have not managed to do so.

I want to display fields according to their value in different colours (green, yellow, red) indicating the availability status.
There are about 35 records with each 4 values.

-Carsten
  

Carsten&&The Houseman&&"Smiling improves your face value"&&"A Clean House is a Sign of a Wasted Life"&&"Rather Big and Hard then Micro and Soft"
Back to top
 
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2482
Joined: Aug 20th, 2003
Re: Ues of Back/Fill colours for table view possib
Reply #1 - Jul 20th, 2006 at 7:21pm
Print Post Print Post  
Hello Carsten,

In a Table View subform, each cell in a Column of data is going to have the same color background. As far as I know there is no way to change cells to have different background colors, ex: to make Field A in Record 1 be Green, Field A in Record 2 be Yellow, and Field A in Record 3 be Red, when just looking at the subform.

-Ray
  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
Back to top
IP Logged
 
Bob_Hansen
Senior Member
Members
*****
Offline


WOW, They have the Internet
on computers now!

Posts: 1861
Location: Salem, NH
Joined: Nov 24th, 2002
Re: Ues of Back/Fill colours for table view possib
Reply #2 - Jul 20th, 2006 at 8:01pm
Print Post Print Post  
i seem to recall that perhaps Version 2 would have more tools for TableView, will these be among those new features?
  



Bob Hansen
Sesame Database Manager Professional
Sensible Solutions Inc.
Salem, NH
603-898-8223
Skype ID = sensiblesolutions
Back to top
IP Logged
 
carsten
Junior Member
**
Offline


Carpe Diem

Posts: 74
Location: Germany
Joined: Aug 24th, 2005
Re: Ues of Back/Fill colours for table view possib
Reply #3 - Jul 20th, 2006 at 10:40pm
Print Post Print Post  
Thanks Ray!
Maybe 2.0 will have it?

Is it possible to use different colours in the Shift-F6 table view?

regards
Carsten
  

Carsten&&The Houseman&&"Smiling improves your face value"&&"A Clean House is a Sign of a Wasted Life"&&"Rather Big and Hard then Micro and Soft"
Back to top
 
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: Ues of Back/Fill colours for table view possib
Reply #4 - Jul 21st, 2006 at 12:06am
Print Post Print Post  
I'm looking into a means to do this (and much else). The problem with implementing something like this in a table is that the only place to store the color value is either with the column (which is the same as storing it with the LE), or with each individual cell. Currently we store this with all of the other 50 some LE settings with the column. Storing it with each cell would be very memory consumptive. Imaging you had 10,000 records and each had 150 LEs - to store an RGB value (3 bytes) would occupy 4,500,000 bytes.

The alternative which I am exploring is to implement a new SBasic programming event "On Draw". This SBasic would get called just before the element is drawn on the screen. This would allow the programmer to change LE settings (like color) for that cell just before it is drawn based on the value in that cell. This would allow exceptions to the LE (column) color for one or more elements in the column wthout having to store parameters for each and every cell.

This would have the added benefit of being applicable to all LEs - not just table cells and could be applied generically and uniformally across the entire form. The primary question is whether the overhead of calling SBasic code while the screen is redrawing would be distracting to the user (cause flicker) . The SBasic programmer would also have to be careful that their code does not cause endless redraw interation.

In any case, I'll give it a try and see.
  

Mark Lasersohn&&Programmer&&Lantica Software, LLC
Back to top
IP Logged
 
Bob_Hansen
Senior Member
Members
*****
Offline


WOW, They have the Internet
on computers now!

Posts: 1861
Location: Salem, NH
Joined: Nov 24th, 2002
Re: Ues of Back/Fill colours for table view possib
Reply #5 - Jul 21st, 2006 at 4:30am
Print Post Print Post  
I don't know if overhead is worth coloring cells as a feature.

Would prefer to be able to sort records and change column visibility and positions vs. colored columns/cells.

We can currently resize columns, so this is dynamic not stored. 
Maybe have colors/visibility/position etc. available at time of use, vs. storing, like now with resizing?

Default values for row/column properties could be set in the new INI files.
So maybe some functions that are TableView related than can be programmed in 1-4 steps,
1.  Call for table view, current settings
2.  Return column properties: (visibility/width/background/text colors, row heights, fonts) to see if change needed.
3.  Set column properties:(visibility/width/background/text colors, row heights, fonts) as needed.
4.  Set new values to be temp or replace values in INI file (include this in the SetTablelView function with the properties).




  



Bob Hansen
Sesame Database Manager Professional
Sensible Solutions Inc.
Salem, NH
603-898-8223
Skype ID = sensiblesolutions
Back to top
IP Logged
 
carsten
Junior Member
**
Offline


Carpe Diem

Posts: 74
Location: Germany
Joined: Aug 24th, 2005
Re: Ues of Back/Fill colours for table view possib
Reply #6 - Jul 21st, 2006 at 9:12am
Print Post Print Post  
Mark,

I am currently using SBasic programming on the form to colour cells depending on their value (available, not sure, not available). I do this on form entry. This obviously gives my only the status for one record but I would like to see it for a set of records (this is a travel booking DB and I want to signal room availability for several weeks in a hotel).

I see you point with storing the values and apreciate it the more as I am running the application as client/server on the network.
As I am interested in a snapshot of the values I would not rquire them to be updated and could accept a short waiting period on form/table entry. I would also be satisfied to do this on a report basis.

regards
Carsten
  

Carsten&&The Houseman&&"Smiling improves your face value"&&"A Clean House is a Sign of a Wasted Life"&&"Rather Big and Hard then Micro and Soft"
Back to top
 
IP Logged
 
Carl Underwood
Senior Member
Members
*****
Offline



Posts: 1351
Location: New Hampshire
Joined: Mar 11th, 2003
Re: Ues of Back/Fill colours for table view possib
Reply #7 - Jul 21st, 2006 at 12:18pm
Print Post Print Post  
carsten wrote on Jul 21st, 2006 at 9:12am:
I would also be satisfied to do this on a report basis.

In a report, you can change the font color (but not the background color) with @Color or RGBColor. RGBColor gives you more control over the color than @Color does.

As an example, the following code placed in the "Payment Type :: On Print" event will produce red text if the payment is "Cash" and black text if the payment is a "Check". This will give you an idea how it works. You should be able to adapt it to your own report.
Code
Select All
If Payment Type = "Cash"
	// Red Text
	RGBColor(Payment Type, 255, 0, 0, 255, 255, 255)
Else
	// Black Text
	RGBColor(Payment Type, 0, 0, 0, 255, 255, 255) 


You can read about RGBColor on page 209 of the Programming Guide. The background settings have no effect in reports. You can only control the font color.
  


Carl Underwood
CDU Computer Consulting LLC
Epsom, New Hampshire
Back to top
IP Logged
 
carsten
Junior Member
**
Offline


Carpe Diem

Posts: 74
Location: Germany
Joined: Aug 24th, 2005
Re: Ues of Back/Fill colours for table view possib
Reply #8 - Jul 21st, 2006 at 8:01pm
Print Post Print Post  
Karl,

Thanks for the hint. I had this in mind as well but unfortunately I do not have text/numbers in all of the fields as some actual values are supposed to be hidden and only a status shall be given.

It looks as though I will have to wait for 2.0

regards
Carsten
  

Carsten&&The Houseman&&"Smiling improves your face value"&&"A Clean House is a Sign of a Wasted Life"&&"Rather Big and Hard then Micro and Soft"
Back to top
 
IP Logged
 
Carl Underwood
Senior Member
Members
*****
Offline



Posts: 1351
Location: New Hampshire
Joined: Mar 11th, 2003
Re: Ues of Back/Fill colours for table view possib
Reply #9 - Jul 22nd, 2006 at 1:36am
Print Post Print Post  
carsten wrote on Jul 21st, 2006 at 8:01pm:
I had this in mind as well but unfortunately I do not have text/numbers in all of the fields as some actual values are supposed to be hidden and only a status shall be given.

I'm not sure I understand that statement.

Can't you change the color (of whatever does show in the report) based on the status?
  


Carl Underwood
CDU Computer Consulting LLC
Epsom, New Hampshire
Back to top
IP Logged
 
carsten
Junior Member
**
Offline


Carpe Diem

Posts: 74
Location: Germany
Joined: Aug 24th, 2005
Re: Ues of Back/Fill colours for table view possib
Reply #10 - Jul 22nd, 2006 at 10:31am
Print Post Print Post  
I do not want to show values in all of the fields, but a background colour depending on the value.

Example:
I have a hotel with single, double, 3-bed, and 4-bed rooms. For the singles I give the actual number of available rooms whilst for the rest I only give colours, say red for 0 or 1 room, yellow between 2 and 5 and green for more than 5.
  

Carsten&&The Houseman&&"Smiling improves your face value"&&"A Clean House is a Sign of a Wasted Life"&&"Rather Big and Hard then Micro and Soft"
Back to top
 
IP Logged
 
Carl Underwood
Senior Member
Members
*****
Offline



Posts: 1351
Location: New Hampshire
Joined: Mar 11th, 2003
Re: Ues of Back/Fill colours for table view possib
Reply #11 - Jul 22nd, 2006 at 5:06pm
Print Post Print Post  
In that case, maybe you can use some static text in those elements, and apply a color to that text. Possibly, use "Double" in the doubles column, and let programming color it based on the number that are available; use "3-Bed" in the 3-bed column, etc.
  


Carl Underwood
CDU Computer Consulting LLC
Epsom, New Hampshire
Back to top
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: Ues of Back/Fill colours for table view possib
Reply #12 - Jul 22nd, 2006 at 7:26pm
Print Post Print Post  
Bob_Hansen wrote on Jul 20th, 2006 at 8:01pm:
i seem to recall that perhaps Version 2 would have more tools for TableView, will these be among those new features?


While not strictly a TableView feature, I have added a new programming event: "On Draw". Programming can be placed in the "On Draw" event to, for example, change the color of a table cell based on that cell's value.
  

Mark Lasersohn&&Programmer&&Lantica Software, LLC
Back to top
IP Logged
 
Carl Underwood
Senior Member
Members
*****
Offline



Posts: 1351
Location: New Hampshire
Joined: Mar 11th, 2003
Re: Ues of Back/Fill colours for table view possib
Reply #13 - Jul 22nd, 2006 at 7:48pm
Print Post Print Post  
Mark,

Very slick! Cool

This will be a handy feature for making things in TableView stand out that might be missed by a user.

  


Carl Underwood
CDU Computer Consulting LLC
Epsom, New Hampshire
Back to top
IP Logged
 
carsten
Junior Member
**
Offline


Carpe Diem

Posts: 74
Location: Germany
Joined: Aug 24th, 2005
Re: Ues of Back/Fill colours for table view possib
Reply #14 - Jul 27th, 2006 at 10:00am
Print Post Print Post  
Mark,

Want it, want it!  Wink

This will certainly be solving my problem. Any idea when 2.0 is available?

Thanks
Carsten
  

Carsten&&The Houseman&&"Smiling improves your face value"&&"A Clean House is a Sign of a Wasted Life"&&"Rather Big and Hard then Micro and Soft"
Back to top
 
IP Logged