Re: clickability in a DataGrid

2013-01-23 Thread Sieg Lindstrom
Thanks, Peter  Craig.

It appears, Craig, that your solution is just the ticket. With your mouseUp 
handler in the group script, if I click on a column in the sixth row of the 
grid, I get the following parseable output:

field [column name] 0006

Exactly what I need. Thanks.

Minor sidebar question, which isn't remotely relevant for the stack in 
question: Does this mean DataGrids are limited to  rows?

Sieg Lindstrom

On Jan 22, 2013, at 7:21 PM, Craig Newman wrote:

 Hi.
 
 
 There are a few ways to do this. The old fashioned way is to write in the 
 group script:
 
 
 on mouseUp
  put the target
 end mouseUp
 
 
 You get a result that is easily deconstructed to row and column references.
 
 
 You can also trap the editFieldText message, or any of the row and column 
 properties.
 
 
 Craig Newman

___
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: clickability in a DataGrid

2013-01-23 Thread Sieg Lindstrom
Alas, I spoke too soon. The output on this handler correctly identifies the 
column by column name but the four digit integer that follows does not 
correspond to the row number.

Sieg Lindstrom


On Jan 22, 2013, at 7:21 PM, use-livecode-requ...@lists.runrev.com wrote:

 Hi.
 
 
 There are a few ways to do this. The old fashioned way is to write in the 
 group script:
 
 
 on mouseUp
  put the target
 end mouseUp
 
 
 You get a result that is easily deconstructed to row and column references.
 
 
 You can also trap the editFieldText message, or any of the row and column 
 properties.
 
 
 Craig Newman

___
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: clickability in a DataGrid

2013-01-23 Thread Marek Niesiobedzki
For me mouseUp handler is working correct.

Marek

___
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: clickability in a DataGrid

2013-01-23 Thread Klaus on-rev
Hej Sieg,

Am 23.01.2013 um 01:09 schrieb Sieg Lindstrom s...@trackandfieldnews.com:

 I've used LiveCode/RunRev for some time but an new to using DataGrids.
 
 What I'd like to do (for Mac/Windows users) is include a DataGrid configured 
 as, say, four columns of data followed by two columns that are the same in 
 each row: one that reads Delete and one that reads Edit. I'd like to set 
 it up so that if the user clicks on Delete or Edit in a given row that 
 then triggers handlers to either delete that row or edit the data contained 
 in the other four columns of that row of the grid.
 
 Using a standard text field with tab-delimited data in each row, I'd use the 
 ClickText and the ClickLine in the field script to determine what the user 
 clicked and trigger the appropriate actions. How would one achieve this in a 
 DataGrid?
 
 Thanks in advance!

well, DataGrids are extremely complex but also extremely powerful once you get 
to master them (more or less :-)

OK, presumed you have a datagrid of type TABLE with a column named delete and 
when the user clicks on that column
you want to delete the complete row of the datagrid, right?

Deleting -Put this into the datagrids script:

on mouseup

  ## WHAT column has been clickedß
   put the dgColumn of the target into tClickedColumnName

  ## User clicked the column delete:
   if tClickedColumnName = delete then

   ## Better ask EVERYTIME! ;-)
  answer Really delete? with Cancel or OK
  if it = Cancel then
 exit to top
  end if
  
 ## get the currently selected row
  put the dghilitedLines of me into tHL

## Now let the DG do the deletion
  dispatch DeleteLines to me with tHL
   end if
end mouseup

EDITING is definitively implemented in the default datagrid, just check 
editable in the inspector for the datagridand doubleclick 
any column to edit iits content. Or did I misunderstand your question about 
editing?

Get the complete datagrid manual as PDF here:
http://lessons.runrev.com/m/datagrid

Work through the example to get the grips.
I must confess that I need to re-read the docs everytime I did not work with 
DGs for more than one week, just too complex stuff :-D

 Sieg Lindstrom

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: clickability in a DataGrid

2013-01-23 Thread Peter Haworth
Hi Colin,
For some reason  your script now works as predicted instead of giving me a
reference to dgalternatingrows so sorry for the confusion.
Pete
lcSQL Software http://www.lcsql.com


On Tue, Jan 22, 2013 at 5:55 PM, dunb...@aol.com wrote:

 Hi.


 There are a few ways to do this. The old fashioned way is to write in the
 group script:


 on mouseUp
   put the target
 end mouseUp


 You get a result that is easily deconstructed to row and column references.


 You can also trap the editFieldText message, or any of the row and
 column properties.


 Craig Newman



 -Original Message-
 From: Peter Haworth p...@lcsql.com
 To: How to use LiveCode use-livecode@lists.runrev.com
 Sent: Tue, Jan 22, 2013 7:44 pm
 Subject: Re: clickability in a DataGrid


 Hi Sieg,
 I can't think of a way to detect a click in a specific cell of a datagrid.

 If nobody else can come up with something, a couple of alternatives would
 be to customize your Edit and Delete columns to contain buttons and put
 your delete/edit commands in the mouseUp handler for each button, or
 implement a right click popup menu with delete/edit options on it and put
 the logic in the menuPick handler for the popup.

 Would take too much space to describe how to do those things, but check out
 the datagrid manual for details.

 Pete
 lcSQL Software http://www.lcsql.com


 On Tue, Jan 22, 2013 at 4:09 PM, Sieg Lindstrom s...@trackandfieldnews.com
 wrote:

  I've used LiveCode/RunRev for some time but an new to using DataGrids.
 
  What I'd like to do (for Mac/Windows users) is include a DataGrid
  configured as, say, four columns of data followed by two columns that are
  the same in each row: one that reads Delete and one that reads Edit.
  I'd like to set it up so that if the user clicks on Delete or Edit
 in a
  given row that then triggers handlers to either delete that row or edit
 the
  data contained in the other four columns of that row of the grid.
 
  Using a standard text field with tab-delimited data in each row, I'd use
  the ClickText and the ClickLine in the field script to determine what the
  user clicked and trigger the appropriate actions. How would one achieve
  this in a DataGrid?
 
  Thanks in advance!
 
  Sieg Lindstrom
  ___
  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: clickability in a DataGrid

2013-01-23 Thread Peter Haworth
I think I figured it out - Hard to tell now but I don't think there was any
data in the datagrid when I did the original test.  Duh!!!
Pete
lcSQL Software http://www.lcsql.com


On Tue, Jan 22, 2013 at 7:16 PM, dunb...@aol.com wrote:

 Peter.


 Those are the row and column properties I meant. But I do not understand
 why you cannot get what I got with the mouseUp handler. It is the very
 first thing I ever did with a dataGrid, before I learned some of the other
 functionalities.


 With that handler,I get something like: field Col 1 0001


 which can be easily broken out as required. The handler is in the group
 script, right?


 Craig





 -Original Message-
 From: Peter Haworth p...@lcsql.com
 To: How to use LiveCode use-livecode@lists.runrev.com
 Sent: Tue, Jan 22, 2013 9:56 pm
 Subject: Re: clickability in a DataGrid


 Hi Craig,
 I tried your mouseUp Script and all I got was a reference to graphic
 dgalternatingrows no matter which row or column I click in.

 The EditFieldText trap would work but he'd have to double click the cell
 and I don't think that's what he had in mind.

 However, I think this seems to work as a scrip of the datagrid group
 (apologies if this ends up with asterisks all over it):

 *on* mouseUp pMouseBtnNum

   *if* pMouseBtnNum is 1 *then*

   *put* the dgColumn of the target,the dghilitedline of me

*end* *if*

 *end* mouseUp
 lcSQL Software http://www.lcsql.com


 On Tue, Jan 22, 2013 at 5:55 PM, dunb...@aol.com wrote:

  Hi.
 
 
  There are a few ways to do this. The old fashioned way is to write in the
  group script:
 
 
  on mouseUp
put the target
  end mouseUp
 
 
  You get a result that is easily deconstructed to row and column
 references.
 
 
  You can also trap the editFieldText message, or any of the row and
  column properties.
 
 
  Craig Newman
 
 
 
  -Original Message-
  From: Peter Haworth p...@lcsql.com
  To: How to use LiveCode use-livecode@lists.runrev.com
  Sent: Tue, Jan 22, 2013 7:44 pm
  Subject: Re: clickability in a DataGrid
 
 
  Hi Sieg,
  I can't think of a way to detect a click in a specific cell of a
 datagrid.
 
  If nobody else can come up with something, a couple of alternatives would
  be to customize your Edit and Delete columns to contain buttons and put
  your delete/edit commands in the mouseUp handler for each button, or
  implement a right click popup menu with delete/edit options on it and put
  the logic in the menuPick handler for the popup.
 
  Would take too much space to describe how to do those things, but check
 out
  the datagrid manual for details.
 
  Pete
  lcSQL Software http://www.lcsql.com
 
 
  On Tue, Jan 22, 2013 at 4:09 PM, Sieg Lindstrom 
 s...@trackandfieldnews.com
  wrote:
 
   I've used LiveCode/RunRev for some time but an new to using DataGrids.
  
   What I'd like to do (for Mac/Windows users) is include a DataGrid
   configured as, say, four columns of data followed by two columns that
 are
   the same in each row: one that reads Delete and one that reads
 Edit.
   I'd like to set it up so that if the user clicks on Delete or Edit
  in a
   given row that then triggers handlers to either delete that row or edit
  the
   data contained in the other four columns of that row of the grid.
  
   Using a standard text field with tab-delimited data in each row, I'd
 use
   the ClickText and the ClickLine in the field script to determine what
 the
   user clicked and trigger the appropriate actions. How would one achieve
   this in a DataGrid?
  
   Thanks in advance!
  
   Sieg Lindstrom
   ___
   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


 ___
 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

Re: clickability in a DataGrid

2013-01-23 Thread dunbarx
Who is Colin?


Craig Newman



-Original Message-
From: Peter Haworth p...@lcsql.com
To: How to use LiveCode use-livecode@lists.runrev.com
Sent: Wed, Jan 23, 2013 1:00 pm
Subject: Re: clickability in a DataGrid


Hi Colin,
For some reason  your script now works as predicted instead of giving me a
reference to dgalternatingrows so sorry for the confusion.
Pete
lcSQL Software http://www.lcsql.com


On Tue, Jan 22, 2013 at 5:55 PM, dunb...@aol.com wrote:

 Hi.


 There are a few ways to do this. The old fashioned way is to write in the
 group script:


 on mouseUp
   put the target
 end mouseUp


 You get a result that is easily deconstructed to row and column references.


 You can also trap the editFieldText message, or any of the row and
 column properties.


 Craig Newman



 -Original Message-
 From: Peter Haworth p...@lcsql.com
 To: How to use LiveCode use-livecode@lists.runrev.com
 Sent: Tue, Jan 22, 2013 7:44 pm
 Subject: Re: clickability in a DataGrid


 Hi Sieg,
 I can't think of a way to detect a click in a specific cell of a datagrid.

 If nobody else can come up with something, a couple of alternatives would
 be to customize your Edit and Delete columns to contain buttons and put
 your delete/edit commands in the mouseUp handler for each button, or
 implement a right click popup menu with delete/edit options on it and put
 the logic in the menuPick handler for the popup.

 Would take too much space to describe how to do those things, but check out
 the datagrid manual for details.

 Pete
 lcSQL Software http://www.lcsql.com


 On Tue, Jan 22, 2013 at 4:09 PM, Sieg Lindstrom s...@trackandfieldnews.com
 wrote:

  I've used LiveCode/RunRev for some time but an new to using DataGrids.
 
  What I'd like to do (for Mac/Windows users) is include a DataGrid
  configured as, say, four columns of data followed by two columns that are
  the same in each row: one that reads Delete and one that reads Edit.
  I'd like to set it up so that if the user clicks on Delete or Edit
 in a
  given row that then triggers handlers to either delete that row or edit
 the
  data contained in the other four columns of that row of the grid.
 
  Using a standard text field with tab-delimited data in each row, I'd use
  the ClickText and the ClickLine in the field script to determine what the
  user clicked and trigger the appropriate actions. How would one achieve
  this in a DataGrid?
 
  Thanks in advance!
 
  Sieg Lindstrom
  ___
  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

 
___
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: clickability in a DataGrid

2013-01-23 Thread Sieg Lindstrom
Thanks, Peter.

This script works. Thank you and apologies for my earlier confusion.

Sieg Lindstrom

On Jan 22, 2013, at 7:21 PM, Peter Haworth wrote:

 Hi Craig,
 I tried your mouseUp Script and all I got was a reference to graphic
 dgalternatingrows no matter which row or column I click in.
 
 The EditFieldText trap would work but he'd have to double click the cell
 and I don't think that's what he had in mind.
 
 However, I think this seems to work as a scrip of the datagrid group
 (apologies if this ends up with asterisks all over it):
 
 *on* mouseUp pMouseBtnNum
 
  *if* pMouseBtnNum is 1 *then*
 
  *put* the dgColumn of the target,the dghilitedline of me
 
   *end* *if*
 
 *end* mouseUp
 lcSQL Software http://www.lcsql.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: clickability in a DataGrid

2013-01-23 Thread Peter Haworth
Sorry, Craig is what I meant to type and I can't even blame auto-correct!
Pete
lcSQL Software http://www.lcsql.com


On Wed, Jan 23, 2013 at 10:05 AM, dunb...@aol.com wrote:

 Who is Colin?


 Craig Newman



 -Original Message-
 From: Peter Haworth p...@lcsql.com
 To: How to use LiveCode use-livecode@lists.runrev.com
 Sent: Wed, Jan 23, 2013 1:00 pm
 Subject: Re: clickability in a DataGrid


 Hi Colin,
 For some reason  your script now works as predicted instead of giving me a
 reference to dgalternatingrows so sorry for the confusion.
 Pete
 lcSQL Software http://www.lcsql.com


 On Tue, Jan 22, 2013 at 5:55 PM, dunb...@aol.com wrote:

  Hi.
 
 
  There are a few ways to do this. The old fashioned way is to write in the
  group script:
 
 
  on mouseUp
put the target
  end mouseUp
 
 
  You get a result that is easily deconstructed to row and column
 references.
 
 
  You can also trap the editFieldText message, or any of the row and
  column properties.
 
 
  Craig Newman
 
 
 
  -Original Message-
  From: Peter Haworth p...@lcsql.com
  To: How to use LiveCode use-livecode@lists.runrev.com
  Sent: Tue, Jan 22, 2013 7:44 pm
  Subject: Re: clickability in a DataGrid
 
 
  Hi Sieg,
  I can't think of a way to detect a click in a specific cell of a
 datagrid.
 
  If nobody else can come up with something, a couple of alternatives would
  be to customize your Edit and Delete columns to contain buttons and put
  your delete/edit commands in the mouseUp handler for each button, or
  implement a right click popup menu with delete/edit options on it and put
  the logic in the menuPick handler for the popup.
 
  Would take too much space to describe how to do those things, but check
 out
  the datagrid manual for details.
 
  Pete
  lcSQL Software http://www.lcsql.com
 
 
  On Tue, Jan 22, 2013 at 4:09 PM, Sieg Lindstrom 
 s...@trackandfieldnews.com
  wrote:
 
   I've used LiveCode/RunRev for some time but an new to using DataGrids.
  
   What I'd like to do (for Mac/Windows users) is include a DataGrid
   configured as, say, four columns of data followed by two columns that
 are
   the same in each row: one that reads Delete and one that reads
 Edit.
   I'd like to set it up so that if the user clicks on Delete or Edit
  in a
   given row that then triggers handlers to either delete that row or edit
  the
   data contained in the other four columns of that row of the grid.
  
   Using a standard text field with tab-delimited data in each row, I'd
 use
   the ClickText and the ClickLine in the field script to determine what
 the
   user clicked and trigger the appropriate actions. How would one achieve
   this in a DataGrid?
  
   Thanks in advance!
  
   Sieg Lindstrom
   ___
   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


 ___
 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: clickability in a DataGrid

2013-01-23 Thread Peter Haworth
No problem Sieg, glad we found a solution for you.
Pete
lcSQL Software http://www.lcsql.com


On Wed, Jan 23, 2013 at 10:29 AM, Sieg Lindstrom
s...@trackandfieldnews.comwrote:

 Thanks, Peter.

 This script works. Thank you and apologies for my earlier confusion.

 Sieg Lindstrom

 On Jan 22, 2013, at 7:21 PM, Peter Haworth wrote:

  Hi Craig,
  I tried your mouseUp Script and all I got was a reference to graphic
  dgalternatingrows no matter which row or column I click in.
 
  The EditFieldText trap would work but he'd have to double click the cell
  and I don't think that's what he had in mind.
 
  However, I think this seems to work as a scrip of the datagrid group
  (apologies if this ends up with asterisks all over it):
 
  *on* mouseUp pMouseBtnNum
 
   *if* pMouseBtnNum is 1 *then*
 
   *put* the dgColumn of the target,the dghilitedline of me
 
*end* *if*
 
  *end* mouseUp
  lcSQL Software http://www.lcsql.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: clickability in a DataGrid

2013-01-23 Thread Sieg Lindstrom
Hej Klaus,

Many thanks for the tip and the link to the datagrid manual as PDF. I used too 
much shorthand in describing my desire to edit the content of the row. I'm 
trying to duplicate an admin tool that runs in Javascript on a server. The 
Javascript is a black box to me; I'm just trying to duplicate the 
functionality, so I don't want the user to have to edit rows in the datagrid, 
but rather select a row to edit, and then the editing will take place on a 
different card set up to mimic fields and buttons in the old admin tool.

Now I'm on the right track. Thanks.

Sieg Lindstrom

On Jan 23, 2013, at 10:00 AM,  Klaus on-rev wrote:

 well, DataGrids are extremely complex but also extremely powerful once you 
 get to master them (more or less :-)
 
 OK, presumed you have a datagrid of type TABLE with a column named delete 
 and when the user clicks on that column
 you want to delete the complete row of the datagrid, right?
 
 Deleting -Put this into the datagrids script:
 
 on mouseup
 
  ## WHAT column has been clicked?
   put the dgColumn of the target into tClickedColumnName
 
  ## User clicked the column delete:
   if tClickedColumnName = delete then
 
   ## Better ask EVERYTIME! ;-)
  answer Really delete? with Cancel or OK
  if it = Cancel then
 exit to top
  end if
 
 ## get the currently selected row
  put the dghilitedLines of me into tHL
 
## Now let the DG do the deletion
  dispatch DeleteLines to me with tHL
   end if
 end mouseup
 
 EDITING is definitively implemented in the default datagrid, just check 
 editable in the inspector for the datagridand doubleclick 
 any column to edit iits content. Or did I misunderstand your question about 
 editing?
 
 Get the complete datagrid manual as PDF here:
 http://lessons.runrev.com/m/datagrid
 
 Work through the example to get the grips.
 I must confess that I need to re-read the docs everytime I did not work with 
 DGs for more than one week, just too complex stuff :-D
 
 Sieg Lindstrom
 
 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: clickability in a DataGrid

2013-01-23 Thread Robert Sneidar
What if the selection is not changing?

On Jan 22, 2013, at 8:19 PM, Peter Haworth wrote:

 Yep, in the group script. You could probably do it in a selectionChanged
 handler as well.
 Pete
 On Tuesday, January 22, 2013,  dunb...@aol.com wrote:
 Peter.
 
 
 Those are the row and column properties I meant. But I do not understand
 why you cannot get what I got with the mouseUp handler. It is the very
 first thing I ever did with a dataGrid, before I learned some of the other
 functionalities.
 
 
 With that handler,I get something like: field Col 1 0001
 
 
 which can be easily broken out as required. The handler is in the group
 script, right?
 
 
 Craig
 
 
 
 
 
 -Original Message-
 From: Peter Haworth p...@lcsql.com
 To: How to use LiveCode use-livecode@lists.runrev.com
 Sent: Tue, Jan 22, 2013 9:56 pm
 Subject: Re: clickability in a DataGrid
 
 
 Hi Craig,
 I tried your mouseUp Script and all I got was a reference to graphic
 dgalternatingrows no matter which row or column I click in.
 
 The EditFieldText trap would work but he'd have to double click the cell
 and I don't think that's what he had in mind.
 
 However, I think this seems to work as a scrip of the datagrid group
 (apologies if this ends up with asterisks all over it):
 
 *on* mouseUp pMouseBtnNum
 
  *if* pMouseBtnNum is 1 *then*
 
  *put* the dgColumn of the target,the dghilitedline of me
 
   *end* *if*
 
 *end* mouseUp
 lcSQL Software http://www.lcsql.com
 
 
 On Tue, Jan 22, 2013 at 5:55 PM, dunb...@aol.com wrote:
 
 Hi.
 
 
 There are a few ways to do this. The old fashioned way is to write in the
 group script:
 
 
 on mouseUp
  put the target
 end mouseUp
 
 
 You get a result that is easily deconstructed to row and column
 references.
 
 
 You can also trap the editFieldText message, or any of the row and
 column properties.
 
 
 Craig Newman
 
 
 
 -Original Message-
 From: Peter Haworth p...@lcsql.com
 To: How to use LiveCode use-livecode@lists.runrev.com
 Sent: Tue, Jan 22, 2013 7:44 pm
 Subject: Re: clickability in a DataGrid
 
 
 Hi Sieg,
 I can't think of a way to detect a click in a specific cell of a
 datagrid.
 
 If nobody else can come up with something, a couple of alternatives would
 be to customize your Edit and Delete columns to contain buttons and put
 your delete/edit commands in the mouseUp handler for each button, or
 implement a right click popup menu with delete/edit options on it and put
 the logic in the menuPick handler for the popup.
 
 Would take too much space to describe how to do those things, but check
 out
 the datagrid manual for details.
 
 Pete
 lcSQL Software http://www.lcsql.com
 
 
 On Tue, Jan 22, 2013 at 4:09 PM, Sieg Lindstrom s...@trackandfieldnews.com
 wrote:
 
 I've used LiveCode/RunRev for some time but an new to using DataGrids.
 
 What I'd like to do (for Mac/Windows users) is include a DataGrid
 configured as, say, four columns of data followed by two columns that
 are
 the same in each row: one that reads Delete and one that reads
 Edit.
 I'd like to set it up so that if the user clicks on Delete or Edit
 in a
 given row that then triggers handlers to either delete that row or edit
 the
 data contained in the other four columns of that row of the grid.
 
 Using a standard text field with tab-delimited data in each row, I'd
 use
 the ClickText and the ClickLine in the field script to determine what
 the
 user clicked and trigger the appropriate actions. How would one achieve
 this in a DataGrid?
 
 Thanks in advance!
 
 Sieg Lindstrom
 ___
 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
 
 
 -- 
 Pete
 lcSQL Software http://www.lcsql.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


clickability in a DataGrid

2013-01-22 Thread Sieg Lindstrom
I've used LiveCode/RunRev for some time but an new to using DataGrids.

What I'd like to do (for Mac/Windows users) is include a DataGrid configured 
as, say, four columns of data followed by two columns that are the same in each 
row: one that reads Delete and one that reads Edit. I'd like to set it up 
so that if the user clicks on Delete or Edit in a given row that then 
triggers handlers to either delete that row or edit the data contained in the 
other four columns of that row of the grid.

Using a standard text field with tab-delimited data in each row, I'd use the 
ClickText and the ClickLine in the field script to determine what the user 
clicked and trigger the appropriate actions. How would one achieve this in a 
DataGrid?

Thanks in advance!

Sieg Lindstrom
___
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: clickability in a DataGrid

2013-01-22 Thread Peter Haworth
Hi Sieg,
I can't think of a way to detect a click in a specific cell of a datagrid.

If nobody else can come up with something, a couple of alternatives would
be to customize your Edit and Delete columns to contain buttons and put
your delete/edit commands in the mouseUp handler for each button, or
implement a right click popup menu with delete/edit options on it and put
the logic in the menuPick handler for the popup.

Would take too much space to describe how to do those things, but check out
the datagrid manual for details.

Pete
lcSQL Software http://www.lcsql.com


On Tue, Jan 22, 2013 at 4:09 PM, Sieg Lindstrom 
s...@trackandfieldnews.comwrote:

 I've used LiveCode/RunRev for some time but an new to using DataGrids.

 What I'd like to do (for Mac/Windows users) is include a DataGrid
 configured as, say, four columns of data followed by two columns that are
 the same in each row: one that reads Delete and one that reads Edit.
 I'd like to set it up so that if the user clicks on Delete or Edit in a
 given row that then triggers handlers to either delete that row or edit the
 data contained in the other four columns of that row of the grid.

 Using a standard text field with tab-delimited data in each row, I'd use
 the ClickText and the ClickLine in the field script to determine what the
 user clicked and trigger the appropriate actions. How would one achieve
 this in a DataGrid?

 Thanks in advance!

 Sieg Lindstrom
 ___
 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: clickability in a DataGrid

2013-01-22 Thread dunbarx
Hi.


There are a few ways to do this. The old fashioned way is to write in the group 
script:


on mouseUp
  put the target
end mouseUp


You get a result that is easily deconstructed to row and column references.


You can also trap the editFieldText message, or any of the row and column 
properties.


Craig Newman



-Original Message-
From: Peter Haworth p...@lcsql.com
To: How to use LiveCode use-livecode@lists.runrev.com
Sent: Tue, Jan 22, 2013 7:44 pm
Subject: Re: clickability in a DataGrid


Hi Sieg,
I can't think of a way to detect a click in a specific cell of a datagrid.

If nobody else can come up with something, a couple of alternatives would
be to customize your Edit and Delete columns to contain buttons and put
your delete/edit commands in the mouseUp handler for each button, or
implement a right click popup menu with delete/edit options on it and put
the logic in the menuPick handler for the popup.

Would take too much space to describe how to do those things, but check out
the datagrid manual for details.

Pete
lcSQL Software http://www.lcsql.com


On Tue, Jan 22, 2013 at 4:09 PM, Sieg Lindstrom 
s...@trackandfieldnews.comwrote:

 I've used LiveCode/RunRev for some time but an new to using DataGrids.

 What I'd like to do (for Mac/Windows users) is include a DataGrid
 configured as, say, four columns of data followed by two columns that are
 the same in each row: one that reads Delete and one that reads Edit.
 I'd like to set it up so that if the user clicks on Delete or Edit in a
 given row that then triggers handlers to either delete that row or edit the
 data contained in the other four columns of that row of the grid.

 Using a standard text field with tab-delimited data in each row, I'd use
 the ClickText and the ClickLine in the field script to determine what the
 user clicked and trigger the appropriate actions. How would one achieve
 this in a DataGrid?

 Thanks in advance!

 Sieg Lindstrom
 ___
 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: clickability in a DataGrid

2013-01-22 Thread dunbarx
Peter.


Those are the row and column properties I meant. But I do not understand why 
you cannot get what I got with the mouseUp handler. It is the very first thing 
I ever did with a dataGrid, before I learned some of the other functionalities. 


With that handler,I get something like: field Col 1 0001


which can be easily broken out as required. The handler is in the group script, 
right?


Craig





-Original Message-
From: Peter Haworth p...@lcsql.com
To: How to use LiveCode use-livecode@lists.runrev.com
Sent: Tue, Jan 22, 2013 9:56 pm
Subject: Re: clickability in a DataGrid


Hi Craig,
I tried your mouseUp Script and all I got was a reference to graphic
dgalternatingrows no matter which row or column I click in.

The EditFieldText trap would work but he'd have to double click the cell
and I don't think that's what he had in mind.

However, I think this seems to work as a scrip of the datagrid group
(apologies if this ends up with asterisks all over it):

*on* mouseUp pMouseBtnNum

  *if* pMouseBtnNum is 1 *then*

  *put* the dgColumn of the target,the dghilitedline of me

   *end* *if*

*end* mouseUp
lcSQL Software http://www.lcsql.com


On Tue, Jan 22, 2013 at 5:55 PM, dunb...@aol.com wrote:

 Hi.


 There are a few ways to do this. The old fashioned way is to write in the
 group script:


 on mouseUp
   put the target
 end mouseUp


 You get a result that is easily deconstructed to row and column references.


 You can also trap the editFieldText message, or any of the row and
 column properties.


 Craig Newman



 -Original Message-
 From: Peter Haworth p...@lcsql.com
 To: How to use LiveCode use-livecode@lists.runrev.com
 Sent: Tue, Jan 22, 2013 7:44 pm
 Subject: Re: clickability in a DataGrid


 Hi Sieg,
 I can't think of a way to detect a click in a specific cell of a datagrid.

 If nobody else can come up with something, a couple of alternatives would
 be to customize your Edit and Delete columns to contain buttons and put
 your delete/edit commands in the mouseUp handler for each button, or
 implement a right click popup menu with delete/edit options on it and put
 the logic in the menuPick handler for the popup.

 Would take too much space to describe how to do those things, but check out
 the datagrid manual for details.

 Pete
 lcSQL Software http://www.lcsql.com


 On Tue, Jan 22, 2013 at 4:09 PM, Sieg Lindstrom s...@trackandfieldnews.com
 wrote:

  I've used LiveCode/RunRev for some time but an new to using DataGrids.
 
  What I'd like to do (for Mac/Windows users) is include a DataGrid
  configured as, say, four columns of data followed by two columns that are
  the same in each row: one that reads Delete and one that reads Edit.
  I'd like to set it up so that if the user clicks on Delete or Edit
 in a
  given row that then triggers handlers to either delete that row or edit
 the
  data contained in the other four columns of that row of the grid.
 
  Using a standard text field with tab-delimited data in each row, I'd use
  the ClickText and the ClickLine in the field script to determine what the
  user clicked and trigger the appropriate actions. How would one achieve
  this in a DataGrid?
 
  Thanks in advance!
 
  Sieg Lindstrom
  ___
  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

 
___
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: clickability in a DataGrid

2013-01-22 Thread Peter Haworth
Yep, in the group script. You could probably do it in a selectionChanged
handler as well.
Pete
On Tuesday, January 22, 2013,  dunb...@aol.com wrote:
 Peter.


 Those are the row and column properties I meant. But I do not understand
why you cannot get what I got with the mouseUp handler. It is the very
first thing I ever did with a dataGrid, before I learned some of the other
functionalities.


 With that handler,I get something like: field Col 1 0001


 which can be easily broken out as required. The handler is in the group
script, right?


 Craig





 -Original Message-
 From: Peter Haworth p...@lcsql.com
 To: How to use LiveCode use-livecode@lists.runrev.com
 Sent: Tue, Jan 22, 2013 9:56 pm
 Subject: Re: clickability in a DataGrid


 Hi Craig,
 I tried your mouseUp Script and all I got was a reference to graphic
 dgalternatingrows no matter which row or column I click in.

 The EditFieldText trap would work but he'd have to double click the cell
 and I don't think that's what he had in mind.

 However, I think this seems to work as a scrip of the datagrid group
 (apologies if this ends up with asterisks all over it):

 *on* mouseUp pMouseBtnNum

   *if* pMouseBtnNum is 1 *then*

   *put* the dgColumn of the target,the dghilitedline of me

*end* *if*

 *end* mouseUp
 lcSQL Software http://www.lcsql.com


 On Tue, Jan 22, 2013 at 5:55 PM, dunb...@aol.com wrote:

 Hi.


 There are a few ways to do this. The old fashioned way is to write in the
 group script:


 on mouseUp
   put the target
 end mouseUp


 You get a result that is easily deconstructed to row and column
references.


 You can also trap the editFieldText message, or any of the row and
 column properties.


 Craig Newman



 -Original Message-
 From: Peter Haworth p...@lcsql.com
 To: How to use LiveCode use-livecode@lists.runrev.com
 Sent: Tue, Jan 22, 2013 7:44 pm
 Subject: Re: clickability in a DataGrid


 Hi Sieg,
 I can't think of a way to detect a click in a specific cell of a
datagrid.

 If nobody else can come up with something, a couple of alternatives would
 be to customize your Edit and Delete columns to contain buttons and put
 your delete/edit commands in the mouseUp handler for each button, or
 implement a right click popup menu with delete/edit options on it and put
 the logic in the menuPick handler for the popup.

 Would take too much space to describe how to do those things, but check
out
 the datagrid manual for details.

 Pete
 lcSQL Software http://www.lcsql.com


 On Tue, Jan 22, 2013 at 4:09 PM, Sieg Lindstrom s...@trackandfieldnews.com
 wrote:

  I've used LiveCode/RunRev for some time but an new to using DataGrids.
 
  What I'd like to do (for Mac/Windows users) is include a DataGrid
  configured as, say, four columns of data followed by two columns that
are
  the same in each row: one that reads Delete and one that reads
Edit.
  I'd like to set it up so that if the user clicks on Delete or Edit
 in a
  given row that then triggers handlers to either delete that row or edit
 the
  data contained in the other four columns of that row of the grid.
 
  Using a standard text field with tab-delimited data in each row, I'd
use
  the ClickText and the ClickLine in the field script to determine what
the
  user clicked and trigger the appropriate actions. How would one achieve
  this in a DataGrid?
 
  Thanks in advance!
 
  Sieg Lindstrom
  ___
  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


-- 
Pete
lcSQL Software http://www.lcsql.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