Re: Goofy question about Datagrids

2016-11-05 Thread Sri
Bob Sneidar-2 wrote
> Well I discovered that what you CANNOT do is call a user-defined command
> or function that has not been loaded yet, as in a front or back script
> that has not been inserted yet. If I do, when I open the stack I get an
> error. I suppose I could do the inserts in a preopen handler, but the
> scripts are contained in buttons in the stack that is not open yet. Not
> sure how that would play out.
> 
> Bob S

Bob,

May be I have not understood what you are trying to do, but a user-defined
function in the same script as the FillinData handler of the column in
question works perfectly for me.

<http://runtime-revolution.278305.n4.nabble.com/file/n4710097/before.png> 
Above is the original phone number format. I tried to convert it by adding
an fConvert function in the column behavior of the "Phone" column, as
follows:

on FillInData pData
   -- set the text of field 1 of me to pData
   set the text of field 1 of me to fConvert(pData)
 end FillInData
 
function fConvert pData
   set the itemDel to "-"
   return "(" & item 1 of pData & ")" &&  (item 2 of pData) && (item 3 of
pData)
end fConvert

It works perfectly; here's the image.

<http://runtime-revolution.278305.n4.nabble.com/file/n4710097/after.png> 

I hope the images show in the post (My post wouldn't make any sense
otherwise!)

Regards,
Sri




--
View this message in context: 
http://runtime-revolution.278305.n4.nabble.com/Goofy-question-about-Datagrids-tp4709954p4710097.html
Sent from the Revolution - User mailing list archive at Nabble.com.

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


Re: Goofy question about Datagrids

2016-11-04 Thread dunbarx
Hi.

Can you do it with the "startUp" message?

Craig



--
View this message in context: 
http://runtime-revolution.278305.n4.nabble.com/Goofy-question-about-Datagrids-tp4709954p4710092.html
Sent from the Revolution - User mailing list archive at Nabble.com.

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


Re: Goofy question about Datagrids

2016-11-04 Thread Bob Sneidar
Well I discovered that what you CANNOT do is call a user-defined command or 
function that has not been loaded yet, as in a front or back script that has 
not been inserted yet. If I do, when I open the stack I get an error. I suppose 
I could do the inserts in a preopen handler, but the scripts are contained in 
buttons in the stack that is not open yet. Not sure how that would play out.

Bob S


On Nov 2, 2016, at 16:30 , Sri > 
wrote:

Hi Bob:

Make it

set the text of field 1 of me to 

just to be sure. You can have a group of more than one object in the cell.

Regards,
Sri

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


Re: Goofy question about Datagrids

2016-11-02 Thread Sri
Hi Bob:

Make it 

set the text of field 1 of me to 

just to be sure. You can have a group of more than one object in the cell.

Regards,
Sri




--
View this message in context: 
http://runtime-revolution.278305.n4.nabble.com/Goofy-question-about-Datagrids-tp4709954p471.html
Sent from the Revolution - User mailing list archive at Nabble.com.

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


Re: Goofy question about Datagrids

2016-11-02 Thread Bob Sneidar
Thanks I'll give that a try.

Bob S


On Nov 2, 2016, at 13:21 , Sri > 
wrote:

on FillinData pData
 set the text of me to fConvert(pData)
end FillinData

function fConvert pDate
 /*convert the original format to display format*/
end fConvert

Regards,
Sri

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


Re: Goofy question about Datagrids

2016-11-02 Thread Sri
Bob Sneidar-2 wrote
> I store datetime data in "international" format, but I want to display it
> in a kind of short date/time format. .. I would need to
> display a value one way while leaving the underlying format as is.
> 
> Bob S

on FillinData pData
  set the text of me to fConvert(pData)
end FillinData

function fConvert pDate
  /*convert the original format to display format*/
end fConvert

Regards,
Sri



--
View this message in context: 
http://runtime-revolution.278305.n4.nabble.com/Goofy-question-about-Datagrids-tp4709954p4709998.html
Sent from the Revolution - User mailing list archive at Nabble.com.

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


Re: Goofy question about Datagrids

2016-11-02 Thread dunbarx
DG's have individual fields at each "cell". You could store any custom
formats representing the displayed values in a custom property of the
relevant field, and extract that string instead of the visible one.

Of course, this could be managed in the group script as well, since those
fields respond to "the target". It is all made in LC, after all.

Craig



--
View this message in context: 
http://runtime-revolution.278305.n4.nabble.com/Goofy-question-about-Datagrids-tp4709954p4709997.html
Sent from the Revolution - User mailing list archive at Nabble.com.

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


Re: Goofy question about Datagrids

2016-11-02 Thread Bob Sneidar
This is something I want to look into. I store datetime data in "international" 
format, but I want to display it in a kind of short date/time format. Currently 
I run the datagrid array through some functions for doing that, but it might be 
advantageous to have the datagrid library do this for me. Trick is, I need to 
reconvert it going back out, so I would need to display a value one way while 
leaving the underlying format as is.

Bob S


On Nov 2, 2016, at 10:21 , Sri > 
wrote:

2. Individual columns can be populated using their own rules (FillinData).
Thus, it is possible, say, to color a row green if the email column of the
row data contains "richmond"

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


Re: Goofy question about Datagrids

2016-11-02 Thread Sri
1. The underlying data structure is in the form of an array (dgData). So,
anytime there is frequent access to edit, calculate, and re-display results,
array will have an edge over list. This would be even better if LC
introduced additional array manipulation commands such as (multidimensional)
matrix multiplication, etc.

2. Individual columns can be populated using their own rules (FillinData).
Thus, it is possible, say, to color a row green if the email column of the
row data contains "richmond"

3. Since you can have buttons, checkboxes, images, graphics, etc., in a cell
(not just text), you can have different tools show up in a cell (column-row)
depending on the value of an entry in a different cell in that row.

4. All this with DG table. DG form can do much more, but is not comparable
to a spreadsheet and so is not relevant to your query.

Regards,
Sri



--
View this message in context: 
http://runtime-revolution.278305.n4.nabble.com/Goofy-question-about-Datagrids-tp4709954p4709993.html
Sent from the Revolution - User mailing list archive at Nabble.com.

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


Re: Goofy question about Datagrids

2016-11-02 Thread Roger Eller
If you want to total a column in a simple table field, assuming column 8,
this is my long-winded approach.

on mouseUp
   set the itemDel to TAB
   constant tColumn = 8
   constant tFieldName = "myFakeSpreadsheet"
   put the number of lines of fld tFieldName into tLineCount
   if line -1 of fld tFieldName contains "TOTALS:" then
  delete line -1 of fld tFieldName
  put cr & "TOTALS:" after fld tFieldName
   else
  put cr & "TOTALS:" after fld tFieldName
   end if
   repeat for each line thisLine in fld tFieldName
  put item tColumn of thisLine & comma after tListOfNumbers
   end repeat
   put sum(tListOfNumbers) into tTotal
   put tTotal into item tColumn of line -1 of fld tFieldName
end mouseUp

~Roger


On Wed, Nov 2, 2016 at 11:31 AM, Bob Sneidar 
wrote:

> It's my impression that Datagrids make terrible spreadsheets as is. But so
> does the table field. A LOT of work has to be done on both to get them to
> act like a spreadsheet. As it turns out, a spreadsheet is a quite
> complicated thing to implement. If you intend to do calculations, then
> there is a whole layer of vast complexity unto itself. Relative vs.
> absolute references? Mixed references? What happens when you insert a cell,
> row or column? Can you paste data in? How will it format?
>
> I can't believe you are shooting for all this complexity, but rather are
> only trying to create a way to display, and perhaps manipulate tabular
> data. In that case, I'd go with the table field.
>
> Bob S
>
>
> > On Nov 1, 2016, at 12:29 , Richmond  wrote:
> >
> > Possibly . . .
> >
> > But what I really meant was "what advantage does a datagrid have over a
> tableField vis-a-vis
> > spreadsheet handling?"
> >
> > Sorry; finding it rather difficult to formulate an uneasy feeling I've
> had about datagrids ever
> > since they were first introduced.
> >
> > Richmond.
> >
>
>
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Goofy question about Datagrids

2016-11-02 Thread Bob Sneidar
It's my impression that Datagrids make terrible spreadsheets as is. But so does 
the table field. A LOT of work has to be done on both to get them to act like a 
spreadsheet. As it turns out, a spreadsheet is a quite complicated thing to 
implement. If you intend to do calculations, then there is a whole layer of 
vast complexity unto itself. Relative vs. absolute references? Mixed 
references? What happens when you insert a cell, row or column? Can you paste 
data in? How will it format? 

I can't believe you are shooting for all this complexity, but rather are only 
trying to create a way to display, and perhaps manipulate tabular data. In that 
case, I'd go with the table field. 

Bob S


> On Nov 1, 2016, at 12:29 , Richmond  wrote:
> 
> Possibly . . .
> 
> But what I really meant was "what advantage does a datagrid have over a 
> tableField vis-a-vis
> spreadsheet handling?"
> 
> Sorry; finding it rather difficult to formulate an uneasy feeling I've had 
> about datagrids ever
> since they were first introduced.
> 
> Richmond.
> 


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


Re: Goofy question about Datagrids

2016-11-02 Thread jameshale
Interestingly I actually wasn't aware of LC's table field when I was working
on the interface of my current app. Given all my previous work with LC was
really about utilities that acted on something external and produced
something external to the stack. Indeed I rarely made standalones being
quite happy to use my tools while in the IDE.
When I did think of the table field I saw it as nothing more than a way to
display tab delimited text.

Where I have needed to use a table "like" field I have also wanted to have
something more than just text involved.
For example, a checkbox or a radio button. An image or some other control
associated with a line of the table.

The data grid makes this really quite easy, once you get your head around
it.

It is really useful to go through the examples in the Data Grid guide (the
one included with LC 8.1+, not the one on the LC web site) and just follow
along. The examples should all work as they had to be tested in order to
create the images to match LC8+'s IDE. It is really worthwhile and doing
them, rather than just reading through them takes a lot of the mystery out
of the Data Grid and makes you appreciate what a phenomenal job Trevor did
in creating it.



--
View this message in context: 
http://runtime-revolution.278305.n4.nabble.com/Goofy-question-about-Datagrids-tp4709954p4709976.html
Sent from the Revolution - User mailing list archive at Nabble.com.

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


Re: Goofy question about Datagrids

2016-11-02 Thread BNig
Mike Kerner wrote
> N00bs should also check out modTableField and tableLab (Bernd and Scott,
> respectively)
> http://berndniggemann.on-rev.com/modTableField/modTableField_0_1_9.livecode.zip
> http://forums.livecode.com/download/file.php?id=5458=672cdd04a95bc2c80430bc1bc88b7470


For modTableField I recommend version 0.3.2

http://berndniggemann.on-rev.com/modTableField/modTableField_0_3_2.zip

Kind regards
Bernd



--
View this message in context: 
http://runtime-revolution.278305.n4.nabble.com/Goofy-question-about-Datagrids-tp4709954p4709974.html
Sent from the Revolution - User mailing list archive at Nabble.com.

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


Re: Goofy question about Datagrids

2016-11-01 Thread dunbarx
Richmond.

Very little, in the narrow sense that you ask the question. They are both
tab and return delimited data gadgets. In a table field, like any field, you
just put in formatted text. In a DG, you set the dgText (or dgData).

At the very lowest level of increased functionality, or at least display
nicety, DG's automatically display alternate row colors. I had to script
this long ago, with scrolling, before I got my feet wet with DG's.

And I think you know just a little about how much farther you can go with a
DG if you want to get fancy. Table fields are pretty much WYSIWYG.

Craig



--
View this message in context: 
http://runtime-revolution.278305.n4.nabble.com/Goofy-question-about-Datagrids-tp4709954p4709967.html
Sent from the Revolution - User mailing list archive at Nabble.com.

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


Re: Goofy question about Datagrids

2016-11-01 Thread Richmond

Possibly . . .

But what I really meant was "what advantage does a datagrid have over a 
tableField vis-a-vis

spreadsheet handling?"

Sorry; finding it rather difficult to formulate an uneasy feeling I've 
had about datagrids ever

since they were first introduced.

Richmond.

On 1.11.2016 21:15, Peter TB Brett wrote:

On 01/11/2016 18:29, Richmond wrote:

What advantage has a datagrid over a tableField?


You can build each row of datagrid using any controls or widgets.

Peter




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


Re: Goofy question about Datagrids

2016-11-01 Thread Mike Kerner
N00bs should also check out modTableField and tableLab (Bernd and Scott,
respectively)
http://berndniggemann.on-rev.com/modTableField/modTableField_0_1_9.livecode.zip
http://forums.livecode.com/download/file.php?id=5458=672cdd04a95bc2c80430bc1bc88b7470

On Tue, Nov 1, 2016 at 3:15 PM, Peter TB Brett 
wrote:

> On 01/11/2016 18:29, Richmond wrote:
>
>> What advantage has a datagrid over a tableField?
>>
>
> You can build each row of datagrid using any controls or widgets.
>
> Peter
>
> --
> Dr Peter Brett 
> LiveCode Technical Project Manager
>
> lcb-mode for Emacs: https://github.com/peter-b/lcb-mode
>
>
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>



-- 
On the first day, God created the heavens and the Earth
On the second day, God created the oceans.
On the third day, God put the animals on hold for a few hours,
   and did a little diving.
And God said, "This is good."
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Goofy question about Datagrids

2016-11-01 Thread Peter TB Brett

On 01/11/2016 18:29, Richmond wrote:

What advantage has a datagrid over a tableField?


You can build each row of datagrid using any controls or widgets.

Peter

--
Dr Peter Brett 
LiveCode Technical Project Manager

lcb-mode for Emacs: https://github.com/peter-b/lcb-mode

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


Re: Goofy question about Datagrids

2016-11-01 Thread Roger Eller
Hi Richmond,

I'll give you an 'improperly formulated' explanation of my own experience
with datagrids.  They are more complicated to use (at first).  So most of
the time I still use a table field for everything except where the nice
appearance of a datagrid gives the design a polished and professional
look.  The alternating row color is pleasing to the eye, and practical for
viewing 'wide' data.  Functionally, a datagrid is easier to rearrange
column order than a roll-your-own table script.  I'm sure there are
datagrid advocates, but I still like the simplicity of the table field for
most things.

~Roger


On Tue, Nov 1, 2016 at 2:29 PM, Richmond 
wrote:

> What advantage has a datagrid over a tableField?
>
> I would be very grateful indeed for a properly formulated
> explanation.
>
> Richmond.
>
>
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Goofy question about Datagrids

2016-11-01 Thread Richmond

What advantage has a datagrid over a tableField?

I would be very grateful indeed for a properly formulated
explanation.

Richmond.

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