Datagrid AUTOTAB property

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
chris9610
Posts: 79
Joined: Fri Mar 20, 2009 4:38 pm

Datagrid AUTOTAB property

Post by chris9610 » Mon Sep 28, 2009 4:55 am

In the documentation for the data grid it states you can set the autotab property for pField to true.

Does anyone know how to do this?

TIA
Developing with Windows XP & Revolution 4.5

chris9610
Posts: 79
Joined: Fri Mar 20, 2009 4:38 pm

Post by chris9610 » Tue Sep 29, 2009 8:07 pm

Well I know how to set the autoTab of a field but how can I set the autoTab of all fields in a dataGrid group?

While editing a cell I would like to TAB key to the next cell. Or shift TAB to the Previous Cell.

Reading the documents it states the autoTab must be true to do this.

So far I have not figured how to set the autoTab of all the fields in the dataGrid. Does anyone have a clue?
Developing with Windows XP & Revolution 4.5

trevordevore
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1005
Joined: Sat Apr 08, 2006 3:06 pm
Contact:

Post by trevordevore » Tue Sep 29, 2009 8:08 pm

Can you point to the place in the documentation that you are referring to?
Trevor DeVore
ScreenSteps - https://www.screensteps.com

LiveCode Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder

trevordevore
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1005
Joined: Sat Apr 08, 2006 3:06 pm
Contact:

Post by trevordevore » Tue Sep 29, 2009 8:09 pm

Just saw your second post. A Data Grid table should tab back and forth between fields by default. A Data Grid form does not however. You would have to program that logic yourself. Are you working with a form or table?
Trevor DeVore
ScreenSteps - https://www.screensteps.com

LiveCode Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder

chris9610
Posts: 79
Joined: Fri Mar 20, 2009 4:38 pm

Post by chris9610 » Tue Sep 29, 2009 9:07 pm

I am only working with tables to date.

In this scenarios CloseFieldEditor pFieldEditor and ExitFieldEditor pFieldEditor are still sent. The difference is that after CloseFieldEditor is sent to pField the contents of pFieldEditor are saved in the dgData. If for any reason you do not want the data to be saved then you can return "cancel" from CloseFieldEditor.

Note: If the user presses the tab key while editing and the autotab property of pField is true then the message OpenNextFieldEditor pDirection is sent to pField. If you don't handle this message and the data grid is a table then the data grid automatically opens the next cell for editing. For data grid forms you can handle this message in order to open another field for editing. You could call EditKeyOfIndex for example.

Note 2: The default behavior for pFieldEditor is located in button "Field Editor" of stack "revDataGridLibrary". If you want to override this behavior then you can assign the behavior of pFieldEditor to another button in the preOpenFieldEditor message.
This is from the BlueMango documentation anid it is also on page 171 of the Revolution Data Grid Documentation.
Developing with Windows XP & Revolution 4.5

chris9610
Posts: 79
Joined: Fri Mar 20, 2009 4:38 pm

Post by chris9610 » Tue Sep 29, 2009 9:10 pm

BTW by default normally a field autotab property is false as stated in the Revolution Dictionary.
Developing with Windows XP & Revolution 4.5

chris9610
Posts: 79
Joined: Fri Mar 20, 2009 4:38 pm

Post by chris9610 » Tue Sep 29, 2009 9:27 pm

Trevor:

OK I checked the autotab of the fields in a newly created datagrid and the value is true. So the autotab is not the issue.

So when I tried to edit a cell and tab to edit the next cell, the open cell closes but the next cell does not go into the edit mode.

So I am missing something in the setup.
Developing with Windows XP & Revolution 4.5

trevordevore
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1005
Joined: Sat Apr 08, 2006 3:06 pm
Contact:

Post by trevordevore » Wed Sep 30, 2009 2:43 pm

I just did the following test and tabbing between cells in a row worked fine. Can you see if this test works and then we can look at how your Data Grid is different.

1) Create stack
2) Drag Data Grid onto stack
3) Use the Contents tab of the property inspector to set the content of the Data Grid to:

Test[tab]This
Test[tab]That

where [tab] specifies that you use the tab key.

4) Activate Browse tool and double-click on Test in column 1 row 1. Field editor should open up.
5) Press tab key. Field editor swiches to This in column 2 row 1.

Does that test work for you?
Trevor DeVore
ScreenSteps - https://www.screensteps.com

LiveCode Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder

chris9610
Posts: 79
Joined: Fri Mar 20, 2009 4:38 pm

Post by chris9610 » Wed Sep 30, 2009 11:12 pm

Sorry Trevor:

Not working here.

This is the exact procedure I used to test the datagrid. The link below is a copy of the test stack.

http://dl.getdropbox.com/u/653964/test%20datagrid.rev
Developing with Windows XP & Revolution 4.5

trevordevore
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1005
Joined: Sat Apr 08, 2006 3:06 pm
Contact:

Post by trevordevore » Wed Sep 30, 2009 11:16 pm

Your test stack works on my end (Windows XP Rev 3.5 gm-2). What do you see in the message box if you execute the following:

Code: Select all

put the uRIP["version"] of stack revdatagridlibrary && "build" && the uRIP["buildnumber"] of stack revdatagridlibrary
Trevor DeVore
ScreenSteps - https://www.screensteps.com

LiveCode Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder

chris9610
Posts: 79
Joined: Fri Mar 20, 2009 4:38 pm

Post by chris9610 » Wed Sep 30, 2009 11:28 pm

1.0.0 build 2
Developing with Windows XP & Revolution 4.5

trevordevore
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1005
Joined: Sat Apr 08, 2006 3:06 pm
Contact:

Post by trevordevore » Wed Sep 30, 2009 11:37 pm

You need to update to 3.5 gm-2. You are running 3.5 gm-1. After updating test again and see if it works.
Trevor DeVore
ScreenSteps - https://www.screensteps.com

LiveCode Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder

chris9610
Posts: 79
Joined: Fri Mar 20, 2009 4:38 pm

Post by chris9610 » Thu Oct 01, 2009 12:54 am

Thanks Trevor:

That did the trick.

Tab key moves the edit cell to the next cell.
Developing with Windows XP & Revolution 4.5

Post Reply