Normal Topic readonly states (Read 515 times)
olddog
Member
*
Offline



Posts: 35
Joined: Jan 19th, 2008
readonly states
Jan 28th, 2008 at 12:59am
Print Post Print Post  
wonder if i am missing something.  i want to turn elements back and forth from read only gray to read only not gray.  not gray to gray no problem.  gray to not gray i find i need  go through not read only on the way.  i am doing this via programing.  i have this in the on form entry action of one of the elements to manipulate the appearance and content of a group of elements
  

trying to learn a new trick
Back to top
 
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: readonly states
Reply #1 - Jan 28th, 2008 at 1:49pm
Print Post Print Post  
May I see the code you are using to do this, please?
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
olddog
Member
*
Offline



Posts: 35
Joined: Jan 19th, 2008
Re: readonly states
Reply #2 - Jan 30th, 2008 at 2:17am
Print Post Print Post  
here is the code from the on form entry of the unbound text box on the form
i have the xresultsetclose is in the on form exit.  i want to keep  the result set available for the case when the size of the set is larger the the 10 spots on the form.  i have a pair of buttons to move up and down thru the list.

Code
Select All
#include "sbasic_include.sbas"

var saPrereq as string
var iDisplayNum as int
var iLoop as int
var iNumOfRecords as int

//turn off scroll buttons and gray out lists
readonly(le2,1)
readonly(le11,1)
readonly(le46,1)
readonly(le47,1)
for iloop = 1 to 10
	setthiselement("prereqpriority"+iloop)
	readonly(thiselement,1)
	setthiselement("prereqcategory"+iloop)
	readonly(thiselement,1)
	setthiselement("prereqitem"+iloop)
	readonly(thiselement,1)
	setthiselement("prereqdesc"+iloop)
	readonly(thiselement,1)
	setthiselement("wjpriority"+iloop)
	readonly(thiselement,1)
	setthiselement("wjcategory"+iloop)
	readonly(thiselement,1)
	setthiselement("wjitem"+iloop)
	readonly(thiselement,1)
	setthiselement("wjdesc"+iloop)
	readonly(thiselement,1)
next
// create result of prerequisites
if prerequisite <>"" then
{
	if prereqprereq <>"" then
	{
		saPrereq = Prerequisite +";"+prereqprereq
	}
	else
	{
		saPrereq = Prerequisite
	}
	hprereq=@xresultsetsearch(@fn,"To Do List",SEARCH_MODE_AND, SEARCH_SYNTAX_QA,"!Priority="+saPrereq)
	if hprereq > -1 then    //if jobs are waiting display up to first 10
	{
		iNumOfRecords = @XResultSetTotal(hprereq)
		if iNumOfRecords > 10 then
		{
			iDisplayNum=10
			readonly(le11,0)
		}
		else
		{
			iDisplayNum = iNumofRecords
			//grey out unused
			for iloop = idisplaynum +1 to 10
				setthiselement("prereqpriority"+iloop)
				readonly(thiselement,1)
				setthiselement("prereqcategory"+iloop)
				readonly(thiselement,1)
				setthiselement("prereqitem"+iloop)
				readonly(thiselement,1)
				setthiselement("prereqdesc"+iloop)
				readonly(thiselement,1)
			next
		}
		for iLoop = 1 to iDisplayNum
			XResultSetCurrentPosition(hprereq, iLoop)
			setthiselement("prereqpriority"+iloop)
			readonly(thiselement,0)
			readonly(thiselement,2)
			thiselement = @XResultSetValue(hprereq, "Priority")
			setthiselement("prereqcategory"+iloop)
			readonly(thiselement,0)
			readonly(thiselement,2)
			thiselement = @XResultSetValue(hprereq, "Category")
			setthiselement("prereqitem"+iloop)
			readonly(thiselement,0)
			readonly(thiselement,2)
			thiselement = @XResultSetValue(hprereq, "Item")
			setthiselement("prereqdesc"+iloop)
			readonly(thiselement,0)
			readonly(thiselement,2)
			thiselement = @XResultSetValue(hprereq, "Description")
		next
	}
}
//create result set of wating jobs
hWaitJob=@xresultsetsearch(@fn,"To Do List",SEARCH_MODE_AND, SEARCH_SYNTAX_QA,"!Prerequisite="+priority)
if hWaitJob > -1 then    //if jobs are waiting display up to first 10
{
	iNumOfRecords = @XResultSetTotal(hWaitJob)
	if iNumOfRecords > 10 then
	{
		iDisplayNum=10
		readonly(le11,0)
	}
	else
	{
		iDisplayNum = iNumofRecords
		//grey out unused
		for iloop = idisplaynum +1 to 10
			setthiselement("wjpriority"+iloop)
			readonly(thiselement,1)
			setthiselement("wjcategory"+iloop)
			readonly(thiselement,1)
			setthiselement("wjitem"+iloop)
			readonly(thiselement,1)
			setthiselement("wjdesc"+iloop)
			readonly(thiselement,1)
		next
	}
	for iLoop = 1 to iDisplayNum
		XResultSetCurrentPosition(hWaitJob, iLoop)
		setthiselement("wjpriority"+iloop)
		readonly(thiselement,0)
		readonly(thiselement,2)
		thiselement = @XResultSetValue(hWaitJob, "Priority")
		setthiselement("wjcategory"+iloop)
		readonly(thiselement,0)
		readonly(thiselement,2)
		thiselement = @XResultSetValue(hWaitJob, "Category")
		setthiselement("wjitem"+iloop)
		readonly(thiselement,0)
		readonly(thiselement,2)
		thiselement = @XResultSetValue(hWaitJob, "Item")
		setthiselement("wjdesc"+iloop)
		readonly(thiselement,0)
		readonly(thiselement,2)
		thiselement = @XResultSetValue(hWaitJob, "Description")
	next
}
 

  

trying to learn a new trick
Back to top
 
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: readonly states
Reply #3 - Jan 30th, 2008 at 2:14pm
Print Post Print Post  
I see it too. We'll look into it.

On another note, you may want to take a look at a command called StringArrayAttributes(). It looks like it will save you quite a bit of code. In general, the Attribute command family is preferred over the older commands that address individual properties only. There is a list of these on page 133 of the Sesame 2.0 Programming Guide.
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged