I've got a blog up for reordering DataGrid forms by drag and drop. Doesn't work for tables and you must cache controls.
http://goulding.ws/consulting/blog/
Cheers
--
Monte Goulding
M E R Goulding Software Development
Bespoke application development for vertical markets
InstallGadget - How to create an installer in 10 seconds
revObjective - Making behavior scripts behave
_______________________________________________
use-revolution mailing list
use-rev...@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Talking to myself here but the blog post has been updated with a drag and drop script using the inbuilt support that seems to be undocumented. Scroll to the bottom but I'm leaving my original script as it still might be worthwhile for people that want to give their drag and drop a customised look.
Hi Monte,
You are correct and Trevor could confirm that: for now there is no
documentation about the drag & drop features of a datagrid.
Concerning Drag & drop, Trevor has shared different links.
1) An example with a mp3 library:
http://tr.im/data_grid
This example shows how reorder lines in a DG or copy lines from a DG
table to a DG form
2) A sample stack
http://www.bluemangolearning.com/download/revolution/tools/dragdroptest.zip
The code used in the DG group is similar to the script you shared in
your blog excepted the dragMove handler is missing.
I shared also a small lab stack one or two weeks ago, to demonstrate
how drag & drop lines from a DG table to another DG table.
http://www.aslugontheroad.co.cc/index.php?option=com_phocadownload&view=category&download=11:experiment-15-drag-drop-in-dg&id=7:data-grid&Itemid=63
You have found your way with that so I posted this in case it could be
useful for someone in the list.
Anyway the Trevor's mp3 library still interesting to study.
Regards,
--
-Zryip TheSlug- wish you the best! 8)
http://www.aslugontheroad.co.cc
Ah, this stack would have been handy. It doesn't work unless you set the dragAction in dragMove though.
Cheers
--
Monte Goulding
M E R Goulding Software Development
Bespoke application development for vertical markets
InstallGadget - How to create an installer in 10 seconds
revObjective - Making behavior scripts behave
_______________________________________________
Monte,
Right. It seems necessary to set the dragAction in the dragMove
handler since LiveCode 4.5.
When I'm running the same stack with Revolution 4.5 dp2 all works like
a charm without the dragMove handler.
Regards,
--
-Zryip TheSlug- wish you the best! 8)
http://www.aslugontheroad.co.cc
Just to clarify, this is a change in the datagrid library itself not
in the LiveCode engine.
I have tried this by using the revdatagridlibrary stack from the
LiveCode 4.5 into my version of Revolution 4.5 dp2 and now I have to
set the dragAction to make the reorder perform.
> Just to clarify, this is a change in the datagrid library itself not
> in the LiveCode engine.
> I have tried this by using the revdatagridlibrary stack from the
> LiveCode 4.5 into my version of Revolution 4.5 dp2 and now I have to
> set the dragAction to make the reorder perform.
In the dgDragMove handler update the code that sets the dragAction to this:
## Make sure data grid control will accept drop
if the dragSource contains the long ID of me and (the mouseControl is not
empty and the long id of the mouseControl contains the long ID of me) then
set the dragAction to "move"
end if
--
Trevor DeVore
Blue Mango Learning Systems
ScreenSteps: http://www.screensteps.com
Releasable Revolution Resources for Developers:
http://revolution.bluemangolearning.com
Pete Haworth
On Oct 4, 2010, at 10:00 AM, use-revolut...@lists.runrev.com
wrote:
> Message: 3
> Date: Mon, 4 Oct 2010 09:40:47 -0400
> From: Trevor DeVore <li...@mangomultimedia.com>
> Subject: Re: Drag & drop reordering of a DataGrid form
> To: How to use Revolution <use-rev...@lists.runrev.com>
> Message-ID:
> <AANLkTikNK=kzhhcL5BbtpDECy1dpaeXe37tWw=r7q...@mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
I have had two clients report serious performance problems with a
LiveCode standalone application on Windows 7, 32-bit machines. Dialogs
and windows take several minutes to open, when usually they take only
seconds. The same standalone (with the same data) works fine on other
machines. I have never encountered this issue before, and since these
two cases where both on Windows 7 I wonder if the problem is related to
Windows 7.
Has anybody else experiences this issue or have any ideas about what
could be the cause?
Thanks very much!
David Beck
Rotunda Software
Pete Haworth
On Oct 4, 2010, at 10:00 AM, use-revolut...@lists.runrev.com
wrote:
> Message: 4
> Date: Mon, 4 Oct 2010 09:42:59 -0400
> From: Trevor DeVore <li...@mangomultimedia.com>
> Subject: Re: Datagrid option menu initialisation
> To: How to use Revolution <use-rev...@lists.runrev.com>
> Message-ID:
> <AANLkTimOb-tiVAyBNETa-...@mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
>
> On Sat, Oct 2, 2010 at 12:22 PM, Peter Haworth
> <pe...@mollysrevenge.com>wrote:
>
>> I have defined an option menu in a datagrid column whose contents are
>> created by reading data from an SQLite database - the contents will
>> be the
>> same for each instance of the option menu and should be loaded when
>> the card
>> containing the datagrid is opened. Where should I put the code to
>> create
>> the option menu contents?
>>
>
> In the card that contains the data grid :-)
>
> In the preopencard or openCard message query the database, update
> the menu
> button text in the data grid template and then load the data grid.
> Since the
> template has the updated menu text all instances of your column will
> contain
> the updated menu text.
>
> --
> Trevor DeVore
> Blue Mango Learning Systems
> ScreenSteps: http://www.screensteps.com
> Releasable Revolution Resources for Developers:
> http://revolution.bluemangolearning.com
_______________________________________________
Monday, October 4, 2010, 10:18:03 AM, you wrote:
> Has anybody else experiences this issue or have any ideas about what
> could be the cause?
Try upgrading the Win7 video drivers (!)
--
-Mark Wieder
mwi...@ahsoftware.net
I don't know the cause, but I also have a client who reports that on
Win7 "nothing happens" when he clicks either of two buttons that call
"ask file" or "answer file" dialogs. Given what you said, I wonder if
"nothing happens" really means "nothing happens for a long time until I
get bored and quit."
--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
On the Datagrid Templates card, I see a button named "OptionColumn
Behavior". I deleted all the lines from the script for that button
then hit Apply. Then I opened the card containing my datagrid but
still my default column script is only executed for columns that have
not been customised.
Any ideas?
Pete Haworth
On Oct 4, 2010, at 10:00 AM, use-revolut...@lists.runrev.com
wrote:
> Message: 5
> Date: Mon, 4 Oct 2010 09:45:02 -0400
> From: Trevor DeVore <li...@mangomultimedia.com>
> Subject: Re: Datagrid Default Column Behavior
> To: How to use Revolution <use-rev...@lists.runrev.com>
> Message-ID:
> <AANLkTimF1Et1p5Pfc_G-V...@mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
>
> On Sun, Oct 3, 2010 at 9:06 PM, Peter Haworth
> <pe...@mollysrevenge.com>wrote:
>
>> What is the correct way to set the default column behavior of a
>> datagrid so
>> that the script is entered for columns which have been customised
>> to contain
>> option menus?
>>
>> I have set the default column behavior property for the datagrid
>> but suing
>> debug shows that the script is only executed for columns that hve
>> not been
>> customised in some way.
>>
>
> When you create a custom column the behavior script of the column
> template
> is assigned to the behavior that is created alongside the column
> template.
> The default column behavior only applies to column templates that do
> not
> have a behavior assigned. Just set the behavior of your new column
> template
> to empty and then it will inherit the default behavior.
>
> --
> Trevor DeVore
> Blue Mango Learning Systems
> ScreenSteps: http://www.screensteps.com
> Releasable Revolution Resources for Developers:
> http://revolution.bluemangolearning.com
>
_______________________________________________
Wow, who woulda thought? Video driver issues cause file dialog problems?
I believe you, but I can't imagine why that would be. Any idea?
--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
Thanks Trevor, that did the job.
--
Monte Goulding
M E R Goulding Software Development
Bespoke application development for vertical markets
InstallGadget - How to create an installer in 10 seconds
revObjective - Making behavior scripts behave
_______________________________________________
Monday, October 4, 2010, 2:27:08 PM, you wrote:
> Wow, who woulda thought? Video driver issues cause file dialog problems?
> I believe you, but I can't imagine why that would be. Any idea?
Absolutely none. Just passing on what I've been told.
--
-Mark Wieder
mwi...@ahsoftware.net
I wrote it down in my Weird Tales and Strange Associations diary. Thanks
though. I've passed the info to my client. He didn't even blink.
--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
> I have a datagrid table with two option menu columns in it. It's OK to
> initialise the first one per your reply but the contents of the second one
> need to be set differently depending on the currently selected value in the
> first option menu. Any recommendations as to how to do that?
>
You will need to populate the menu in the FillInData message in this case.
Just fetch the value of the column that dictates the values and then
populate.
> I guess I'm not understanding this correctly. Here's what I did, assuming
> the column with the option menu in it is named "OptionColumn"
>
> On the Datagrid Templates card, I see a button named "OptionColumn
> Behavior". I deleted all the lines from the script for that button then hit
> Apply. Then I opened the card containing my datagrid but still my default
> column script is only executed for columns that have not been customised.
>
Deleting the script doesn't change the fact that the button is assigned as
the behavior for the "OptionColumn" column. You need to set the behavior
property of the "OptionColumn" group on you template card to empty.
Otherwise you have a column template with no script at all (because you
deleted the script in OptionColumn Behavior).
> Maybe I'm misunderstanding something but I don't see any code for handling
> drag/drop in the default datagrid behavior script I got when I installed
> LiveCode 4.5
The code is in the data grid behavior script: edit script of btn "Data Grid"
of stack "revDataGridLibrary"
Our good friend the Slug posted some links to some example stacks I've made
showing how to use it. The code snippet I posted for Monte and Monsieur Le
Slug was to fix an issue with setting the dragAction. The code snippet goes
in the "Data Grid" button script.
> Maybe I'm misunderstanding something but I don't see any code for handling
> drag/drop in the default datagrid behavior script I got when I installed
> LiveCode 4.5
The code is in the data grid behavior script: edit script of btn "Data Grid"
of stack "revDataGridLibrary"
Our good friend the Slug posted some links to some example stacks I've made
showing how to use it. The code snippet I posted for Monte and Monsieur Le
Slug was to fix an issue with setting the dragAction. The code snippet goes
in the "Data Grid" button script.
--
Thanks Trevor 8-)
Regards,
--
-Zryip TheSlug- wish you the best! 8)
http://www.aslugontheroad.co.cc