Normal Topic Permanent font color (Read 1370 times)
Calibrate1
Member
*
Offline



Posts: 38
Location: Dayton, OH
Joined: Jun 28th, 2006
Permanent font color
Dec 27th, 2007 at 4:27pm
Print Post Print Post  
I am using Sesame version 2.0.4 and I have incorporated the calendar that Ray created into my application. 

I use the calendar to schedule our on-site jobs at our client's facility.  I have added programming that will change the font color depending on whether the schedule is confirmed, or it is tentative.  I used the RGBColor command to change the font, but as soon as I exit that form, and re-enter the form, the font changes are removed. 

Is there a way to permanently have the font colors change?

Thank so much for your input!!!
  
Back to top
 
IP Logged
 
Carl Underwood
Senior Member
Members
*****
Offline



Posts: 1351
Location: New Hampshire
Joined: Mar 11th, 2003
Re: Permanent font color
Reply #1 - Dec 27th, 2007 at 5:25pm
Print Post Print Post  
Put the code that you are using to change the colors, into a subroutine in the Global Code event. Then, place that subroutine in the form On Form Change and the On Form Entry events.

If you had that code located somewhere different than one of these two events (i.e. maybe a command button), then place the subroutine there too.

This should take care of changing the colors each time you enter a record or modify it.
  


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



Posts: 38
Location: Dayton, OH
Joined: Jun 28th, 2006
Re: Permanent font color
Reply #2 - Dec 27th, 2007 at 5:42pm
Print Post Print Post  
Here is the code I am using:

In Global Code =
Code
Select All
#include "sbasic_include.sbas"

stat vFont as String

Subroutine Confirmation()
UnSetThisElement()

If @IsBlank(ThisElement) = False
{
	If @AskUser("Has this scheduled date been confirmed by the client?", "", "")
	{
		RGBColor(ThisElement, 0, 0, 0, 255, 255, 255)		// Black font for confirmed
	}
	Else If ThisElement = "Holiday"
	{
		RGBColor(ThisElement, 255, 0, 0, 255, 255, 255)		// Red font for holidays
	}
	Else
	{
		RGBColor(ThisElement, 0, 255, 0, 255, 255, 255)		// Green font for tentative
	}

	Attribute(ThisElement, ATTR_ID_FONT, "BArial")			// Make font bold
	FormCommit("")
}

End Subroutine
 



Then "On Element Exit" of each day (text area) I have the subroutine called. 

This allows me to enter data for a particular day, and have the control to modify each day's text without affecting the other days.

Although, I really appreciate the response, will using the ON FORM events allow me this flexibility and control of each day?
  
Back to top
 
IP Logged
 
Carl Underwood
Senior Member
Members
*****
Offline



Posts: 1351
Location: New Hampshire
Joined: Mar 11th, 2003
Re: Permanent font color
Reply #3 - Dec 27th, 2007 at 6:27pm
Print Post Print Post  
Calibrate1 wrote on Dec 27th, 2007 at 5:42pm:
Although, I really appreciate the response, will using the ON FORM events allow me this flexibility and control of each day?

Ah, I didn't realize you were changing the colors based on interactive answers by the user.

You will probably need to store the effect of the answer (e.g. Black, Red, Green) in a hidden field for each day, and then use a loop in a subroutine that cycles through each day and stored answer to determine what color to apply. This subroutine could then be placed in the On Form Entry event.


  


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



Posts: 38
Location: Dayton, OH
Joined: Jun 28th, 2006
Re: Permanent font color
Reply #4 - Dec 27th, 2007 at 6:58pm
Print Post Print Post  
Thank you!!! 

I'll need to do some formatting and programming changes.  I'll get it done eventually.  Thank you so much for the suggestions.

  
Back to top
 
IP Logged
 
Louis Galvao
Full Member
***
Offline


"Sufferin' Succatash"

Posts: 265
Location: Canada
Joined: Feb 14th, 2005
Re: Permanent font color/Schedule Calendar
Reply #5 - Jun 18th, 2008 at 8:44pm
Print Post Print Post  
Is there a sample of this Schedule Calendar anywhere in the forum???

Thanks,

Louis Galvao
  

Louis Galvao
Back to top
 
IP Logged
 
Ben
Lantica Support
*****
Offline



Posts: 218
Joined: Apr 7th, 2005
Re: Permanent font color/Schedule Calendar
Reply #6 - Jun 18th, 2008 at 8:46pm
Print Post Print Post  
Quote:
Is there a sample of this Schedule Calendar anywhere in the forum???

http://lantica.com/Files/SampleApps/Calendar.zip
  
Back to top
IP Logged
 
Louis Galvao
Full Member
***
Offline


"Sufferin' Succatash"

Posts: 265
Location: Canada
Joined: Feb 14th, 2005
Re: Permanent font color
Reply #7 - Jun 18th, 2008 at 9:25pm
Print Post Print Post  
Thanks for the link.  Calendar works well.  Need to investigate it to determine if I can use something like this with 60 plus people scheduled on client engagements for different periods of time.

Louis
  

Louis Galvao
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: Permanent font color
Reply #8 - Jun 19th, 2008 at 1:12pm
Print Post Print Post  
You would just need to have another field on the form that is hidden and automatically populated with each person's name or ID. Set it up so each person can only get their own records. And switch the system that makes the new month from GlobalValues to an X command to see what the latest month that person has in the system.

-Ray
  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
Back to top
IP Logged