Re: DataGrid question: Suggestions for further enhancements

2020-04-03 Thread Niggemann, Bernd via use-livecode
Roland wrote Thu, 02 Apr 2020 04:08:51 -0700:

Thank you Roland for your detailed list of possible improvements to 
modTableField


> + Selecting columns:
> 
> marking selected columns

I will have to think about that

> + Dragging and dropping columns and rows

presently it is possible to drag line = rows if you set

put true into pBool
dispatch "mtfAllowLineDragging" to group "modTableField 1" with pBool

Or set it from the helper stack tab "data"

You have to press the optionKey while dragging

Whereas you can extract columns from the data field but you can not set them 
nor drag them.
Again I will have to experiment to see how to eventually implement this.



> + Freezing rows and/or columns:

I am not sure what that is. Are you talking about a spreadsheet like behavior 
with fixed left column and top row?


> + Field display formats

For sorting you can specify the sort.
However until now I felt that the developer is in control of the format of the 
data.
A predetermined format for a column would mean a lot of error checking on data 
input. I am not sure if it is not better to leave that to the developer.

If you plan to use modTableField in a project feel free to email me and I can 
see if we can work out some modification.

Kind regards
Bernd
___
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: DataGrid question...

2020-04-03 Thread Niggemann, Bernd via use-livecode


> Bernard Devlin via use-livecode Fri, 03 Apr 2020 11:23:08 -0700
> Reminds me of the work of the late great Eric Chatonet


Thanks Bernhard for your kind words. But Eric is in my memory such a super 
coder and his code was crystal clear. Whereas my code is, um, less so.


> I see only one slight problem: after I click into a cell a trace of the I 
> beam is left behind on leaving the cell (this becomes visible on selecting 
> another row). I guess this is a LC bug. If I click away (e.g. on the 
> "examples" tabbed button) the trace vanishes. If I click on the column header 
> to sort and re-sort, the I beam trace is still there in the field in which I 
> clicked. If I click in the output field that also does not remove the I beam 
> vestige.


I am only using a Mac and I have never seen this. This must be something 
Windows 10 related. I do not have access to Windows 10.
I wonder if anyone has seen this on Windows 10?

Kind regards
Bernd
___
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: DataGrid question...

2020-04-03 Thread Bernard Devlin via use-livecode
Hi Bernd

Your modTableField is very impressive.  Reminds me of the work of the late,
great Eric Chatonet (author of many works on Hypercard).  I see only one
slight problem: after I click into a cell a trace of the I beam is left
behind on leaving the cell (this becomes visible on selecting another
row).  I guess this is a LC bug.  If I click away (e.g. on the "examples"
tabbed button) the trace vanishes.  If I click on the column header to sort
and re-sort, the I beam trace is still there in the field in which I
clicked. If I click in the output field that also does not remove the I
beam vestige.

But apart from that visual vestige, in 20 minutes of playing with mTF I was
very impressed.  BTW, in case you have not seen this yourself, this vestige
was visible for me with LC 9.5.1 on Windows 10.

Regards, Bernard

On Mon, Mar 30, 2020 at 10:44 PM Niggemann, Bernd via use-livecode <
use-livecode@lists.runrev.com> wrote:

>
> >Peter Bogdanoff wrote:
>
> >Does anyone have a link to obtain Bernd's modTableField ?
>
> Here is a link to the latest version of modifiedTableField
>
> berndniggemann.on-rev.com/mtf/modTableField.zip<
> http://berndniggemann.on-rev.com/mtf/modTableField.zip>
>
> there is a zip of a demo stack with a helper stack and a .rtf document
> with the API
>
> Use the demo stack to explore modTableField. Have a little patience to
> explore. It shows many options. Please have a look at the API document to
> get a feeling how to address and query modTableField.
>
> If you want to use modTableField in a project copy the group
> "modTableField 1" from the demo stack to your stack and use the API to work
> with it.
>
> This version is HTML5 safe. There was a superfluous wait in former
> versions. Hermann used tinyDict with his HTML5 demo of an IDE.
>
> tinyDictionary uses modTableField
>
> There are a couple of users that seem quite content with modTableField
> (thanks Jerry for mentioning it)
>
> I would be happy to know if anybody uses modTableField in a project.
> (aside from the people that mailed me before).
>
> If you have questions please feel free to email me.
>
> Kind regards
> Bernd
>
>
> ___
> 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: DataGrid question: Suggestions for further enhancements (Bob Sneidar)

2020-04-03 Thread Bob Sneidar via use-livecode
:-) I wasn’t arguing, just pointing out that before the data grid, the 
community was practically begging RunRev for  some kind of robust table object, 
BECAUSE the table field was so unwieldy. That others have found ways in the 
interim to enhance the table field is nothing short of astounding, and is a 
testament to both the robust nature of Livecode’s language, and the ingenuity 
of the developers who use it.

Just the other day I attempted to use a table field to display one row of 
columns from a database, and a second row of values. The columns and their 
respective values needed to be added or deleted based on a user selecting or 
deselecting the column from another list field, and added column/values always 
appended to the end of the list. I also wanted the user to be able to edit the 
values, but NOT the column names.

After about two hours of trying to get it to work, and running into all kinds 
of problems jumping through hoops and running into more problems, I scrapped it 
and used a data grid instead. Within half an hour I got it working.

If all you want is to display tabular data without much formatting needed and 
little to no editing, a table field is just what you need. If you want to 
format, edit, store and retrieve that data in a database, sort, filter, etc. 
then it’s my opinion that using a table field is going to cause more headache 
than it’s worth.

Bob S


On Apr 3, 2020, at 3:11 AM, R.H. via use-livecode 
mailto:use-livecode@lists.runrev.com>> wrote:

@ Bob S

Sure, you are right that the DG data grid supports most of what users might
wish to have.

My point was that there is a nice enhancement to the table field from Bernd
Niggemann and that it could even be further enhanced -- without arguing
about DG vs table field. Even if that would only be an exercise.

Would yor argument not also mean that you simple could skip the table
field? I still use it.

For a long time I have been using Filemaker as a database and application
tool. The ease of use in just dragging all kinds of objects to the portal
(similar to the data grid row template) is compelling in terms of user
friendliness. But there is  a DataGrid helper...  by
https://www.aslugontheroad.com/

So, maybe we could then argue about how the DG could be improved? )

Roland

___
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: DataGrid question: Suggestions for further enhancements (Bob Sneidar)

2020-04-03 Thread R.H. via use-livecode
@ Bob S

Sure, you are right that the DG data grid supports most of what users might
wish to have.

My point was that there is a nice enhancement to the table field from Bernd
Niggemann and that it could even be further enhanced -- without arguing
about DG vs table field. Even if that would only be an exercise.

Would yor argument not also mean that you simple could skip the table
field? I still use it.

For a long time I have been using Filemaker as a database and application
tool. The ease of use in just dragging all kinds of objects to the portal
(similar to the data grid row template) is compelling in terms of user
friendliness. But there is  a DataGrid helper...  by
https://www.aslugontheroad.com/

So, maybe we could then argue about how the DG could be improved? )

Roland
___
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: DataGrid question: Suggestions for further enhancements

2020-04-02 Thread Paul Dupuis via use-livecode

On 4/2/2020 10:35 AM, Bob Sneidar via use-livecode wrote:

As far as I am concerned, datagrids make table fields obsolete.

I agree.


___
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: DataGrid question: Suggestions for further enhancements

2020-04-02 Thread Bob Sneidar via use-livecode
Not to belabor the point, but why would the data grid be overkill in relation 
to a table field? In what way? Cell editing actually works great. Double click 
a cell and edit the contents. Finding and getting data is far easier in a data 
grid than in a table field.

dispatch findIndex to group “myGrid” with “firstname”, “Bob”
put the result into tIndex
put the dgDataOfIndex [tIndex] of group “myGrid” into aFoundRecord

Or if you MUST search text:

put the dgText of group “myGrid” into tText
put lineOffset(“Bob”, tText) into tFoundLine
put line tFoundLine of tText into tFoundRecord

I’m not understanding how this is more complicated than the hoops you have to 
jump through with a table field, which is incredibly unwieldy, cannot easily 
support cell and column text formatting and alignment, has different cell 
counts per row depending on the last cell you put data in, adds rows you may 
not want simply because you accidentally clicked the field…

As far as I am concerned, datagrids make table fields obsolete.

Bob S


On Apr 2, 2020, at 4:06 AM, R.H. via use-livecode 
mailto:use-livecode@lists.runrev.com>> wrote:

@Bernd Niggemann

The ModTableField is a great tool when the DG datagrid is an overkill. It
works very well for me. Thank you very much for the contribution, dear
Bernd.

___
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: DataGrid question: Suggestions for further enhancements

2020-04-02 Thread R.H. via use-livecode
@Bernd Niggemann

The ModTableField is a great tool when the DG datagrid is an overkill. It
works very well for me. Thank you very much for the contribution, dear
Bernd.

+ Selecting columns:

What I added was the possibility to also select columns (hilite columns)
which is done using an overlay graphic rect that automatically is adjusting
to the height of the and width of the column in the table field and sits on
top with a certain transparency. Well, of course, it also is a workaround
only and requires some scripting if users should be able to also edit cells
- mpt as easy as it sounds first. To select more than one column would then
require more than just one overlay rectangles.

Here it requires using some additional space for a selection handler on top
of each column since the current behaviour is to sort columns with
mouseDown/Up on column headers. Therefore, I would go by most standards
which is clicking on a column header selects the column, and there is an
additional icon to allow for sorting. The sorting type depends on the
content (column formats).

+ Dragging and dropping columns and rows

It would also be possible to move columns dragging and dropping them with
visual feedback. Here the known technique is in taking a screen shot of the
row or column, letting it attach to the mouse while moving, and creating an
insertion line for a column or row passing over rows/columns allowing users
to drop the selection wherever desired in the table field. To also allow
this in scrolling fields (letting the field scroll moving the mouse towards
the edges of the table field) requires quite some scripting.

+ Freezing rows and/or columns:

The other enhancement, as discussed here before, is to "freeze" 1..n
columns or rows. To my mind, this can only be done using separate fields
attached to the left or top of the table field. Again, such fields must
change size depending on the size of the basic table fields and they must
update quickly with changes and be in synchrony with the main table field.

+ Icons / images

Also nicely shown in the ModTableField. It is possible using SVG graphics
turned into an image to be used as the image source of a chracter? I think
it is, but never tried it yet.

+ Field display formats

Then there is a need to most developers setting the format of rows or
columns or individual cell to either text, date/time format, number format,
percentage, custom format and whatever. It would be a nice add-on to have
this available as a "standard" instead of each developer scripting his own.
I actually did this, but of course not in such a general way that it would
be using locales, support all international format and usable to everyone.

(I personally think that it should be a property of fields in general to
allow to set it's display format for text, date, time, number, etc. It
would be really great if there is a "display format" and a raw data storage
automatically -- no need for custom properties in such case. Since LC is
supporting the Android version of Filemaker, that is the property of fields
in Filemaker anyway.)

So, almost we end up scripting a data grid based on the table field)
Thanks to all contributions.

Enjoy ... Roland
___
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: DataGrid question...

2020-04-01 Thread Bob Sneidar via use-livecode
Hi all. 

I’m not sure I understand the nature of the problem anymore as the thread is so 
long, but if you are using the data grid, it is very easy to get the actual 
index and column number of a cell that has been clicked on. If you put this 
into your data grid script, you can see it at work. 

If you don’t want the column headers to show just set the dgprop [“show 
Header”] to false. You will need the header to control column widths though. 
The dividers are actual lines, so I suspect in a mouseDown handler you can 
detect that and handle accordingly. 

on mouseUp
  put the mouseControl into tControl
  put word 1 of the name of tControl into tType
  
  if tType is "field" then  — otherwise anything goes
put getRowAndColumn(tControl) into tRowAndColumn
  end if
  
  pass mouseUp
end mouseUp

function getRowAndColumn pControl
  put the short name of pControl into tName
  put word 1 of tName into tColumName
  put 0 + word 2 of tName into tRow
  put the dgProp ["columns"] of me into tColumns
  put lineOffset(tColumName, tColumns) into tColumnNum
  
  /* Workaround for failure of dgIndexOfLine
  put the dgIndexOfLine [tRow] of me into tIndex
  */
  
  put the dgHilitedIndex of me into tIndex
  return tIndex,tColumnNum
end getRowAndColumn
___
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: DataGrid question...

2020-04-01 Thread Niggemann, Bernd via use-livecode
Hello Mike,

I cannot reproduce the scrolling nor the failing of reporting.

What I did notice is when I changed the size of the field via the mouse in 
editMode at times switching back to browse mode via command-option-tab the 
field did not focus when clicking on it and it did not report anything. 
Apparently because it is not focused.

Make sure the field is focused by e.g. clicking on the card after resizing and 
then the field.
But there is nothing in the code that I can see that would take focus away from 
the field, nor does the code trigger scrolling.

Kind regards
Bernd



Mike Doub via 
use-livecode
 Wed, 01 Apr 2020 08:07:17 
-0700

There is an interesting interaction between the scrolling function, the size of
the field, mouseUp or Down.  For my test, when I click the 6th column,
scrolling occurs and the function returns nothing.  If I size the field such
that no scrolling occurs, all works as expected.   If I change the mouseUp to
mouseDown, all works as expected.   I have not spent the time to figure out
what is going on, but these are my observations.

-= Mike

On Apr 1, 2020, 9:29 AM -0400, Niggemann, Bernd via use-livecode
mailto:use-livecode@lists.runrev.com>>, wrote:
> This is a modification of Jaque's script to get the row and column of a
> locked tableField when the user clicks in a cell.
>
> Use tableField whose lockText is true. Set its script to
>
>
> 
> on mouseUp
> put "Row:" && word 2 of the clickline into tRow
> put "Col:" && getColumn(the clickH) into tColumn
> set the itemDelimiter to tab
> put tRow & tColumn & cr & "ClickH: " & the clickH into field "fRes"
> end mouseUp
>
> function getColumn pClickH
> put the tabstops of me into tTabs
> put the num of items in tTabs into tNumStops
> if tNumStops > 1 then
> put last item of tTabs - item -2 of tTabs into tTabWidth
> else
> put item 1 of tTabs into tTabWidth
> end if
> set the itemdel to tab
> put the num of items in line 1 of me into tColumns
> if tNumStops < tColumns then -- add missing tabstops
> repeat with x = tNumStops+1 to tColumns
> put comma & (tTabWidth * x) after tTabs
> end repeat
> end if
> set the itemdel to comma
> put the hScroll of me into tHScroll
> put the borderwidth of me into tBrdr -- tested from 0 to 4
> put the leftMargin of me - 3 into tLeftMarg -- tested from 4 to 12
> put the left of me + tBrdr into tLeftAndBorder
> put tLeftAndBorder - tHScroll - tLeftMarg into tLeftOfItem
> put tLeftAndBorder - tHScroll + tLeftMarg + 1 into tRightOfItem -- + 1 is a
> fudge
> put 0 & comma before tTabs
> repeat with x = 1 to the num of items in tTabs
> if pClickH > (item x of tTabs) + tLeftOfItem and \
> pClickH < (item x+1 of tTabs) + tRightOfItem then
> return x
> end if
> end repeat
> return empty
> end getColumn
> 
>
>
> In my testing it works for changed borderWidth and margins, hscrolls and
> vScrolls
>
> If you want to test it take a regular field, set its name to "tf", set its
> script to above script
>
> and from a button apply this
>
>
> -
> on mouseUp
> put "1,2,3,4,5,6" into tLine
> put empty into field "tf"
> replace comma with tab in tLine
> set the itemDelimiter to tab
> repeat 6
> put tLine & cr after tCollect
> repeat with i = 1 to 6
> add 6 to item i of tLine
> end repeat
> end repeat
> delete last char of tCollect
> lock screen
> put tCollect into field "tf"
> set the hGrid of field "tf" to true
> set the vGrid of field "tf" to true
> set the hScrollbar of field "tf" to true
> set the tabStops of field "tf" to 77
> set the lockText of field "tf" to true
> unlock screen
> end mouseUp
>
> -

___
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: DataGrid question...

2020-04-01 Thread Mike Doub via use-livecode
There is an interesting interaction between the scrolling function, the size of 
the field, mouseUp or Down.  For my test, when I click the 6th column, 
scrolling occurs and the function returns nothing.  If I size the field such 
that no scrolling occurs, all works as expected.   If I change the mouseUp to 
mouseDown, all works as expected.   I have not spent the time to figure out 
what is going on, but these are my observations.

-= Mike

On Apr 1, 2020, 9:29 AM -0400, Niggemann, Bernd via use-livecode 
, wrote:
> This is a modification of Jaque's script to get the row and column of a 
> locked tableField when the user clicks in a cell.
>
> Use tableField whose lockText is true. Set its script to
>
>
> 
> on mouseUp
> put "Row:" && word 2 of the clickline into tRow
> put "Col:" && getColumn(the clickH) into tColumn
> set the itemDelimiter to tab
> put tRow & tColumn & cr & "ClickH: " & the clickH into field "fRes"
> end mouseUp
>
> function getColumn pClickH
> put the tabstops of me into tTabs
> put the num of items in tTabs into tNumStops
> if tNumStops > 1 then
> put last item of tTabs - item -2 of tTabs into tTabWidth
> else
> put item 1 of tTabs into tTabWidth
> end if
> set the itemdel to tab
> put the num of items in line 1 of me into tColumns
> if tNumStops < tColumns then -- add missing tabstops
> repeat with x = tNumStops+1 to tColumns
> put comma & (tTabWidth * x) after tTabs
> end repeat
> end if
> set the itemdel to comma
> put the hScroll of me into tHScroll
> put the borderwidth of me into tBrdr -- tested from 0 to 4
> put the leftMargin of me - 3 into tLeftMarg -- tested from 4 to 12
> put the left of me + tBrdr into tLeftAndBorder
> put tLeftAndBorder - tHScroll - tLeftMarg into tLeftOfItem
> put tLeftAndBorder - tHScroll + tLeftMarg + 1 into tRightOfItem -- + 1 is a 
> fudge
> put 0 & comma before tTabs
> repeat with x = 1 to the num of items in tTabs
> if pClickH > (item x of tTabs) + tLeftOfItem and \
> pClickH < (item x+1 of tTabs) + tRightOfItem then
> return x
> end if
> end repeat
> return empty
> end getColumn
> 
>
>
> In my testing it works for changed borderWidth and margins, hscrolls and 
> vScrolls
>
> If you want to test it take a regular field, set its name to "tf", set its 
> script to above script
>
> and from a button apply this
>
>
> -
> on mouseUp
> put "1,2,3,4,5,6" into tLine
> put empty into field "tf"
> replace comma with tab in tLine
> set the itemDelimiter to tab
> repeat 6
> put tLine & cr after tCollect
> repeat with i = 1 to 6
> add 6 to item i of tLine
> end repeat
> end repeat
> delete last char of tCollect
> lock screen
> put tCollect into field "tf"
> set the hGrid of field "tf" to true
> set the vGrid of field "tf" to true
> set the hScrollbar of field "tf" to true
> set the tabStops of field "tf" to 77
> set the lockText of field "tf" to true
> unlock screen
> end mouseUp
>
> -
>
>
>
> Kind regards
> Bernd
>
>
>
> ___
> 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: DataGrid question...

2020-04-01 Thread Niggemann, Bernd via use-livecode
This is a modification of Jaque's script to get the row and column of a locked 
tableField when the user clicks in a cell.

Use tableField whose lockText is true. Set its script to



on mouseUp
   put "Row:" && word 2 of the clickline into tRow
   put "Col:" && getColumn(the clickH) into tColumn
   set the itemDelimiter to tab
   put tRow & tColumn & cr & "ClickH: " & the clickH into field "fRes"
end mouseUp

function getColumn pClickH
   put the tabstops of me into tTabs
   put the num of items in tTabs into tNumStops
   if tNumStops > 1 then
  put last item of tTabs - item -2 of tTabs into tTabWidth
   else
  put item 1 of tTabs into tTabWidth
   end if
   set the itemdel to tab
   put the num of items in line 1 of me into tColumns
   if tNumStops < tColumns then -- add missing tabstops
  repeat with x = tNumStops+1 to tColumns
 put comma & (tTabWidth * x) after tTabs
  end repeat
   end if
   set the itemdel to comma
   put the hScroll of me into tHScroll
   put the borderwidth of me into tBrdr -- tested from 0 to 4
   put the leftMargin of me - 3 into tLeftMarg -- tested from 4 to 12
   put the left of me + tBrdr into tLeftAndBorder
   put tLeftAndBorder - tHScroll - tLeftMarg into tLeftOfItem
   put tLeftAndBorder - tHScroll + tLeftMarg + 1 into tRightOfItem -- + 1 is a 
fudge
   put 0 & comma before tTabs
   repeat with x = 1 to the num of items in tTabs
  if pClickH > (item x of tTabs) + tLeftOfItem and \
pClickH < (item x+1 of tTabs) + tRightOfItem then
 return x
  end if
   end repeat
   return empty
end getColumn



In my testing it works for changed borderWidth and margins, hscrolls and 
vScrolls

If you want to test it take a regular field, set its name to "tf", set its 
script to above script

and from a button apply this


-
on mouseUp
   put "1,2,3,4,5,6" into tLine
   put empty into field "tf"
   replace comma with tab in tLine
   set the itemDelimiter to tab
   repeat 6
  put tLine & cr after tCollect
  repeat with i = 1 to 6
 add 6 to item i of tLine
  end repeat
   end repeat
   delete last char of tCollect
   lock screen
   put tCollect into field "tf"
   set the hGrid of field "tf" to true
   set the vGrid of field "tf" to true
   set the hScrollbar of field "tf" to true
   set the tabStops of field "tf" to 77
   set the lockText of field "tf" to true
   unlock screen
end mouseUp

-



Kind regards
Bernd



___
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: DataGrid question...

2020-03-30 Thread Niggemann, Bernd via use-livecode


>Peter Bogdanoff wrote:

>Does anyone have a link to obtain Bernd's modTableField ?

Here is a link to the latest version of modifiedTableField

berndniggemann.on-rev.com/mtf/modTableField.zip

there is a zip of a demo stack with a helper stack and a .rtf document with the 
API

Use the demo stack to explore modTableField. Have a little patience to explore. 
It shows many options. Please have a look at the API document to get a feeling 
how to address and query modTableField.

If you want to use modTableField in a project copy the group "modTableField 1" 
from the demo stack to your stack and use the API to work with it.

This version is HTML5 safe. There was a superfluous wait in former versions. 
Hermann used tinyDict with his HTML5 demo of an IDE.

tinyDictionary uses modTableField

There are a couple of users that seem quite content with modTableField (thanks 
Jerry for mentioning it)

I would be happy to know if anybody uses modTableField in a project. (aside 
from the people that mailed me before).

If you have questions please feel free to email me.

Kind regards
Bernd


___
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: DataGrid question...

2020-03-30 Thread Curry Kenworthy via use-livecode


Pi:

> I’m not sure this is what Curry was thinking of. What do you think
> he was eluding to. We’ve ‘known’ this for years now apparently.

I love the humor so far - well done, kind of like a skit/spoof of Fake 
News flailing under the weight of Accurate Facts yet insistently 
demanding more, LOL, if that was your intent. OK, I'll join in the fun 
and play straight man in the act to ham it up and help give cooped up 
people at home a much-needed laugh, and educational to boot. Our own 
little Punch and Judy show. Just this one more email though; I've been 
sick for weeks and need to catch up on work, so extra typing has to be 
very limited.


Generally known (your claim, not mine): List members quickly provided 
starter code for not 1 but 2 separate approaches. I'd say the existence 
of tabstops and clickH/mouseH is fairly well-known. Just a matter of 
actually applying what is known - that's a key skill and we've just seen 
a real live demo of several people doing exactly that. Good job, all!


Long time: Check. Tabstops and mouseH have been there since LC/RR 1.0, 
if the dictionary can be trusted for once. That's quite a while. I 
myself published an optimized column function back in 2011 or 2012 with 
SpreadLib (and my critics keep reminding me that was a long time ago; 
they can't have it both ways) so I assume I'd probably been using 
rougher column code for several years before that. And I assume other 
people did too.


(But I admit, on a geological time scale that's just the blink of an 
eye. And in the course of human civilization, I don't have any handy 
evidence that people in ancient Catal Huyuk or Jericho were using 
similar methods. However even animals have an innate sense of comparing 
larger and smaller amounts, and early civilizations solved highly 
complex problems, so I wouldn't underestimate them; I think the average 
scholar back then was very smart, and placing a given value into a 
series of values should be doable IMHO. But to stick to proven facts, 
it's indeed a "long" time in LiveCode terms, the capability was 
available for almost as long as LC/RR itself. But not in geological 
terms or "God's time" and the life of our universe; I'm afraid the Fake 
News might have me over a barrel on possible meanings of the word long.) :-)


Providing people have some background on field props, this is no trouble 
at all! I don't believe all learning should be by rote, AKA either 
someone has seen the explicit code and heard a spiel, or else he/she is 
completely helpless and innocent of the entire concept. For LC tutoring 
I would place a "which column" coding challenge exercise as: Beginner 
skill level for known provided equal-width tabstops, Intermediate for 
rough handling all field tabstops, and Advanced for a cleaner/shorter 
optimized and polished solution and/or handling paragraph-level 
settings. Never claimed it was a one-liner (typical fake news "flailing" 
with hyperbole, common media tactic) but as demo'd here it's not hard to 
make your own function, for those not function-averse or 
performance-averse. But yes the field is underappreciated and much 
sexier than the gossip and hearsay crowd gives it credit for. So it's 
great that we are increasing awareness and understanding and driving a 
stake into the heart of some misconceptions!


That concludes my brief battle to fortify field users against Fake 
News...for this round, but the war for hearts and minds never ends in 
our 24/7 media cycle! So I'll fly away back to my sickbed lair to 
recuperate (but not lick my wounds or touch my face) until the next time 
Forces of Misinformation and Mayhem rise once more from the gutters and 
perch on the gorgoyles to threaten the code-izens of our fair virtual 
metropolis. Carry on!


Best wishes,

Curry Kenworthy

Custom Software Development
"Better Methods, Better Results"
LiveCode Training and Consulting
http://livecodeconsulting.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: DataGrid question...

2020-03-30 Thread Alex Tweedly via use-livecode

Yeah,  mtfDataItemClicked calls gatherItemClickedInfo to get the info :-)


On 30/03/2020 21:07, Jerry Jensen via use-livecode wrote:

In modTableField there’s a function for that:
mtfDataItemClicked pColumnClicked, pLineClicked, pItemContent, pGroupName


On Mar 30, 2020, at 3:49 AM, Alex Tweedly via use-livecode 
 wrote:

I don't know of a simple way to do it.

However, Bernd's modTableField does do it, and it uses regular fields, and it's 
open source - so I took a very quick look there.

It's not simple :-)

But there's a function 'gatherItemClickedInfo' that (with some modifications) 
might be the foundation of a general handler for you.

___
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: DataGrid question...

2020-03-30 Thread Jerry Jensen via use-livecode
I am updating a project that used modTableField. I emailed Bernd to see what 
the current version is. Its 0.3.3.9 and he emailed it to me. I don’t have a 
link, but Bernd’s email is:
Niggemann, Bernd" 
I’m a big fan!
Jerry Jensen

> On Mar 30, 2020, at 1:38 PM, Peter Bogdanoff via use-livecode 
>  wrote:
> 
> Does anyone have a link to obtain Bernd's modTableField ?
> 
> Peter Bogdanoff
> 
> 
>> On Mar 30, 2020, at 1:07 PM, Jerry Jensen via use-livecode 
>>  wrote:
>> 
>> In modTableField there’s a function for that:
>> mtfDataItemClicked pColumnClicked, pLineClicked, pItemContent, pGroupName
>> 
>>> On Mar 30, 2020, at 3:49 AM, Alex Tweedly via use-livecode 
>>>  wrote:
>>> 
>>> I don't know of a simple way to do it.
>>> 
>>> However, Bernd's modTableField does do it, and it uses regular fields, and 
>>> it's open source - so I took a very quick look there.
>>> 
>>> It's not simple :-)
>>> 
>>> But there's a function 'gatherItemClickedInfo' that (with some 
>>> modifications) might be the foundation of a general handler for you.
>> 
>> ___
>> 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


___
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: DataGrid question...

2020-03-30 Thread Peter Bogdanoff via use-livecode
Does anyone have a link to obtain Bernd's modTableField ?

Peter Bogdanoff


> On Mar 30, 2020, at 1:07 PM, Jerry Jensen via use-livecode 
>  wrote:
> 
> In modTableField there’s a function for that:
> mtfDataItemClicked pColumnClicked, pLineClicked, pItemContent, pGroupName
> 
>> On Mar 30, 2020, at 3:49 AM, Alex Tweedly via use-livecode 
>>  wrote:
>> 
>> I don't know of a simple way to do it.
>> 
>> However, Bernd's modTableField does do it, and it uses regular fields, and 
>> it's open source - so I took a very quick look there.
>> 
>> It's not simple :-)
>> 
>> But there's a function 'gatherItemClickedInfo' that (with some 
>> modifications) might be the foundation of a general handler for you.
> 
> ___
> 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: DataGrid question...

2020-03-30 Thread Jerry Jensen via use-livecode
In modTableField there’s a function for that:
mtfDataItemClicked pColumnClicked, pLineClicked, pItemContent, pGroupName

> On Mar 30, 2020, at 3:49 AM, Alex Tweedly via use-livecode 
>  wrote:
> 
> I don't know of a simple way to do it.
> 
> However, Bernd's modTableField does do it, and it uses regular fields, and 
> it's open source - so I took a very quick look there.
> 
> It's not simple :-)
> 
> But there's a function 'gatherItemClickedInfo' that (with some modifications) 
> might be the foundation of a general handler for you.

___
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: DataGrid question...

2020-03-30 Thread J. Landman Gay via use-livecode

On 3/30/20 4:08 AM, Pi Digital via use-livecode wrote:

So, have we all missed a clever and simple, non convoluted method of telling 
which cell in a scrollable, non editable table field has been clicked? Even if 
that cell is empty.


The table field is pretty rudimentary and so has limitations. For example, no messages are 
generated if a user clicks in a cell that is below the last text entry. Provided the field is 
full of data and user clicks on a populated cell, this seems to work:


on selectionChanged
  put "Row:" && word 2 of the clickline into tRow -- adjust for scroll here
  put "Col:" && getColumn(the clickH) into tColumn
  put tRow & tColumn
end selectionChanged

function getColumn pClickH
  put the num of items in the tabstops of me into tNumStops
  put last item of the tabstops of me into tTabWidth -- in case we need to 
calculate it
  set the itemdel to tab
  put the num of items in line 1 of fld "tf" into tColumns
  if tNumStops < tColumns then -- add missing tabstops
put the tabstops of me into tTabs
repeat with x = tNumStops+1 to tColumns
  put comma & (tTabWidth * x) after tTabs
end repeat
  end if
  set the itemdel to comma
  repeat with x = 1 to the num of items in tTabs
if pClickH > item x of tTabs and pClickH < item x+1 of tTabs then
  return x
end if
  end repeat
  return empty
end getColumn

This is as far as I got (I need to get back to work,) but I think all it's missing is 
calculating the row offset if the field is scrolled. David accounted for that.

--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software   | http://www.hyperactivesw.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: DataGrid question...

2020-03-30 Thread Pi Digital via use-livecode
Wow, David. Not convoluted at all :) so much easier than data grid. I’m not 
sure this is what Curry was thinking of. What do you think he was eluding to. 
We’ve ‘known’ this for years now apparently. 

Sean Cole
Pi Digital


> On 30 Mar 2020, at 14:13, David Epstein via use-livecode 
>  wrote:
> 
> This is more or less Jacqueline Gay’s suggestion, but with a couple of 
> wrinkles.  You do need to adjust for the horizontal scroll of the field (I’m 
> not sure about borders or margin).  And if I am not mistaken sometimes “the 
> tabStops” will not have an entry for each tab, if the column width stays 
> constant.
> My approach is to keep a global called gColGuide, which gets reloaded when 
> column widths change.  It has one line per column, with 
> leftEdge,0,rightEdge,0 in each line.
> The function used to load gColGuide is shown below.
> 
> put word 1 of the clickLoc into x
> put word 2 of the clickLine into L — line number
> put the hScroll of fld “table” into hs
> 
> put colGuide() into gColGuide
> 
> function mCol x,hs — returns column number for horizontal pixel x, consulting 
> gColGuide.  hs is the field’s hScroll.
>  global gColGuide
>  add hs to x
>  put 1 into c
>  repeat for each line k in gColGuide
>if x > item 1 of k and x < item 3 of k then return c
>add 1 to c
>  end repeat
>  return empty
> end mCol-- Any need to adjust for borders and margins?
> 
> function colGuide — used to load gColGuide with one line per column; each 
> line has left,0,right,0
>  set itemDelimiter to tab
>  put the number of items in fld "headers" of into cz
>  set itemDelimiter to comma
>  get the tabStops of fld “table”
>  put "0," before it
>  put the left of fld “table” into fL
>  repeat with n = 1 to min(cz,(-1 + the number of items in it)) -- so that 
> colGuide will only cover the used columns.
>put fL+8 + item n of it,0,fL+8 + item n+1 of it,0 & return after hold
>  end repeat
>  if cz > n then
>put item 3 of line -1 of hold - item 1 of line -1 of hold into w
>repeat with m = n+1 to cz
>  get item 3 of line -1 of hold
>  put it,0,w + it,0 & return after hold
>end repeat
>  end if
>  put fL into item 1 of hold
>  return hold
> end colGuide
> 
> David Epstein
> 
> ___
> 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: DataGrid question...

2020-03-30 Thread David Epstein via use-livecode
This is more or less Jacqueline Gay’s suggestion, but with a couple of 
wrinkles.  You do need to adjust for the horizontal scroll of the field (I’m 
not sure about borders or margin).  And if I am not mistaken sometimes “the 
tabStops” will not have an entry for each tab, if the column width stays 
constant.
My approach is to keep a global called gColGuide, which gets reloaded when 
column widths change.  It has one line per column, with leftEdge,0,rightEdge,0 
in each line.
The function used to load gColGuide is shown below.

put word 1 of the clickLoc into x
put word 2 of the clickLine into L — line number
put the hScroll of fld “table” into hs

put colGuide() into gColGuide

function mCol x,hs — returns column number for horizontal pixel x, consulting 
gColGuide.  hs is the field’s hScroll.
  global gColGuide
  add hs to x
  put 1 into c
  repeat for each line k in gColGuide
if x > item 1 of k and x < item 3 of k then return c
add 1 to c
  end repeat
  return empty
end mCol-- Any need to adjust for borders and margins?

function colGuide — used to load gColGuide with one line per column; each line 
has left,0,right,0
  set itemDelimiter to tab
  put the number of items in fld "headers" of into cz
  set itemDelimiter to comma
  get the tabStops of fld “table”
  put "0," before it
  put the left of fld “table” into fL
  repeat with n = 1 to min(cz,(-1 + the number of items in it)) -- so that 
colGuide will only cover the used columns.
put fL+8 + item n of it,0,fL+8 + item n+1 of it,0 & return after hold
  end repeat
  if cz > n then
put item 3 of line -1 of hold - item 1 of line -1 of hold into w
repeat with m = n+1 to cz
  get item 3 of line -1 of hold
  put it,0,w + it,0 & return after hold
end repeat
  end if
  put fL into item 1 of hold
  return hold
end colGuide

David Epstein

___
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: DataGrid question...

2020-03-30 Thread Alex Tweedly via use-livecode

I don't know of a simple way to do it.

However, Bernd's modTableField does do it, and it uses regular fields, 
and it's open source - so I took a very quick look there.


It's not simple :-)

But there's a function 'gatherItemClickedInfo' that (with some 
modifications) might be the foundation of a general handler for you.


Alex.


On 30/03/2020 10:08, Pi Digital via use-livecode wrote:

Hmm, but if you look back to Curry’s last post he claims regarding table 
fields, not data grids :


Working out which cell has been clicked: Sorry, that's not accurate either. 
Yes, we do have that! Also for a long time.

Curry is a very reliable and valued source of LC knowledge. So, have we all 
missed a clever and simple, non convoluted method of telling which cell in a 
scrollable, non editable table field has been clicked? Even if that cell is 
empty. Something as simple as:

put the dgIndex of the target into theIndexThatWasClickedOn
?

Sean Cole
Pi



On 30 Mar 2020, at 07:32, J. Landman Gay via use-livecode 
 wrote:

I can't write a test handler right now, but I'm thinking you might be able do 
something like this:

repeat for each item i in the tabstops of the field:
  if the clickH > i and less than item i+1,
  that's your column

The clickline gives you the row.


On 3/29/20 11:04 PM, Terry Judd via use-livecode wrote:
This is rough but sort of works...
on selectionChanged
set the itemDel to tab
put word 2 of the selectedLine into tRow
put word 2 of the selectedChunk into nChar
put length(line 1 to tRow-1 of me) into tStart
put char tStart+2 to nChar of me into tText
put the number of items in tText into tCol
put tRow&
end selectionChanged


--
Jacqueline Landman Gay |

___
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: DataGrid question...

2020-03-30 Thread Pi Digital via use-livecode
Hmm, but if you look back to Curry’s last post he claims regarding table 
fields, not data grids :

>> Working out which cell has been clicked: Sorry, that's not accurate either. 
>> Yes, we do have that! Also for a long time.

Curry is a very reliable and valued source of LC knowledge. So, have we all 
missed a clever and simple, non convoluted method of telling which cell in a 
scrollable, non editable table field has been clicked? Even if that cell is 
empty. Something as simple as:

put the dgIndex of the target into theIndexThatWasClickedOn
?

Sean Cole
Pi


> On 30 Mar 2020, at 07:32, J. Landman Gay via use-livecode 
>  wrote:
> 
> I can't write a test handler right now, but I'm thinking you might be able 
> do something like this:
> 
> repeat for each item i in the tabstops of the field:
>  if the clickH > i and less than item i+1,
>  that's your column
> 
> The clickline gives you the row.
> 
>> On 3/29/20 11:04 PM, Terry Judd via use-livecode wrote:
>> This is rough but sort of works...
>> on selectionChanged
>>set the itemDel to tab
>>put word 2 of the selectedLine into tRow
>>put word 2 of the selectedChunk into nChar
>>put length(line 1 to tRow-1 of me) into tStart
>>put char tStart+2 to nChar of me into tText
>>put the number of items in tText into tCol
>>put tRow&
>> end selectionChanged
> 
> 
> -- 
> Jacqueline Landman Gay |
___
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: DataGrid question...

2020-03-30 Thread J. Landman Gay via use-livecode

I can't write a test handler right now, but I'm thinking you might be able do 
something like this:

repeat for each item i in the tabstops of the field:
  if the clickH > i and less than item i+1,
  that's your column

The clickline gives you the row.

On 3/29/20 11:04 PM, Terry Judd via use-livecode wrote:

This is rough but sort of works...

on selectionChanged
set the itemDel to tab
put word 2 of the selectedLine into tRow
put word 2 of the selectedChunk into nChar
put length(line 1 to tRow-1 of me) into tStart
put char tStart+2 to nChar of me into tText
put the number of items in tText into tCol
put tRow&
end selectionChanged




--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software   | http://www.hyperactivesw.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: DataGrid question...

2020-03-29 Thread Terry Judd via use-livecode
This is rough but sort of works...

on selectionChanged
   set the itemDel to tab
   put word 2 of the selectedLine into tRow
   put word 2 of the selectedChunk into nChar
   put length(line 1 to tRow-1 of me) into tStart
   put char tStart+2 to nChar of me into tText
   put the number of items in tText into tCol
   put tRow&
end selectionChanged

On 30/3/20, 2:57 pm, "use-livecode on behalf of Pi Digital via use-livecode" 
 wrote:

Ah Bob. You misunderstand. We are asking in reference to the table field, 
not DG. Finding the index in data grid is very easy indeed. In a table field,  
it so much as I was to understand. But apparently there is some magic I’ve 
missed somewhere and perhaps I’m the only one. Do you know what it is? 

Sean Cole
Pi Digital


> On 30 Mar 2020, at 04:40, Bob Sneidar via use-livecode 
 wrote:
> 
> on mouseUp
>   put the mouseControl into tControl
>   put the long id of tControl into tID
>   put the short name of tControl into tName
> end mouseUp
> 
> The short name will reveal the column number. The dgHilitedLine will give 
you the line. 
> 
>> On Mar 29, 2020, at 8:37 PM, Bob Sneidar via use-livecode 
 wrote:
>> 
>> The mouseControl!
>> 
>> Bob S
>> 
>> On Mar 29, 2020, at 8:35 PM, Pi Digital via use-livecode 
mailto:use-livecode@lists.runrev.com>> wrote:
>> 
>> Hi Jerry
>> 
>> Thanks for the heads up about Bernd’s code. But I was interested in 
learning how to get the cell index of a table field when clicked as we are told 
it was solved a ‘long time’ ago. That makes it seem that it is general 
knowledge and I’m a dunce for not being aware of it (which is very possible). 
If you’ve got any pointers you know of that can steer me right I’d appreciate 
it.
>> 
>> Sean Cole
>> Pi Digital
>> 
>> ___
>> 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
___
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: DataGrid question...

2020-03-29 Thread Bob Sneidar via use-livecode
OIC. I was struggling with that earlier today. The problem is, there is no 
cell. Just a field. You can get the line with the clickLine, but I discovered 
that even with cell editing on, the table field acted erratically, adding lines 
when I didn’t want them.

Since you know the tabstops, you can calculate where in the field the user 
clicked, and therefore the “cell”. You will have to do some math though. If the 
field is horizontally scrolled you will have to take that scroll into account.

Honestly it would be better to just have a data grid. That is what I ended up 
doing.

Bob S


On Mar 29, 2020, at 8:56 PM, Pi Digital via use-livecode 
mailto:use-livecode@lists.runrev.com>> wrote:

Ah Bob. You misunderstand. We are asking in reference to the table field, not 
DG. Finding the index in data grid is very easy indeed. In a table field,  it 
so much as I was to understand. But apparently there is some magic I’ve missed 
somewhere and perhaps I’m the only one. Do you know what it is?

Sean Cole
Pi Digital

___
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: DataGrid question...

2020-03-29 Thread Jerry Jensen via use-livecode
Hi Sean,

Sorry, I was thinking you might not need a DG at all. My mistake.
Anyway, just to be complete, Bernd’s modTableField API gives you the following:

mtfDataItemClicked pColumnClicked, pLineClicked, pItemContent, pGroupName

mtfDataItemClicked is send when the user clicks into a data cell.
4 parameters are sent: the number of the column, the number of the line, the 
content of the cell and the long name of the group. Content of course can be 
empty if the cell is empty.

.Jerry

> On Mar 29, 2020, at 8:35 PM, Pi Digital via use-livecode 
>  wrote:
> 
> Hi Jerry
> 
> Thanks for the heads up about Bernd’s code. But I was interested in learning 
> how to get the cell index of a table field when clicked as we are told it was 
> solved a ‘long time’ ago. That makes it seem that it is general knowledge and 
> I’m a dunce for not being aware of it (which is very possible). If you’ve got 
> any pointers you know of that can steer me right I’d appreciate it. 
> 


___
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: DataGrid question...

2020-03-29 Thread Pi Digital via use-livecode
Ah Bob. You misunderstand. We are asking in reference to the table field, not 
DG. Finding the index in data grid is very easy indeed. In a table field,  it 
so much as I was to understand. But apparently there is some magic I’ve missed 
somewhere and perhaps I’m the only one. Do you know what it is? 

Sean Cole
Pi Digital


> On 30 Mar 2020, at 04:40, Bob Sneidar via use-livecode 
>  wrote:
> 
> on mouseUp
>   put the mouseControl into tControl
>   put the long id of tControl into tID
>   put the short name of tControl into tName
> end mouseUp
> 
> The short name will reveal the column number. The dgHilitedLine will give you 
> the line. 
> 
>> On Mar 29, 2020, at 8:37 PM, Bob Sneidar via use-livecode 
>>  wrote:
>> 
>> The mouseControl!
>> 
>> Bob S
>> 
>> On Mar 29, 2020, at 8:35 PM, Pi Digital via use-livecode 
>> mailto:use-livecode@lists.runrev.com>> wrote:
>> 
>> Hi Jerry
>> 
>> Thanks for the heads up about Bernd’s code. But I was interested in learning 
>> how to get the cell index of a table field when clicked as we are told it 
>> was solved a ‘long time’ ago. That makes it seem that it is general 
>> knowledge and I’m a dunce for not being aware of it (which is very 
>> possible). If you’ve got any pointers you know of that can steer me right 
>> I’d appreciate it.
>> 
>> Sean Cole
>> Pi Digital
>> 
>> ___
>> 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
___
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: DataGrid question...

2020-03-29 Thread Bob Sneidar via use-livecode
on mouseUp
   put the mouseControl into tControl
   put the long id of tControl into tID
   put the short name of tControl into tName
end mouseUp

The short name will reveal the column number. The dgHilitedLine will give you 
the line. 

> On Mar 29, 2020, at 8:37 PM, Bob Sneidar via use-livecode 
>  wrote:
> 
> The mouseControl!
> 
> Bob S
> 
> On Mar 29, 2020, at 8:35 PM, Pi Digital via use-livecode 
> mailto:use-livecode@lists.runrev.com>> wrote:
> 
> Hi Jerry
> 
> Thanks for the heads up about Bernd’s code. But I was interested in learning 
> how to get the cell index of a table field when clicked as we are told it was 
> solved a ‘long time’ ago. That makes it seem that it is general knowledge and 
> I’m a dunce for not being aware of it (which is very possible). If you’ve got 
> any pointers you know of that can steer me right I’d appreciate it.
> 
> Sean Cole
> Pi Digital
> 
> ___
> 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: DataGrid question...

2020-03-29 Thread Bob Sneidar via use-livecode
The mouseControl!

Bob S

On Mar 29, 2020, at 8:35 PM, Pi Digital via use-livecode 
mailto:use-livecode@lists.runrev.com>> wrote:

Hi Jerry

Thanks for the heads up about Bernd’s code. But I was interested in learning 
how to get the cell index of a table field when clicked as we are told it was 
solved a ‘long time’ ago. That makes it seem that it is general knowledge and 
I’m a dunce for not being aware of it (which is very possible). If you’ve got 
any pointers you know of that can steer me right I’d appreciate it.

Sean Cole
Pi Digital

___
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: DataGrid question...

2020-03-29 Thread Pi Digital via use-livecode
Hi Jerry

Thanks for the heads up about Bernd’s code. But I was interested in learning 
how to get the cell index of a table field when clicked as we are told it was 
solved a ‘long time’ ago. That makes it seem that it is general knowledge and 
I’m a dunce for not being aware of it (which is very possible). If you’ve got 
any pointers you know of that can steer me right I’d appreciate it. 

Sean Cole
Pi Digital


> On 30 Mar 2020, at 03:38, Jerry Jensen via use-livecode 
>  wrote:
> 
> Hi Sean,
> Have you seen Bernd Niggemann’s modTableField? It is built on top of the LC 
> list field, without a lot of the complications of DataGrids if you don’t need 
> DG’s huge capabilities. It might work well for you.
> Regards,
> Jerry Jensen
> 
>>> On Mar 29, 2020, at 7:05 PM, Sean Cole (Pi) via use-livecode 
>>>  wrote:
>>> 
>>> 
>>> Working out which cell has been clicked: Sorry, that's not accurate
>>> either. Yes, we do have that! Also for a long time.
>>> 
>> 
>> Hi,
>> 
>> As Curry's now unfortunately out of the conversation, can someone else help
>> me understand how you work out which cell has been clicked? 
> 
> 
> 
> ___
> 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: DataGrid question...

2020-03-29 Thread Pi Digital via use-livecode
Hi Bob

That’ll return the field is I’m over but not the cell of the table field. 
Unless, again, I am mistaken. Am I missing something. 


Sean Cole
Pi Digital


> On 30 Mar 2020, at 03:09, Bob Sneidar via use-livecode 
>  wrote:
> 
> The mouseControl. 
>>> help
>> me understand how you work out which cell has been clicked? He said it can
>> be done but gave no explanation or hint of how.
___
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: DataGrid question...

2020-03-29 Thread Jerry Jensen via use-livecode
Hi Sean,
Have you seen Bernd Niggemann’s modTableField? It is built on top of the LC 
list field, without a lot of the complications of DataGrids if you don’t need 
DG’s huge capabilities. It might work well for you.
Regards,
Jerry Jensen

> On Mar 29, 2020, at 7:05 PM, Sean Cole (Pi) via use-livecode 
>  wrote:
> 
>> 
>> Working out which cell has been clicked: Sorry, that's not accurate
>> either. Yes, we do have that! Also for a long time.
>> 
> 
> Hi,
> 
> As Curry's now unfortunately out of the conversation, can someone else help
> me understand how you work out which cell has been clicked? 



___
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: DataGrid question...

2020-03-29 Thread Bob Sneidar via use-livecode
The mouseControl. 

> On Mar 29, 2020, at 7:06 PM, Sean Cole (Pi) via use-livecode 
>  wrote:
> 
>> 
>> Working out which cell has been clicked: Sorry, that's not accurate
>> either. Yes, we do have that! Also for a long time.
>> 
> 
> Hi,
> 
> As Curry's now unfortunately out of the conversation, can someone else help
> me understand how you work out which cell has been clicked? He said it can
> be done but gave no explanation or hint of how. I trust him so it must be
> possible. Suppose every field is an image of a checkbox or a series of
> figures from a spreadsheet. Without the text being selected, how can you
> work out the cell? Better still, if its completely empty, how can you tell?
> 
> 'Addressing facts and a general need for accuracy in what we promote'
> means promoting the accurate details so we can see where we are going wrong
> with our 'minds' that are 'filled up with a lot of wrong info' that we end
> up using 'to direct our actions and decisions'. I apologise for having been
> misinformed. Is that the way the conversation goes? :)
> 
> Thanks
> ___
> 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: DataGrid question...

2020-03-29 Thread Sean Cole (Pi) via use-livecode
>
> Working out which cell has been clicked: Sorry, that's not accurate
> either. Yes, we do have that! Also for a long time.
>

Hi,

As Curry's now unfortunately out of the conversation, can someone else help
me understand how you work out which cell has been clicked? He said it can
be done but gave no explanation or hint of how. I trust him so it must be
possible. Suppose every field is an image of a checkbox or a series of
figures from a spreadsheet. Without the text being selected, how can you
work out the cell? Better still, if its completely empty, how can you tell?

 'Addressing facts and a general need for accuracy in what we promote'
means promoting the accurate details so we can see where we are going wrong
with our 'minds' that are 'filled up with a lot of wrong info' that we end
up using 'to direct our actions and decisions'. I apologise for having been
misinformed. Is that the way the conversation goes? :)

Thanks
___
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: DataGrid question...

2020-03-29 Thread Sean Cole (Pi) via use-livecode
>
> Working out which cell has been clicked: Sorry, that's not accurate
> either. Yes, we do have that! Also for a long time.
>

Hi,

As Curry's now unfortunately out of the conversation, can someone else help
me understand how you work out which cell has been clicked? He said it can
be done but gave no explanation or hint of how. I trust him so it must be
possible. Suppose every field is an image of a checkbox or a series of
figures from a spreadsheet. Without the text being selected, how can you
work out the cell? Better still, if its completely empty, how can you tell?

 'Addressing facts and a general need for accuracy in what we promote'
means promoting the accurate details so we can see where we are going wrong
with our 'minds' that are 'filled up with a lot of wrong info' that we end
up using 'to direct our actions and decisions'. I apologise for having been
misinformed. Is that the way the conversation goes? :)

Thanks
___
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: DataGrid question...

2020-03-29 Thread Curry Kenworthy via use-livecode


Pi:

> Fields: Images, yes. Other objects, no. Working out which cell
> has been clicked, no.
> Is that ‘fake news’? If so, sad face. If not, still sad face.

Well, sorry but I have to say YES it's largely fake news! :D

I'm ill and no strength for an argument (and BTW it has been a fairly 
"serious" and costly, long-lasting illness I would add; merely glad to 
have stayed out of hospital) so this will be my last word on the subject 
but the facts are crystal clear.


Images: Well-supported in fields, and for a long time!

Working out which cell has been clicked: Sorry, that's not accurate 
either. Yes, we do have that! Also for a long time.


Other objects: That one depends on interpretation. Other standard LC 
objects dragged in? No. Interactive content that can look and function 
just like objects to fill the same need? Yes. Often it works great. From 
checkboxes to charts and tables. I've been very active in this area, and 
so have others.


Not meaning to pick on you, this does not center around you, but it's a 
good example. Just addressing facts and a general need for accuracy in 
what we promote. We've had too much misinformation widely spread over 
the years, and it harms projects when people get their minds filled up 
with a lot of wrong info and use it to direct their actions and decisions.


The field is one such area - greatly underappreciated for its many 
strengths. Many other areas where we've had untrue facts widely spread 
and accepted/repeated/learned as truth. Glad this one was caught early.


Be safe, everyone...in code quality and in health matters. Bad stuff 
going around.


Best wishes,

Curry Kenworthy

Custom Software Development
"Better Methods, Better Results"
LiveCode Training and Consulting
http://livecodeconsulting.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: DataGrid question...

2020-03-29 Thread Richard Gaskin via use-livecode

Bob Sneidar wrote:

> I thought you could embed checkboxes in a data grid?

A DG is a collection of groups. Anything that can be put into a group 
can be part of the group that defines the row.



> When have we ever been able to embed another object in a field?

"Embed"? Never.  But we can display an image in a field.

It works very much like HTML, where you can reference an image object by 
ID to have it show up in a field:


  set the imageSource of char 13 of fld 1 to tSomeImgID

HtmlText for that would show something like:

  Hello World 


--
 Richard Gaskin
 Fourth World Systems
 Software Design and Development for the Desktop, Mobile, and the Web
 
 ambassa...@fourthworld.comhttp://www.FourthWorld.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: DataGrid question...

2020-03-29 Thread scott--- via use-livecode
I have an app I’m working on right now that has check boxes that the user taps 
in a list field. Swapping the  imagesource works really well in this particular 
case. Not that the dataGrid isn’t the required tool in some cases.

Scott Morrow

Elementary Software
(Now with 20% less chalk dust!)
web   https://elementarysoftware.com/
email sc...@elementarysoftware.com
booth1-800-615-0867
mobile  360-920-0715
--
> On Mar 29, 2020, at 4:46 PM, Mark Wieder via use-livecode 
>  wrote:
> 
> On 3/29/20 1:50 PM, Curry Kenworthy via use-livecode wrote:
> 
>> Way too much inaccurate info and "fake news" about LiveCode gets propagated
> 
> I think that's mischaracterized.
> 
> Just passing on some information (I hate it when someone says x can't be done 
> - that's a real push to do it). I've been embedding small graphics in fields 
> for years now (and textshift helps align them) but I'm sure I'm barely 
> scratching the surface of what fields can do.
> 
> -- 
> Mark Wieder
> ahsoftw...@gmail.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


___
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: DataGrid question...

2020-03-29 Thread Mark Wieder via use-livecode

On 3/29/20 1:50 PM, Curry Kenworthy via use-livecode wrote:


Way too much inaccurate info and "fake news" about LiveCode gets propagated


I think that's mischaracterized.

Just passing on some information (I hate it when someone says x can't be 
done - that's a real push to do it). I've been embedding small graphics 
in fields for years now (and textshift helps align them) but I'm sure 
I'm barely scratching the surface of what fields can do.


--
 Mark Wieder
 ahsoftw...@gmail.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: DataGrid question...

2020-03-29 Thread Bob Sneidar via use-livecode
I thought you could embed checkboxes in a data grid? Not in a field of course, 
but that’s always been the case. When have we ever been able to embed another 
object in a field?

Bob S


On Mar 29, 2020, at 4:32 PM, Pi Digital via use-livecode 
mailto:use-livecode@lists.runrev.com>> wrote:

Fields:   Images, yes. Other objects, no. Working out which cell has been 
clicked, no.

Is that ‘fake news’? If so, sad face. If not, still sad face.

Thanks Mark for catching and correcting that. Way too much inaccurate info and 
"fake news" about LiveCode gets propagated, and often picked up and parroted 
even further by others. LC field is extremely versatile!

DataGrids are used far more often than they are needed.

Best wishes,

Curry Kenworthy

___
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: DataGrid question...

2020-03-29 Thread Pi Digital via use-livecode
Fields:   Images, yes. Other objects, no. Working out which cell has been 
clicked, no. 

Is that ‘fake news’? If so, sad face. If not, still sad face. 

> Thanks Mark for catching and correcting that. Way too much inaccurate info 
> and "fake news" about LiveCode gets propagated, and often picked up and 
> parroted even further by others. LC field is extremely versatile!
> 
> DataGrids are used far more often than they are needed.
> 
> Best wishes,
> 
> Curry Kenworthy


___
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: DataGrid question...

2020-03-29 Thread Curry Kenworthy via use-livecode


Pi:
> The only issue with using a field is you are limited to character
> data presentation only. You can’t put inline images, widgets,
> checkboxes, etc.

Mark:
> Now that's just patently not true. No problem with images:
> Set the imagesource of char x of field y of this card to tImageID

Thanks Mark for catching and correcting that. Way too much inaccurate 
info and "fake news" about LiveCode gets propagated, and often picked up 
and parroted even further by others. LC field is extremely versatile!


DataGrids are used far more often than they are needed.

Best wishes,

Curry Kenworthy

WordLib: Take charge of MS Word and OpenOffice documents
SpreadLib: "Excel-lent" spreadsheet import/export for LC
http://livecodeaddons.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: DataGrid question...

2020-03-27 Thread Mark Wieder via use-livecode

On 3/27/20 11:06 AM, Sean Cole (Pi) via use-livecode wrote:

Still, adding images to a field for this kind of purpose is a great shout.
Even better if the mouse click handler can determine the column and row,
which isn't much of a trick.


The row is easy - that's word 2 of the clickline
the column you can normally get from word 2 of the mousecharchunk.

--
 Mark Wieder
 ahsoftw...@gmail.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: DataGrid question...

2020-03-27 Thread Sean Cole (Pi) via use-livecode
Still, adding images to a field for this kind of purpose is a great shout.
Even better if the mouse click handler can determine the column and row,
which isn't much of a trick.

Thanks for the insights.

Sean

On Thu, 26 Mar 2020 at 22:05, Mark Wieder via use-livecode <
use-livecode@lists.runrev.com> wrote:

> On 3/26/20 2:57 PM, Brian Milby via use-livecode wrote:
> > Probably would need to use drawingSvgCompile instead of a widget.  Then
> you could turn an SVG drawing into an image.
>
> Right. But that wouldn't embed the actual widget in the field, just act
> as a placeholder.
>
> --
>   Mark Wieder
>   ahsoftw...@gmail.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
>
___
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: DataGrid question...

2020-03-26 Thread Mark Wieder via use-livecode

On 3/26/20 2:57 PM, Brian Milby via use-livecode wrote:

Probably would need to use drawingSvgCompile instead of a widget.  Then you 
could turn an SVG drawing into an image.


Right. But that wouldn't embed the actual widget in the field, just act 
as a placeholder.


--
 Mark Wieder
 ahsoftw...@gmail.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: DataGrid question...

2020-03-26 Thread Brian Milby via use-livecode
Probably would need to use drawingSvgCompile instead of a widget.  Then you 
could turn an SVG drawing into an image.

Thanks,
Brian
On Mar 26, 2020, 5:37 PM -0400, Mark Wieder via use-livecode 
, wrote:
> On 3/24/20 9:17 PM, Pi Digital via use-livecode wrote:
> > Oh. Cool. I did not know you could do that! Can it do widgets (for svgs) 
> > and checkboxes too?
>
> Sorry - I missed this earlier. I have faked checkboxes before by
> exporting snapshots of the checked and unchecked boxes, and then
> changing the imagesource when I receive a mouseUp. It's a bit of an ugly
> workaround, especially working out the mouseControl, mouseClick, etc.
> but it does the job if you really need it.
>
> I've never had the need to embed a widget in a field, so I don't know
> about that one, but I'm not optimistic.
>
> --
> --
> Mark Wieder
> ahsoftw...@gmail.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
___
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: DataGrid question...

2020-03-26 Thread Mark Wieder via use-livecode

On 3/24/20 9:17 PM, Pi Digital via use-livecode wrote:

Oh. Cool. I did not know you could do that! Can it do widgets (for svgs) and 
checkboxes too?


Sorry - I missed this earlier. I have faked checkboxes before by 
exporting snapshots of the checked and unchecked boxes, and then 
changing the imagesource when I receive a mouseUp. It's a bit of an ugly 
workaround, especially working out the mouseControl, mouseClick, etc. 
but it does the job if you really need it.


I've never had the need to embed a widget in a field, so I don't know 
about that one, but I'm not optimistic.


--
--
 Mark Wieder
 ahsoftw...@gmail.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: DataGrid question...

2020-03-26 Thread Paul Dupuis via use-livecode

On 3/26/2020 4:31 PM, zryip theSlug via use-livecode wrote:

The "Freeze pane" stack is available here:
https://www.aslugontheroad.com/download/category/4-lab

It demonstrates how to scroll, select and sort two datagrids synchronizaly.


 Thank you. That is really a helpful time saver. All I need to add to 
it for my use is a overlaid resize between the fixed datagrid and the 
scrolling one and I have multi-field resized code all over the pace to 
reuse.


Thanks again for sharing!

___
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: DataGrid question...

2020-03-26 Thread zryip theSlug via use-livecode
The "Freeze pane" stack is available here:
https://www.aslugontheroad.com/download/category/4-lab

It demonstrates how to scroll, select and sort two datagrids synchronizaly.

On Thu, Mar 26, 2020 at 3:55 PM Paul Dupuis via use-livecode
 wrote:
>
> On 3/26/2020 9:54 AM, zryip theSlug via use-livecode wrote:
> > Paul,
> >
> > I have somewhere a stack demonstrating how to use a second datagrid
> > with the columns to freeze and how to synchronize this second datagrid
> > with the main datagrid when the rows are scrolled.
> >
> > If you may interested I can share it.
> >
> >
>
> Very interested!
>
> Given everyone's responses, I was just about to code something up myself
> using two Datagids for consistency in user interface.
>
> Thank you!
>
> ___
> 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



-- 
Zryip TheSlug
http://www.aslugontheroad.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: DataGrid question...

2020-03-26 Thread Paul Dupuis via use-livecode

On 3/26/2020 9:54 AM, zryip theSlug via use-livecode wrote:

Paul,

I have somewhere a stack demonstrating how to use a second datagrid
with the columns to freeze and how to synchronize this second datagrid
with the main datagrid when the rows are scrolled.

If you may interested I can share it.




Very interested!

Given everyone's responses, I was just about to code something up myself 
using two Datagids for consistency in user interface.


Thank you!

___
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: DataGrid question...

2020-03-26 Thread Matthias Rebbe via use-livecode
Hi Zryip,

It would be awesome if you would share it anyway. ;)

Regards

Matthias 

Von meinem iPhone gesendet

> Am 26.03.2020 um 14:56 schrieb zryip theSlug via use-livecode 
> :
> 
> Paul,
> 
> I have somewhere a stack demonstrating how to use a second datagrid
> with the columns to freeze and how to synchronize this second datagrid
> with the main datagrid when the rows are scrolled.
> 
> If you may interested I can share it.
> 
>> On Wed, Mar 25, 2020 at 11:07 PM matthias rebbe via use-livecode
>>  wrote:
>> 
>> Thanks.
>> Matthias
>> 
>> 
 Am 25.03.2020 um 13:34 schrieb Tore Nilsen via use-livecode 
 :
>>> 
>>> What you should look for in the Dictionary  is tabAlign
>>> 
>>> Tore
>>> 
 25. mar. 2020 kl. 13:32 skrev matthias rebbe via use-livecode 
 mailto:use-livecode@lists.runrev.com>>:
 
> 
> Am 25.03.2020 um 01:26 schrieb Richard Gaskin via use-livecode 
> :
> 
> Paul Dupuis wrote:
> 
>> Has anyone come up with a way to configure a DataGrid (LC9) so that
>> the left most column remains visible when the other columns are
>> scrolled horizontally?
>> 
>> Or is the only way to to do this is to have a separate field to the
>> left of the DataGrid that holds the left column?
>> 
>> Anyone solved this already?
> 
> Not here. When all I need is a list I just use a list field.  Now that 
> LC's field supports independent column alignment I haven't needed a DG 
> for anything but forms.
> 
 
 
 Richard, do you know if there is a lesson for this available or is there 
 something written about it? To be honest, i must have missed that "new" 
 feature.
 
 I´ve searched already for column alignment, but can only find 
 lessons/information about Datagrids.
 
> Parse out the first col with a "split by column", drop it into a control 
> on the left, and you're good to go.
> 
 
 Matthias
 
 -
 Matthias Rebbe
 Life Is Too Short For Boring Code
 
 ___
 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 
>>> 
>> ___
>> 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
> 
> 
> 
> -- 
> Zryip TheSlug
> http://www.aslugontheroad.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


___
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: DataGrid question...

2020-03-26 Thread zryip theSlug via use-livecode
Paul,

I have somewhere a stack demonstrating how to use a second datagrid
with the columns to freeze and how to synchronize this second datagrid
with the main datagrid when the rows are scrolled.

If you may interested I can share it.

On Wed, Mar 25, 2020 at 11:07 PM matthias rebbe via use-livecode
 wrote:
>
> Thanks.
> Matthias
>
>
> > Am 25.03.2020 um 13:34 schrieb Tore Nilsen via use-livecode 
> > :
> >
> > What you should look for in the Dictionary  is tabAlign
> >
> > Tore
> >
> >> 25. mar. 2020 kl. 13:32 skrev matthias rebbe via use-livecode 
> >> mailto:use-livecode@lists.runrev.com>>:
> >>
> >>>
> >>> Am 25.03.2020 um 01:26 schrieb Richard Gaskin via use-livecode 
> >>> :
> >>>
> >>> Paul Dupuis wrote:
> >>>
>  Has anyone come up with a way to configure a DataGrid (LC9) so that
>  the left most column remains visible when the other columns are
>  scrolled horizontally?
> 
>  Or is the only way to to do this is to have a separate field to the
>  left of the DataGrid that holds the left column?
> 
>  Anyone solved this already?
> >>>
> >>> Not here. When all I need is a list I just use a list field.  Now that 
> >>> LC's field supports independent column alignment I haven't needed a DG 
> >>> for anything but forms.
> >>>
> >>
> >>
> >> Richard, do you know if there is a lesson for this available or is there 
> >> something written about it? To be honest, i must have missed that "new" 
> >> feature.
> >>
> >> I´ve searched already for column alignment, but can only find 
> >> lessons/information about Datagrids.
> >>
> >>> Parse out the first col with a "split by column", drop it into a control 
> >>> on the left, and you're good to go.
> >>>
> >>
> >> Matthias
> >>
> >> -
> >> Matthias Rebbe
> >> Life Is Too Short For Boring Code
> >>
> >> ___
> >> 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 
> > 
> ___
> 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



-- 
Zryip TheSlug
http://www.aslugontheroad.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: DataGrid question...

2020-03-25 Thread matthias rebbe via use-livecode
Thanks.
Matthias


> Am 25.03.2020 um 13:34 schrieb Tore Nilsen via use-livecode 
> :
> 
> What you should look for in the Dictionary  is tabAlign
> 
> Tore
> 
>> 25. mar. 2020 kl. 13:32 skrev matthias rebbe via use-livecode 
>> mailto:use-livecode@lists.runrev.com>>:
>> 
>>> 
>>> Am 25.03.2020 um 01:26 schrieb Richard Gaskin via use-livecode 
>>> :
>>> 
>>> Paul Dupuis wrote:
>>> 
 Has anyone come up with a way to configure a DataGrid (LC9) so that
 the left most column remains visible when the other columns are
 scrolled horizontally?
 
 Or is the only way to to do this is to have a separate field to the
 left of the DataGrid that holds the left column?
 
 Anyone solved this already?
>>> 
>>> Not here. When all I need is a list I just use a list field.  Now that LC's 
>>> field supports independent column alignment I haven't needed a DG for 
>>> anything but forms.
>>> 
>> 
>> 
>> Richard, do you know if there is a lesson for this available or is there 
>> something written about it? To be honest, i must have missed that "new" 
>> feature.
>> 
>> I´ve searched already for column alignment, but can only find 
>> lessons/information about Datagrids.
>> 
>>> Parse out the first col with a "split by column", drop it into a control on 
>>> the left, and you're good to go.
>>> 
>> 
>> Matthias
>> 
>> -
>> Matthias Rebbe
>> Life Is Too Short For Boring Code
>> 
>> ___
>> 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 
> 
___
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: DataGrid question...

2020-03-25 Thread Tore Nilsen via use-livecode
What you should look for in the Dictionary  is tabAlign

Tore

> 25. mar. 2020 kl. 13:32 skrev matthias rebbe via use-livecode 
> :
> 
>> 
>> Am 25.03.2020 um 01:26 schrieb Richard Gaskin via use-livecode 
>> :
>> 
>> Paul Dupuis wrote:
>> 
>>> Has anyone come up with a way to configure a DataGrid (LC9) so that
>>> the left most column remains visible when the other columns are
>>> scrolled horizontally?
>>> 
>>> Or is the only way to to do this is to have a separate field to the
>>> left of the DataGrid that holds the left column?
>>> 
>>> Anyone solved this already?
>> 
>> Not here. When all I need is a list I just use a list field.  Now that LC's 
>> field supports independent column alignment I haven't needed a DG for 
>> anything but forms.
>> 
> 
> 
> Richard, do you know if there is a lesson for this available or is there 
> something written about it? To be honest, i must have missed that "new" 
> feature.
> 
> I´ve searched already for column alignment, but can only find 
> lessons/information about Datagrids.
> 
>> Parse out the first col with a "split by column", drop it into a control on 
>> the left, and you're good to go.
>> 
> 
> Matthias
> 
> -
> Matthias Rebbe
> Life Is Too Short For Boring Code
> 
> ___
> 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: DataGrid question...

2020-03-25 Thread matthias rebbe via use-livecode
> 
> Am 25.03.2020 um 01:26 schrieb Richard Gaskin via use-livecode 
> :
> 
> Paul Dupuis wrote:
> 
>> Has anyone come up with a way to configure a DataGrid (LC9) so that
>> the left most column remains visible when the other columns are
>> scrolled horizontally?
>> 
>> Or is the only way to to do this is to have a separate field to the
>> left of the DataGrid that holds the left column?
>> 
>> Anyone solved this already?
> 
> Not here. When all I need is a list I just use a list field.  Now that LC's 
> field supports independent column alignment I haven't needed a DG for 
> anything but forms.
> 


Richard, do you know if there is a lesson for this available or is there 
something written about it? To be honest, i must have missed that "new" feature.

I´ve searched already for column alignment, but can only find 
lessons/information about Datagrids.

> Parse out the first col with a "split by column", drop it into a control on 
> the left, and you're good to go.
> 

Matthias

-
Matthias Rebbe
Life Is Too Short For Boring Code

___
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: DataGrid question...

2020-03-24 Thread Pi Digital via use-livecode
Oh. Cool. I did not know you could do that! Can it do widgets (for svgs) and 
checkboxes too?

Sean Cole
Pi Digital


> On 25 Mar 2020, at 03:56, Mark Wieder via use-livecode 
>  wrote:
> 
> On 3/24/20 6:43 PM, Pi Digital via use-livecode wrote:
>> The only issue with using a field is you are limited to character data 
>> presentation only. You can’t put inline images, widgets, checkboxes, etc.
> 
> Now that's just patently not true. No problem with images:
> Set the imagesource of char x of field y of this card to tImageID
> 
> -- 
> Mark Wieder
> ahsoftw...@gmail.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
___
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: DataGrid question...

2020-03-24 Thread Mark Wieder via use-livecode

On 3/24/20 6:43 PM, Pi Digital via use-livecode wrote:

The only issue with using a field is you are limited to character data 
presentation only. You can’t put inline images, widgets, checkboxes, etc.


Now that's just patently not true. No problem with images:
Set the imagesource of char x of field y of this card to tImageID

--
 Mark Wieder
 ahsoftw...@gmail.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: DataGrid question...

2020-03-24 Thread Pi Digital via use-livecode
The only issue with using a field is you are limited to character data 
presentation only. You can’t put inline images, widgets, checkboxes, etc. 

For HTML5 deployment I’ve ended up reinventing the wheel with a DataGridV3. 
I’ve gradually even made it quite generic in code so that it handles whatever 
data type and layout I throw at it. Still WIP. I should add in row and column 
freezes. At the moment it only vscrolls, so maybe when I add in hscroll 
functionality. 

I was Just saying to someone else, we need ‘someone’ fluent in LCB to create a 
DG widget. Allowing for customisation is the hard part. 

Sean Cole
Pi Digital Productions Ltd


eMail Ts & Cs

> Not here. When all I need is a list I just use a list field.  Now that LC's 
> field supports independent column alignment I haven't needed a DG for 
> anything but forms.
> 
> Parse out the first col with a "split by column", drop it into a control on 
> the left, and you're good to go.
> 
___
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: DataGrid question...

2020-03-24 Thread Richard Gaskin via use-livecode

Paul Dupuis wrote:

> Has anyone come up with a way to configure a DataGrid (LC9) so that
> the left most column remains visible when the other columns are
> scrolled horizontally?
>
> Or is the only way to to do this is to have a separate field to the
> left of the DataGrid that holds the left column?
>
> Anyone solved this already?

Not here. When all I need is a list I just use a list field.  Now that 
LC's field supports independent column alignment I haven't needed a DG 
for anything but forms.


Parse out the first col with a "split by column", drop it into a control 
on the left, and you're good to go.


--
 Richard Gaskin
 Fourth World Systems
 Software Design and Development for the Desktop, Mobile, and the Web
 
 ambassa...@fourthworld.comhttp://www.FourthWorld.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: DataGrid question...

2020-03-24 Thread dunbarx--- via use-livecode
I am with Bob on this.
Oftentimes, just out of stubbornness, I will try to create a "native" solution 
to some problem. Native here means that I try to force, bend, cajole, whatever, 
the built-in functionality of LC to make an effect the way I want it. The 
stubbornness comes from trying to be as lean a possible.
All that when, say, one more field placed in the right spot, and acting nicely 
will do the same thing. And usually with far less management and with far 
smaller scripts.
I am trying to get better.
Craig


-Original Message-
From: Bob Sneidar via use-livecode 
To: How to use LiveCode 
Cc: Bob Sneidar 
Sent: Tue, Mar 24, 2020 5:21 pm
Subject: Re: DataGrid question...

I did something along these lines some time ago. I needed check boxes to the 
left of a data grid that scrolled with the grid but remained visible.

Yes your idea of a second object that scrolls with the data grid is the way to 
go. There is a message that gets sent to a data grid called scrollBarDrag. Trap 
for that then scroll your other object accordingly.

Bob S


On Mar 24, 2020, at 2:12 PM, Paul Dupuis via use-livecode 
mailto:use-livecode@lists.runrev.com>> wrote:

Has anyone come up with a way to configure a DataGrid (LC9) so that the left 
most column remains visible when the other columns are scrolled horizontally?

Or is the only way to to do this is to have a separate field to the left of the 
DataGrid that holds the left column?

Anyone solved this already?

___
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: DataGrid question...

2020-03-24 Thread Bob Sneidar via use-livecode
I did something along these lines some time ago. I needed check boxes to the 
left of a data grid that scrolled with the grid but remained visible.

Yes your idea of a second object that scrolls with the data grid is the way to 
go. There is a message that gets sent to a data grid called scrollBarDrag. Trap 
for that then scroll your other object accordingly.

Bob S


On Mar 24, 2020, at 2:12 PM, Paul Dupuis via use-livecode 
mailto:use-livecode@lists.runrev.com>> wrote:

Has anyone come up with a way to configure a DataGrid (LC9) so that the left 
most column remains visible when the other columns are scrolled horizontally?

Or is the only way to to do this is to have a separate field to the left of the 
DataGrid that holds the left column?

Anyone solved this already?

___
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: Datagrid question

2015-04-16 Thread Peter Haworth
You need to dispatch or send the setDataOfIndex to the datagrid.

Pete
lcSQL Software
On Apr 15, 2015 9:59 PM, William Prothero proth...@earthednet.org wrote:

 Thanks! Worked like a charm. Now I suppose, to get it back in the data
 grid cell, it’s:

 local savedColumnINdex,savedRowIndex   —saved from command that loaded the
 data from the cell into the field.

 on mouseUp
 put fld “editedCellContents” into myEditedData
 setDataOfIndex(savedRowIndex, savedColumnINdex, myEditedData)
 end mouseUp

 Whoops! Not quite. The button doesn’t find the handler. I’ll have to
 fiddle with it more tomorrow. It’s late here.
 Thanks,
 Bill

  On Apr 15, 2015, at 5:33 PM, dunb...@aol.com wrote:
 
  on mouseDown
put getDataOfIndex(the dgHilitedIndexes of me,the dgColumn of the
 target) into vld yourField
  end mouseDown

 ___
 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: Datagrid question

2015-04-16 Thread Peter Haworth
setDataOfIndex doesn't redraw the datagrid. Add a call to RefreshIndex
after your setDataOfIndex.

Pete
lcSQL Software http://www.lcsql.com
Home of lcStackBrowser http://www.lcsql.com/lcstackbrowser.html and
SQLiteAdmin http://www.lcsql.com/sqliteadmin.html

On Thu, Apr 16, 2015 at 10:23 AM, William Prothero proth...@earthednet.org
wrote:

 I’m missing something. I have the script, in the datagrid group script:

 local savedRowIndex, savedColumnIndex

 —this works as expected
 on mouseDown
put  the dgHilitedIndexes of me into savedRowIndex
put the dgColumn of the target into savedColumnIndex
   put getDataOfIndex(the dgHilitedIndexes of me,the dgColumn of the
 target) into fld editValue
 end mouseDown

 —This handler doesn’t seem to update the data grid, because when I click
 the cell again, the changes aren’t there.
 on saveLastEditedCell
if savedRowIndex= or savedColumnIndex= then
   exit saveLastEditedCell
end if
put fld editValue into myData
setDataOfIndex(savedColumnIndex, savedRowIndex, myData)
 end saveLastEditedCell

 This gets the data and puts it into the field. I then make changes and in
 a button, dispatch “saveLastEditedCell” to the dg group script. But, it
 doesn’t update the cell data. There are no errors thrown, but obviously, I
 am missing something.

 Bill


  On Apr 16, 2015, at 8:48 AM, Peter Haworth p...@lcsql.com wrote:
 
  You need to dispatch or send the setDataOfIndex to the datagrid.
 
  Pete
  lcSQL Software
  On Apr 15, 2015 9:59 PM, William Prothero proth...@earthednet.org
 wrote:
 
  Thanks! Worked like a charm. Now I suppose, to get it back in the data
  grid cell, it’s:
 
  local savedColumnINdex,savedRowIndex   —saved from command that loaded
 the
  data from the cell into the field.
 
  on mouseUp
 put fld “editedCellContents” into myEditedData
 setDataOfIndex(savedRowIndex, savedColumnINdex, myEditedData)
  end mouseUp
 
  Whoops! Not quite. The button doesn’t find the handler. I’ll have to
  fiddle with it more tomorrow. It’s late here.
  Thanks,
  Bill
 
  On Apr 15, 2015, at 5:33 PM, dunb...@aol.com wrote:
 
  on mouseDown
   put getDataOfIndex(the dgHilitedIndexes of me,the dgColumn of the
  target) into vld yourField
  end mouseDown
 
  ___
  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

 ___
 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: Datagrid question

2015-04-16 Thread William Prothero
I’m missing something. I have the script, in the datagrid group script:

local savedRowIndex, savedColumnIndex

—this works as expected
on mouseDown
   put  the dgHilitedIndexes of me into savedRowIndex
   put the dgColumn of the target into savedColumnIndex
  put getDataOfIndex(the dgHilitedIndexes of me,the dgColumn of the target) 
into fld editValue
end mouseDown

—This handler doesn’t seem to update the data grid, because when I click the 
cell again, the changes aren’t there.
on saveLastEditedCell
   if savedRowIndex= or savedColumnIndex= then
  exit saveLastEditedCell
   end if
   put fld editValue into myData
   setDataOfIndex(savedColumnIndex, savedRowIndex, myData)
end saveLastEditedCell

This gets the data and puts it into the field. I then make changes and in a 
button, dispatch “saveLastEditedCell” to the dg group script. But, it doesn’t 
update the cell data. There are no errors thrown, but obviously, I am missing 
something.

Bill


 On Apr 16, 2015, at 8:48 AM, Peter Haworth p...@lcsql.com wrote:
 
 You need to dispatch or send the setDataOfIndex to the datagrid.
 
 Pete
 lcSQL Software
 On Apr 15, 2015 9:59 PM, William Prothero proth...@earthednet.org wrote:
 
 Thanks! Worked like a charm. Now I suppose, to get it back in the data
 grid cell, it’s:
 
 local savedColumnINdex,savedRowIndex   —saved from command that loaded the
 data from the cell into the field.
 
 on mouseUp
put fld “editedCellContents” into myEditedData
setDataOfIndex(savedRowIndex, savedColumnINdex, myEditedData)
 end mouseUp
 
 Whoops! Not quite. The button doesn’t find the handler. I’ll have to
 fiddle with it more tomorrow. It’s late here.
 Thanks,
 Bill
 
 On Apr 15, 2015, at 5:33 PM, dunb...@aol.com wrote:
 
 on mouseDown
  put getDataOfIndex(the dgHilitedIndexes of me,the dgColumn of the
 target) into vld yourField
 end mouseDown
 
 ___
 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

___
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: Datagrid question

2015-04-16 Thread William Prothero
Got it! Thanks!
Bill

 On Apr 16, 2015, at 10:53 AM, Peter Haworth p...@lcsql.com wrote:
 
 RefreshIndex

___
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: Datagrid question

2015-04-15 Thread William Prothero
Thanks! Worked like a charm. Now I suppose, to get it back in the data grid 
cell, it’s:

local savedColumnINdex,savedRowIndex   —saved from command that loaded the data 
from the cell into the field.

on mouseUp
put fld “editedCellContents” into myEditedData
setDataOfIndex(savedRowIndex, savedColumnINdex, myEditedData)
end mouseUp

Whoops! Not quite. The button doesn’t find the handler. I’ll have to fiddle 
with it more tomorrow. It’s late here.
Thanks,
Bill

 On Apr 15, 2015, at 5:33 PM, dunb...@aol.com wrote:
 
 on mouseDown
   put getDataOfIndex(the dgHilitedIndexes of me,the dgColumn of the target) 
 into vld yourField
 end mouseDown

___
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: Datagrid question

2015-04-15 Thread dunbarx
Hi.


Nobody understands dataGrids, though they are wonderful tools. Try this in the 
group script:





on mouseDown
   put getDataOfIndex(the dgHilitedIndexes of me,the dgColumn of the target) 
into vld yourField
end mouseDown



Craig Newman




-Original Message-
From: William Prothero proth...@earthednet.org
To: Use-livecode Use-livecode use-livecode@lists.runrev.com
Sent: Wed, Apr 15, 2015 7:58 pm
Subject: Datagrid question


I’m trying to set up the dataGrid to put the cell contents in another field, for
editing, when I click on it. Some of the cells may contain a fair amount of
text, and I won’t be able to edit it in the cell itself. 

The tutorials refer
to the revDataGridLibrary.  Can’t find it. Or could the tutorials be out of
date? Or, more likely, I’m missing something?

That withstanding, the tutorials
say there is a message named “EditValue”. Is this still correct? I can’t get the
message to trigger.

Best,
Bill

William A.
Prothero
http://es.earthednet.org/

___
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: Datagrid Question

2011-09-21 Thread zryip theSlug
On Wed, Sep 21, 2011 at 12:20 AM, Pete p...@mollysrevenge.com wrote:

Hi Pete,

 Thanks for explanation.  So if I have set a column to be non-editable and I
 create a custom behavior for it, it will become editable?  How about if the
 datagrid itself has been set to be non-editable?  Just trying to get a
 handle on this since I couldn't find anything in the datagrid docs about it.

If you have a field in your column template, it will be non-editable
because of the code inside the mouseDoubleUp handler:

on mouseDoubleUp pMouseBtnNum
if pMouseBtnNum is 1 then
if word 1 of the target is field then
if the dgProps[allow editing] of the dgControl of me \
and the dgColumnIsEditable[the dgColumn of me] of
the dgControl of me then
EditCellOfIndex the dgColumn of me, the dgIndex of me
exit mouseDoubleUp
end if
end if
end if

pass mouseDoubleUp
end mouseDoubleUp

However, if you have a control such as a button or a menu button in
your column template, one could click on the button for getting an
action or selecting a menu. In this case the non-editable property is
not applied.

For a field you have nothing to do to keep it non-editable accordingly
of the dgColumnIsEditable property.
For a different control, you have to code how the control will be non-editable.

 Maybe it's the way I use datagrids but I can't think of a single situation I
 have come across where I did not want a column containing a field to be
 aligned according to its column alignment.  In fact, I have option menus and
 checkboxes that I really want to be aligned according to the column's
 alignment property and ended up writing code to make that happen.  In other
 words, at least for me, ignoring the column alignment property should be the
 exception, not the rule.

The developer has full freedom to manage how controls will be aligned
depending of the template content. A column template, could contain
one or more controls, and a developer would probably have them
centered differently than other developers. Have something following a
rule will satisfy some of them and give limits to others, as it
depends on how the developer want to place the controls in his
project.
Have the content of the default field aligned, is the normal behavior.
As soon as, the column is customized, it loses the default heritage
and the developer has to manage what he wants for the column.


Best regards,
-- 
-Zryip TheSlug- wish you the best! 8)
http://www.aslugontheroad.co.cc

___
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: Datagrid Question

2011-09-20 Thread Pete
Hi Marty,
Best I can think of is to get the dgProps[column widths] property of the
datagrid.  It contains a comma-delimited list of the widths of the columns
so by adding up the first 3 items of the list, you'll get the left edge of
the 4th column, and adding the first 4 items of that list, you'll get the
right edge of the 4th column, both relative to the left edge of the
datagrid.  From that you can figure out thew width and placement of your
field. I don't know if the width includes the separator line between the
columns.
Pete
Molly's Revenge http://www.mollysrevenge.com




On Mon, Sep 19, 2011 at 8:22 PM, Marty Knapp martykn...@comcast.net wrote:

 I have a datagrid with several columns, column 4 of which contains a
 number. Under the datagrid I have placed a field that keeps a total of the
 values in this column. I would like this field to match the width of column
 4 and align itself directly under it so that if a user changes the column
 width, my total field will realign itself with the width and placement of
 the column. How would I go about doing this?

 Thanks,
 Marty Knapp

 __**_
 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-livecodehttp://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: Datagrid Question

2011-09-20 Thread Marty Knapp

Thanks Pete,
I have very limited experience with datagrids. What message is sent when 
the user resizes a column? Where in the datagrid would I place my script 
- in the group script?


Thanks,
Mart K

Hi Marty,
Best I can think of is to get the dgProps[column widths] property of the
datagrid.  It contains a comma-delimited list of the widths of the columns
so by adding up the first 3 items of the list, you'll get the left edge of
the 4th column, and adding the first 4 items of that list, you'll get the
right edge of the 4th column, both relative to the left edge of the
datagrid.  From that you can figure out thew width and placement of your
field. I don't know if the width includes the separator line between the
columns.
Pete
Molly's Revengehttp://www.mollysrevenge.com




On Mon, Sep 19, 2011 at 8:22 PM, Marty Knappmartykn...@comcast.net  wrote:


I have a datagrid with several columns, column 4 of which contains a
number. Under the datagrid I have placed a field that keeps a total of the
values in this column. I would like this field to match the width of column
4 and align itself directly under it so that if a user changes the column
width, my total field will realign itself with the width and placement of
the column. How would I go about doing this?

Thanks,
Marty Knapp



___
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: Datagrid Question

2011-09-20 Thread Pete
PS to my other post.  I found am much better way to do this.

First, set up a custom behavior for your column 4.  Then in the
LayoutControl handler of the custom behavior, add the following code:

*put* the rectangle of field Total into myRect
*put* item 1 of pcontrolRect into item 1 of myRect
*put* item 3 of pcontrolRect into item 3 of myRect
*set* the rectangle of field Total to myRect
Tested it out and seems to work fine.




On Mon, Sep 19, 2011 at 8:22 PM, Marty Knapp martykn...@comcast.net wrote:

 I have a datagrid with several columns, column 4 of which contains a
 number. Under the datagrid I have placed a field that keeps a total of the
 values in this column. I would like this field to match the width of column
 4 and align itself directly under it so that if a user changes the column
 width, my total field will realign itself with the width and placement of
 the column. How would I go about doing this?

 Thanks,
 Marty Knapp

 __**_
 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-livecodehttp://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: Datagrid Question

2011-09-20 Thread Pete
Hi Marty,
Just posted a more specific way to do this using the LayoutControl handler
of the datagrid's custom behavior.  If you're not familiar with setting up
custom behaviors:

- go to the Columns tab of the inspector for the datagrid
- highlight your column 4
- click the plus sign at the bottom of the inspector tab
- close the resulting stack window without making any changes
- back in the inspector, make sure your column 4 is still highlighted then
click the Custom Behavior button to open the script

I'm not entirely convinced LayoutControl is the best place for the code but
I can't find any reference to a message that is sent when a datagrid column
is resized.

Hope that makes it more clear

Pete
Molly's Revenge http://www.mollysrevenge.com




On Tue, Sep 20, 2011 at 9:50 AM, Marty Knapp martykn...@comcast.net wrote:

 Thanks Pete,
 I have very limited experience with datagrids. What message is sent when
 the user resizes a column? Where in the datagrid would I place my script -
 in the group script?

 Thanks,
 Mart K

 Hi Marty,
 Best I can think of is to get the dgProps[column widths] property of the
 datagrid.  It contains a comma-delimited list of the widths of the columns
 so by adding up the first 3 items of the list, you'll get the left edge of
 the 4th column, and adding the first 4 items of that list, you'll get the
 right edge of the 4th column, both relative to the left edge of the
 datagrid.  From that you can figure out thew width and placement of your
 field. I don't know if the width includes the separator line between the
 columns.
 Pete
 Molly's Revengehttp://www.**mollysrevenge.comhttp://www.mollysrevenge.com
 





 On Mon, Sep 19, 2011 at 8:22 PM, Marty Knappmartykn...@comcast.net
  wrote:

  I have a datagrid with several columns, column 4 of which contains a
 number. Under the datagrid I have placed a field that keeps a total of
 the
 values in this column. I would like this field to match the width of
 column
 4 and align itself directly under it so that if a user changes the column
 width, my total field will realign itself with the width and placement of
 the column. How would I go about doing this?

 Thanks,
 Marty Knapp


 __**_
 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-livecodehttp://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: Datagrid Question

2011-09-20 Thread Marty Knapp
That seems to work great Pete. I've now lost the right alignment of the 
column - it's reverted back to left. I see that there's a 
dgColumnAlignment but I'm not figuring out how to make that work. The 
setting in the property inspector is ignored . . .


Marty

Hi Marty,
Just posted a more specific way to do this using the LayoutControl handler
of the datagrid's custom behavior.  If you're not familiar with setting up
custom behaviors:

- go to the Columns tab of the inspector for the datagrid
- highlight your column 4
- click the plus sign at the bottom of the inspector tab
- close the resulting stack window without making any changes
- back in the inspector, make sure your column 4 is still highlighted then
click the Custom Behavior button to open the script

I'm not entirely convinced LayoutControl is the best place for the code but
I can't find any reference to a message that is sent when a datagrid column
is resized.

Hope that makes it more clear

Pete
Molly's Revengehttp://www.mollysrevenge.com




On Tue, Sep 20, 2011 at 9:50 AM, Marty Knappmartykn...@comcast.net  wrote:


Thanks Pete,
I have very limited experience with datagrids. What message is sent when
the user resizes a column? Where in the datagrid would I place my script -
in the group script?

Thanks,
Mart K


Hi Marty,
Best I can think of is to get the dgProps[column widths] property of the
datagrid.  It contains a comma-delimited list of the widths of the columns
so by adding up the first 3 items of the list, you'll get the left edge of
the 4th column, and adding the first 4 items of that list, you'll get the
right edge of the 4th column, both relative to the left edge of the
datagrid.  From that you can figure out thew width and placement of your
field. I don't know if the width includes the separator line between the
columns.
Pete
Molly's Revengehttp://www.**mollysrevenge.comhttp://www.mollysrevenge.com




On Mon, Sep 19, 2011 at 8:22 PM, Marty Knappmartykn...@comcast.net
  wrote:

  I have a datagrid with several columns, column 4 of which contains a

number. Under the datagrid I have placed a field that keeps a total of
the
values in this column. I would like this field to match the width of
column
4 and align itself directly under it so that if a user changes the column
width, my total field will realign itself with the width and placement of
the column. How would I go about doing this?

Thanks,
Marty Knapp




___
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: Datagrid Question

2011-09-20 Thread zryip theSlug
On Tue, Sep 20, 2011 at 5:22 AM, Marty Knapp martykn...@comcast.net wrote:
 I have a datagrid with several columns, column 4 of which contains a number.
 Under the datagrid I have placed a field that keeps a total of the values in
 this column. I would like this field to match the width of column 4 and
 align itself directly under it so that if a user changes the column width,
 my total field will realign itself with the width and placement of the
 column. How would I go about doing this?

Hi Marty,

A possible solution is to use the datagrid's dgColumnWidth property,
inside the datagrid group script, to get the size of a column being
resized:

setprop dgColumnWidth [pColumn] pValue
  put pColumn  Sum into tTheSumField
  updateRectOfField tTheSumField, pValue

  pass dgColumnWidth
end dgColumnWidth

Where:
- pColumn is the column name
- pValue is the column width


Best regards,
-- 
-Zryip TheSlug- wish you the best! 8)
http://www.aslugontheroad.co.cc

___
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: Datagrid Question

2011-09-20 Thread zryip theSlug
On Tue, Sep 20, 2011 at 8:22 PM, Marty Knapp martykn...@comcast.net wrote:
 That seems to work great Pete. I've now lost the right alignment of the
 column - it's reverted back to left. I see that there's a dgColumnAlignment
 but I'm not figuring out how to make that work. The setting in the property
 inspector is ignored . . .

Hi Marty,

If you have customized the column script, you have to manage the
alignment yourself by using a line of script such as the following:
set the textAlign of field 1 of me to the dgColumnAlignment[the
dgColumn of me] of the dgControl of me

You can place this line in the layoutcontrol handler, to have the
column alignment updated after any change of the dgColumnAlignment
column property.


Best regards,
-- 
-Zryip TheSlug- wish you the best! 8)
http://www.aslugontheroad.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: Datagrid Question

2011-09-20 Thread Marty Knapp
Thanks zryip! That did the trick. Thanks to Pete as well. I appreciate 
you guys helping me out with this.


Marty K

On Tue, Sep 20, 2011 at 8:22 PM, Marty Knappmartykn...@comcast.net  wrote:

That seems to work great Pete. I've now lost the right alignment of the
column - it's reverted back to left. I see that there's a dgColumnAlignment
but I'm not figuring out how to make that work. The setting in the property
inspector is ignored . . .

Hi Marty,

If you have customized the column script, you have to manage the
alignment yourself by using a line of script such as the following:
set the textAlign of field 1 of me to the dgColumnAlignment[the
dgColumn of me] of the dgControl of me

You can place this line in the layoutcontrol handler, to have the
column alignment updated after any change of the dgColumnAlignment
column property.


Best regards,



___
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: Datagrid Question

2011-09-20 Thread zryip theSlug
On Tue, Sep 20, 2011 at 9:19 PM, Pete p...@mollysrevenge.com wrote:
 Thanks zryip, that does fix the problem.  But I have to say that it seems
 really cumbersome to have to do this.  Does it apply to any properties of
 the column?

Hi Pete,

- The dgColumnAlignment is a column property which directly affected a
control in the default template for a datagrid. It is an equivalent
for setting the alignment property of the template field.
- The second is the dgColumnEditable property which allows or not the
edition of the default template field.

The way for customizing the template and the column behavior script,
offers great possibilities to developers, far away that managing a
simple field in the column. If one customizes a column, the datagrid
library just assumes one have replaced the default template field by 1
or several controls. So, the developers have and can manage those
controls the way they want, for example:
- by setting the alignment of the control (the field or whatever other
control we could have added in the template)
- by setting the effect they want for a non-editable column: lock the
field, disable a menu button or button, etc.


Best regards,
-- 
-Zryip TheSlug- wish you the best! 8)
http://www.aslugontheroad.co.cc

___
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: Datagrid Question

2011-09-20 Thread Pete
Thanks for explanation.  So if I have set a column to be non-editable and I
create a custom behavior for it, it will become editable?  How about if the
datagrid itself has been set to be non-editable?  Just trying to get a
handle on this since I couldn't find anything in the datagrid docs about it.

Maybe it's the way I use datagrids but I can't think of a single situation I
have come across where I did not want a column containing a field to be
aligned according to its column alignment.  In fact, I have option menus and
checkboxes that I really want to be aligned according to the column's
alignment property and ended up writing code to make that happen.  In other
words, at least for me, ignoring the column alignment property should be the
exception, not the rule.

It makes things even more confusing that the inspector for the column still
shows the original alignment property even though it's not observed.
 Personally, I would prefer that the inspector alignment option included an
undefined ,or something similar, option to deal with these circumstances.


Pete
Molly's Revenge http://www.mollysrevenge.com




On Tue, Sep 20, 2011 at 2:52 PM, zryip theSlug zryip.thes...@gmail.comwrote:

 On Tue, Sep 20, 2011 at 9:19 PM, Pete p...@mollysrevenge.com wrote:
  Thanks zryip, that does fix the problem.  But I have to say that it seems
  really cumbersome to have to do this.  Does it apply to any properties of
  the column?

 Hi Pete,

 - The dgColumnAlignment is a column property which directly affected a
 control in the default template for a datagrid. It is an equivalent
 for setting the alignment property of the template field.
 - The second is the dgColumnEditable property which allows or not the
 edition of the default template field.

 The way for customizing the template and the column behavior script,
 offers great possibilities to developers, far away that managing a
 simple field in the column. If one customizes a column, the datagrid
 library just assumes one have replaced the default template field by 1
 or several controls. So, the developers have and can manage those
 controls the way they want, for example:
 - by setting the alignment of the control (the field or whatever other
 control we could have added in the template)
 - by setting the effect they want for a non-editable column: lock the
 field, disable a menu button or button, etc.


 Best regards,
 --
 -Zryip TheSlug- wish you the best! 8)
 http://www.aslugontheroad.co.cc

 ___
 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: Datagrid question

2011-03-24 Thread Klaus on-rev
Hi Zryip,

 On Wed, Mar 23, 2011 at 8:58 PM, Klaus on-rev kl...@major.on-rev.com wrote:
 Hi friends,
 Hi Klaus,
 is it possible to create a datagrid FORM that can act like 2 or more
 independant clickable Cells? (separate row wannabees) in one row?
 Yes
 Know what I mean? Something like this mockup:
 http://www.major-k.de/temp/DataGridsRows.jpg
 Any hints, tricks, hacks welcome :-)
 A possible way is to edit the template of the dg form for adding
 severals buttons or images controls, acting as cells.
 In the row behavior you should have 2 main handlers:
 1. Fillindata for displaying the corresponding data for the cell
 ...

I finally got it so far, thankls a lot!

And I fake the hiliting of a cell by setting the opaque of an underlying 
button to true.
This works fine in every row.

But I have ni idea how to unhilite the last cell when the user click into 
another row!?
Know what I mean?

I am sure I can do this with on selectionchanged tNewRow,tOldRow in the 
datagrid 
script somehow, but I have no idea of the snytax to address objects in the 
tOldRow row.

Any hints very welcome!

 Best,
 -- 
 -Zryip TheSlug- wish you the best! 8)

Best

Klaus

--
Klaus Major
http://www.major-k.de
kl...@major.on-rev.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: Datagrid question

2011-03-24 Thread Bob Sneidar
Store the currently selected object in a property of the datagrid, and every 
time the selection changes, set the property. 

Bob


On Mar 24, 2011, at 8:52 AM, Klaus on-rev wrote:

 But I have ni idea how to unhilite the last cell when the user click into 
 another row!?
 Know what I mean?
 
 I am sure I can do this with on selectionchanged tNewRow,tOldRow in the 
 datagrid 
 script somehow, but I have no idea of the snytax to address objects in the 
 tOldRow row.
 
 Any hints very welcome!


___
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: Datagrid question

2011-03-24 Thread Klaus on-rev
Hi Bob,

 Store the currently selected object in a property of the datagrid, and 
 every time the selection changes, set the property. 

wonderful, works great! Thanks a lot!

 Bob

Best

Klaus

--
Klaus Major
http://www.major-k.de
kl...@major.on-rev.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: Datagrid question

2011-03-23 Thread zryip theSlug
On Wed, Mar 23, 2011 at 8:58 PM, Klaus on-rev kl...@major.on-rev.com wrote:
 Hi friends,

Hi Klaus,

 is it possible to create a datagrid FORM that can act like 2 or more
 independant clickable Cells? (separate row wannabees) in one row?

Yes

 Know what I mean? Something like this mockup:
 http://www.major-k.de/temp/DataGridsRows.jpg

 Any hints, tricks, hacks welcome :-)

A possible way is to edit the template of the dg form for adding
severals buttons or images controls, acting as cells.

In the row behavior you should have 2 main handlers:

1. Fillindata for displaying the corresponding data for the cell

Example using images in files

on FillInData pDataArray
   local tImagePath1, tImagePath2

   put pDataArray[file path 1] into tImagePath1
   put pDataArray[file path 2] into tImagePath2

   if (tImagePath1 is not empty) then
  put URL binfile:  tImagePath1 into tImageData
  put tImageData into image New image1 of me
   end if
   if (tImagePath2 is not empty) then
  put URL binfile:  tImagePath2 into tImageData
  put tImageData into image New image2 of me
   end if

   set the text of field Label1 of me to pDataArray[Image label 1]
   set the text of field Label2 of me to pDataArray[Image label 2]
end FillInData

2. MouseUp

on mouseUp pTheButton
   if (pTheButton is 1) then
  switch the short name of the target
 case New image1
answer Add your action here
break
 case New image2
answer Add your action here
break
 case New image3
answer Add your action here
break
  end switch
   end if
end mouseUp

Note DGH could be on some help with that. You are welcome to download
it, the DGH trial version is free to use for 30 days and could give
you some help in your journey.

http://www.aslugontheroad.co.cc/index.php?option=com_phocadownloadview=categorydownload=17:data-grid-helper-pluginid=12:trialItemid=63


Best,
-- 
-Zryip TheSlug- wish you the best! 8)
http://www.aslugontheroad.co.cc

___
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: Datagrid question

2011-02-03 Thread Peter Haworth
Hi Trevor,
Here's an outline of what I'm trying to do.  I've used a custom version of the 
default header behavior to display a popup menu when the user clicks on a 
datagrid header.  That all works fine. When The user selects a menu item from 
the popup, I have a menuPick handler in the script of the popup menu that 
processes the choice and that's where I need to get access the properties I 
mentioned.

The script is able to get the ID of the datagrid and I tried things like put 
the dgColumn of group ID xyz but that throws a run time error.

I've put this code in the popup menu handler because I want to make the popup 
generically usable on any datagrid.  I would prefer to put in a behavior for 
the datagrid group but I don't think that's possible because the datagrid 
already has a behavior set for it?

Thanks,

Pete Haworth


On Feb 2, 2011, at 5:52 PM, Trevor DeVore wrote:

 What is the context that you are trying to get the dgColumn and the
 dgHeaderControl?


___
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: Datagrid question

2011-02-02 Thread Trevor DeVore
On Wed, Feb 2, 2011 at 7:41 PM, Peter Haworth p...@mollysrevenge.comwrote:

 I want to get hold of a couple of datagrid properties in a script that is
 not in the datagrid group -



 the dgColumn, and the dgHeaderControl.


These properties are usually used within the context of an event such as a
mouseClick. The user clicks on a control and you use these properties to
determine the target of the control. You would need to get a reference to a
column control and then do something like 'put the dgColumn of
theColumnControl'.


 dgColumnLabel


This is a property of the data grid itself.

put the dgColumnLabel[COLUMN_NAME] of group DataGrid

What is the context that you are trying to get the dgColumn and the
dgHeaderControl?

-- 
Trevor DeVore
Blue Mango Learning Systems
ScreenSteps: http://www.screensteps.com
LiveCode Resources for Developers: http://livecode.bluemangolearning.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: Datagrid question

2011-01-24 Thread Trevor DeVore
On Sat, Jan 22, 2011 at 4:21 PM, Peter Haworth p...@mollysrevenge.comwrote:

 I've put together a mouseDown handler that displays a stack window
 immediately below a datagrid column when the user right clicks on that
 column.  Right now it's in the group script of the datagrid.



 The dg manual says there is a default header behavior property so set that
 to the id of a button that includes my mousedown handler since I want this
 to be available to all the dataggrids in my app but the mousedown event
 never reaches my mousedown handler a breakpoint set at the start of it never
 gets triggered.


The mouseDown message may not reach the data grid group in all cases. For
example, I know it is not passed during column resizing operations. You
should add the mouseDown message to the default header behavior if you
want to process it. This lesson shows how to customize the header behavior
in order to add tooltips. Just follow the instructions but add your
mouseDown handler rather than the tooltip code.

http://lessons.runrev.com/spaces/lessons/manuals/datagrid_tips/lessons/7351-How-Do-I-Add-Tooltips-To-Column-Headers-

-- 
Trevor DeVore
Blue Mango Learning Systems
ScreenSteps: http://www.screensteps.com
LiveCode Resources for Developers: http://livecode.bluemangolearning.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