Re: data grid code (color)

2009-05-01 Thread Sadhunathan Nadesan
3rd try - 

Trevor,

Your help is requested once more .. I'm stuck.  I've been trying to
find a way to apply color to a single cell (or even to one line) of
a data grid, with your example and every other combination or syntax
variation or other thing I can think of, no luck so far.

Can you suggest a line(s) of code to replace the one setting the background
color below? (the rest of the code works).

Again, I am in your debt.

Thank you,
Sadhu


repeat with whichLine = 1 to the dgNumberOfLines of group "data grid 1" of card 
"data grid card"

  put the dgIndexOfLine[whichLine] of group "data grid 1" of card "data grid 
card" into whichIndex  

  if (foundSSN) then
put employeeSSN into theCellContent
  else
put "SSN not found"  into theCellContent
## set the backgroundColor of graphic 1 of me to "red" - generates an error
  end if

  dispatch "SetDataOfIndex" to group "data grid 1" of card "data grid card" \
  with whichIndex, "col 9", theCellContent

end repeat
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: data grid code (color)

2009-05-01 Thread Sadhunathan Nadesan
Hi Trevor,

More info:

I am using the default template and not overriding the default column
behavior, and I am not using a custom column template as far as I know.

All I am doing is using a default data grid (with 9 columns, the only
thing I set was the column labels) and filling in the data in one gulp by
setting the dgtext of the group, and then, scanning through the data line
by line, and cell by cell to see if that cell holds a valid value, then
setting it to different text (such as 'not found') if it is not valid.

The repeat loop was the part doing the scan.

Are you saying, I either need to override the default behavior with a
script, or, create a customized column template?  I don't want every
cell red in every column, just selected cells in selected columns.
Is that possible?

If I need to refer to the lessons on creating override behavior I can
do that next.

Sorry to be  so dense.  I was hoping there was maybe something simple
like setting the color properties of a container variable with text
in it and then putting it into a specific cell of the data grid with
SetDataOfIndex or something like that.

Not so simple I guess?

Thank you again,
Sadhu

...



> If you are using the default template and overriding the 'default  
> column behavior' with your own script then your column consists of a  
> single field. In your FillInData handler for the column you could try  
> setting the backgroundColor of me to "red" and the opaque to true. If  
> there isn't an error than set the opaque to false.
> 
> If you customized the column template using the Property Inspector  
> then your column consists of a group with a single field in it. In  
> this case just target 'field 1 of me' rather than 'me'.
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: data grid code (color)

2009-05-01 Thread Sadhunathan Nadesan
Trevor,

Your help is requested once more .. I'm stuck.  I've been trying to
find a way to apply color to a single cell (or even to one line) of
a data grid, with your example and every other combination or syntax
variation or other thing I can think of, no luck so far.

Can you supply a line of code to replace the one setting the background
color below? (the rest of the code works).

Again, I am in your debt.

Thank you,
Sadhu


repeat with whichLine = 1 to the dgNumberOfLines of group "data grid 1" of card 
"data grid card"
  put the dgIndexOfLine[whichLine] of group "data grid 1" of card "data grid 
card" into whichIndex  
  if (foundSSN) then
dispatch "SetDataOfIndex" to group "data grid 1" of card "data grid card" \
  with whichIndex, "col 9", employeeSSN  
  else
dispatch "SetDataOfIndex" to group "data grid 1" of card "data grid card" \
  with whichIndex, "col 9", "Not Found"
## set the backgroundColor of graphic 1 of me to "red" - generates an error
  end if
end repeat

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: data grid code (color)

2009-04-18 Thread sadhu
Trevor,

You are right! It works.  I closed the ticket (marked not a bug).

Thank you again, very much.

Sadhu

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: data grid code (color)

2009-04-17 Thread Trevor DeVore

On Apr 17, 2009, at 7:10 PM, Sadhu Nadesan wrote:

To the fillindata handler, add some code to change the color  
depending on the contents of the cell.  Like this


on FillInData pData
 -- This message is sent when the Data Grid needs to populate
 -- this template with the column data. pData is the value to be  
displayed.

  -- Example:
 set the text of field 1 of me to pData
 if (pData contains "foo") then
set the backgroundcolor of field 1 of me to "red"
 end if
end FillInData

Now run your stack.  put 'bar" in column 2, by clicking the populate  
button and answering bar.  Nothing should happen.  Now do it again  
and answer foo.  Again, nothing happens, but the foo cells were  
expected to be red.


Trevor, is my error obvious to the master?  What have I left out!


Your field is transparent so setting the color won't show up. Just set  
the opaque flag to true:


 if (pData contains "foo") then
set the backgroundcolor of field 1 of me to "red"
set the opaque of field 1 of me to true
 else
set the opaque of field 1 of me to false
 end if

I tried this in your test stack in the bug report and it worked.

Regards,

--
Trevor DeVore
Blue Mango Learning Systems
www.bluemangolearning.com-www.screensteps.com
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: data grid code (color)

2009-04-17 Thread Sadhu Nadesan

Trevor

Stack attached to bug 7972.

Big mahalo,
Sadhu


Sadhu Nadesan wrote:
Note that you may also double click on a cell and edit it directly, 
and again, the expected behavior is, if you type foo, it turns red.  
The refreshlist command is supposed to be called upon editing but I 
added this as a separate button choice just in case, didn't help.



 

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: data grid code (color)

2009-04-17 Thread Sadhu Nadesan
Note that you may also double click on a cell and edit it directly, and 
again, the expected behavior is, if you type foo, it turns red.  The 
refreshlist command is supposed to be called upon editing but I added 
this as a separate button choice just in case, didn't help.



Sadhu Nadesan wrote:

Trevor

You said, let you know.  Ok!

I must be doing something wrong, it doesn't seem to work.  On the 
other hand I did vary slightly from your instructions.  I will file 
this as a bug report so I can include a sample stack and screen shots.


Context

The goal is to add a custom behavior that will turn certain cells 
color upon a certain condition.


Problem

Attempting to apply the example logic in practice, nothing happens, no 
color change.


How to Duplicate This Problem

Create a new stack, very simple, with 2 objects, a populate button, 
and a data grid with 3 columns, with default names, that is group 
"datagrid", and columns "col 1", col 2", and "col 3".  Populate a few 
rows, say 3,  using the contents pane of the property inspector.


The populate button has this code  (assuming you haven't resorted, the 
row numbers and index numbers are the same)


on mouseUp
  ask "Pattern?"
  put it into thePattern
  repeat with rownum = 1 to 3
 dispatch "setdataofindex" to group "datagrid" with rownum, "Col 
2", thePattern

  end repeat
  dispatch "RefreshList" to group "datagrid"
end mouseUp


Note that the refreshlist call at the end is necessary or you won't 
see any changes.The above will let you change the contents of 
column 2, the first 3 rows.


Next, select the data grid and using the property inspector, and in 
the columns choice, highlight col 2, then use the plus button at the 
bottom and then click column behavior to begin editing the custom 
behavior for this column.


To the fillindata handler, add some code to change the color depending 
on the contents of the cell.  Like this


on FillInData pData
  -- This message is sent when the Data Grid needs to populate
  -- this template with the column data. pData is the value to be 
displayed.
 
  -- Example:

  set the text of field 1 of me to pData
  if (pData contains "foo") then
 set the backgroundcolor of field 1 of me to "red"
  end if
end FillInData

Now run your stack.  put 'bar" in column 2, by clicking the populate 
button and answering bar.  Nothing should happen.  Now do it again and 
answer foo.  Again, nothing happens, but the foo cells were expected 
to be red.



Trevor, is my error obvious to the master?  What have I left out!

Grateful thanks,
Sadhu





Sadhu Nadesan wrote:

Wow, Trevor, you are the MAN!  MAHALO!  I will check it out right away.

You should be able to get this working without too much trouble. 
I've  added a lesson to the manual that discusses how you can 
quickly  override the default column behavior for a data grid table. 
There are  two samples at the end of the lesson, one of which shows 
how to color  a cell.





Let me know if this helps.

Regards,
  

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: data grid code (color)

2009-04-17 Thread Sadhu Nadesan

Trevor

You said, let you know.  Ok!

I must be doing something wrong, it doesn't seem to work.  On the other 
hand I did vary slightly from your instructions.  I will file this as a 
bug report so I can include a sample stack and screen shots.


Context

The goal is to add a custom behavior that will turn certain cells color 
upon a certain condition.


Problem

Attempting to apply the example logic in practice, nothing happens, no 
color change.


How to Duplicate This Problem

Create a new stack, very simple, with 2 objects, a populate button, and 
a data grid with 3 columns, with default names, that is group 
"datagrid", and columns "col 1", col 2", and "col 3".  Populate a few 
rows, say 3,  using the contents pane of the property inspector.


The populate button has this code  (assuming you haven't resorted, the 
row numbers and index numbers are the same)


on mouseUp
  ask "Pattern?"
  put it into thePattern
  repeat with rownum = 1 to 3
 dispatch "setdataofindex" to group "datagrid" with rownum, "Col 
2", thePattern

  end repeat
  dispatch "RefreshList" to group "datagrid"
end mouseUp


Note that the refreshlist call at the end is necessary or you won't see 
any changes.The above will let you change the contents of column 2, 
the first 3 rows.


Next, select the data grid and using the property inspector, and in the 
columns choice, highlight col 2, then use the plus button at the bottom 
and then click column behavior to begin editing the custom behavior for 
this column.


To the fillindata handler, add some code to change the color depending 
on the contents of the cell.  Like this


on FillInData pData
  -- This message is sent when the Data Grid needs to populate
  -- this template with the column data. pData is the value to be 
displayed.
 
  -- Example:

  set the text of field 1 of me to pData
  if (pData contains "foo") then
 set the backgroundcolor of field 1 of me to "red"
  end if
end FillInData

Now run your stack.  put 'bar" in column 2, by clicking the populate 
button and answering bar.  Nothing should happen.  Now do it again and 
answer foo.  Again, nothing happens, but the foo cells were expected to 
be red.



Trevor, is my error obvious to the master?  What have I left out!

Grateful thanks,
Sadhu





Sadhu Nadesan wrote:

Wow, Trevor, you are the MAN!  MAHALO!  I will check it out right away.

You should be able to get this working without too much trouble. 
I've  added a lesson to the manual that discusses how you can 
quickly  override the default column behavior for a data grid table. 
There are  two samples at the end of the lesson, one of which shows 
how to color  a cell.





Let me know if this helps.

Regards,
  

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: data grid code (color)

2009-04-17 Thread Sadhu Nadesan

Wow, Trevor, you are the MAN!  MAHALO!  I will check it out right away.

You should be able to get this working without too much trouble. I've  
added a lesson to the manual that discusses how you can quickly  
override the default column behavior for a data grid table. There are  
two samples at the end of the lesson, one of which shows how to color  
a cell.





Let me know if this helps.

Regards,
  


___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: data grid code (color)

2009-04-16 Thread Trevor DeVore

On Apr 16, 2009, at 9:05 PM, Sadhu Nadesan wrote:


I am using the default template and not overriding the default column
behavior, and I am not using a custom column template as far as I  
know.


...
The repeat loop was the part doing the scan.

Are you saying, I either need to override the default behavior with a
script, or, create a customized column template?  I don't want every
cell red in every column, just selected cells in selected columns.
Is that possible?

...
Sorry to be  so dense.  I was hoping there was maybe something simple
like setting the color properties of a container variable with text
in it and then putting it into a specific cell of the data grid with
SetDataOfIndex or something like that.

Not so simple I guess?


You should be able to get this working without too much trouble. I've  
added a lesson to the manual that discusses how you can quickly  
override the default column behavior for a data grid table. There are  
two samples at the end of the lesson, one of which shows how to color  
a cell.





Let me know if this helps.

Regards,

--
Trevor DeVore
Blue Mango Learning Systems
www.bluemangolearning.com-www.screensteps.com
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: data grid code (color)

2009-04-16 Thread Sadhu Nadesan

(2nd try - yet another post that never made it the first time - sent with Mush, 
an old Unix text email program, no HTML as far as I know, trying again with 
Thunderbird choosing send in text only, fingers crossed)

Hi Trevor,

More info:

I am using the default template and not overriding the default column
behavior, and I am not using a custom column template as far as I know.

All I am doing is using a default data grid (with 9 columns, the only
thing I set was the column labels) and filling in the data in one gulp by
setting the dgtext of the group, and then, scanning through the data line
by line, and cell by cell to see if that cell holds a valid value, then
setting it to different text (such as 'not found') if it is not valid.

The repeat loop was the part doing the scan.

Are you saying, I either need to override the default behavior with a
script, or, create a customized column template?  I don't want every
cell red in every column, just selected cells in selected columns.
Is that possible?

If I need to refer to the lessons on creating override behavior I can
do that next.

Sorry to be  so dense.  I was hoping there was maybe something simple
like setting the color properties of a container variable with text
in it and then putting it into a specific cell of the data grid with
SetDataOfIndex or something like that.

Not so simple I guess?

Thank you again,
Sadhu

...




> If you are using the default template and overriding the 'default  
> column behavior' with your own script then your column consists of a  
> single field. In your FillInData handler for the column you could try  
> setting the backgroundColor of me to "red" and the opaque to true. If  
> there isn't an error than set the opaque to false.
> 
> If you customized the column template using the Property Inspector  
> then your column consists of a group with a single field in it. In  
> this case just target 'field 1 of me' rather than 'me'.
  

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: [Fwd: Re: data grid code (color)]

2009-04-15 Thread Trevor DeVore

On Apr 15, 2009, at 12:27 PM, Sadhu Nadesan wrote:


Resend - it appears this post never made it to the list?  trying again


Perhaps there was an issue because your original email had HTML?


Your help is requested once more .. I'm stuck.  I've been trying to
find a way to apply color to a single cell (or even to one line) of
a data grid, with your example and every other combination or syntax
variation or other thing I can think of, no luck so far.

Can you supply a line of code to replace the one setting the  
background

color below? (the rest of the code works).


If you are using the default template and overriding the 'default  
column behavior' with your own script then your column consists of a  
single field. In your FillInData handler for the column you could try  
setting the backgroundColor of me to "red" and the opaque to true. If  
there isn't an error than set the opaque to false.


If you customized the column template using the Property Inspector  
then your column consists of a group with a single field in it. In  
this case just target 'field 1 of me' rather than 'me'.


Does that work?

Regards,

--
Trevor DeVore
Blue Mango Learning Systems
ScreenSteps: http://www.screensteps.com
Developer Resources: http://revolution.bluemangolearning.com

Email has been scanned for viruses by Altman Technologies' email management 
service - www.altman.co.uk/emailsystems
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


[Fwd: Re: data grid code (color)]

2009-04-15 Thread Sadhu Nadesan

Resend - it appears this post never made it to the list?  trying again
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution

Re: data grid code (color)

2009-04-14 Thread Sadhu Nadesan
hmmm... it occurs to me I could shorten this code by putting either the 
ssn or 'not found' into a variable and then have the line calling the 
dispatch command appear only once .. but that is not relevant to the 
problem.  upon reading it i see it's just bulkier than it has to be.


Sadhunathan Nadesan wrote:


repeat with whichLine = 1 to the dgNumberOfLines of group "data grid 1" of card 
"data grid card"
  put the dgIndexOfLine[whichLine] of group "data grid 1" of card "data grid card" into whichIndex  
  if (foundSSN) then

dispatch "SetDataOfIndex" to group "data grid 1" of card "data grid card" \
  with whichIndex, "col 9", employeeSSN  
  else

dispatch "SetDataOfIndex" to group "data grid 1" of card "data grid card" \
  with whichIndex, "col 9", "Not Found"
## set the backgroundColor of graphic 1 of me to "red" - generates an error
  end if
end repeat
  

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution