That's a pretty broad generalization. Mac people who do a lot of data entry don't like reaching for the mouse either. Those folks may be more likely to set their system prefs to allow tabbing through all controls. I myself use the keyboard almost exclusively when navigating the file system and file dialogs, and when using menus and managing windows.
I thought spacebar to toggle a checkbox was only a Microsoft thing, I believe all the Office ports support that on Macs, but didn't think it was universal. Since I don't have my Mac set to tab through buttons though I guess I've never had a chance to test it.
Data Entry with a DataGrid
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Re: Data Entry with a DataGrid
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
Re: Data Entry with a DataGrid
Hi thims:
1. The problem seems to be with the "rollover" handler and the use of "strLine" variable to capture the displayed line of interest. The weird behavior is not even consistent. Not only the "f" line's checkbox is checked when you hit the spacebar on the "g" line, but if you double-click back to the first column of the "g" line and tab back to the second column and press the space bar, now the "e" line's checkbox is checked, and so on. That is, the count seems to go back. I couldn't figure out how or why.
2. The problem is solved, though, by the use of the (much simpler) ColumnControlOfIndex function to nail down the line you want. This way, you don't need the "rollover" function or "strLine" variable. Just the following code instead:
{Note: In the attached file, I have made a typo in the script; used "focus of btn 1" instead of "focus on btn 1"; but LiveCode doesn't seem to mind. Very forgiving!}
Regards,
Sri
1. The problem seems to be with the "rollover" handler and the use of "strLine" variable to capture the displayed line of interest. The weird behavior is not even consistent. Not only the "f" line's checkbox is checked when you hit the spacebar on the "g" line, but if you double-click back to the first column of the "g" line and tab back to the second column and press the space bar, now the "e" line's checkbox is checked, and so on. That is, the count seems to go back. I couldn't figure out how or why.
2. The problem is solved, though, by the use of the (much simpler) ColumnControlOfIndex function to nail down the line you want. This way, you don't need the "rollover" function or "strLine" variable. Just the following code instead:
Code: Select all
dispatch function "ColumnControlOfIndex" to group "Datagrid 1" of stack "WithCheckbox" with "Col 2", tIndex
put the result into tR
send "focus on btn 1 of me" to tR
Regards,
Sri
- Attachments
-
- WithCheckbox(Sri).livecode.zip
- (6.52 KiB) Downloaded 238 times
Re: Data Entry with a DataGrid {Solved}
sritcp:
Thank you so much. That solved my problem perfectly. I just knew it was something I was doing wrong. DataGrids are a godsend, but yes, as everybody knows, very complex and obtuse beasts. I'm sure I will be using ColumnControlOfIndex a lot in the future. I have much to learn still. Adjusting from a lifetime of procedural programming takes time.
Thanks also to all who replied and helped.
Things I learned:
1: When you need to address a particular column of a DataGrid use ColumnControlOfIndex not it's name and if your fudging the row number into it's name your almost certain to be making a mistake.
2: Macs behave differently than PCs in subtle but distinct ways. And jacque: I will not expect or force all platforms to look and behave identically, I will allow each to do what comes naturally to it and it's users.
3: The LiveCode community is fantastic and makes a world of difference.
4: I love LiveCode more today than I did yesterday, if that's even possible.
thims
Thank you so much. That solved my problem perfectly. I just knew it was something I was doing wrong. DataGrids are a godsend, but yes, as everybody knows, very complex and obtuse beasts. I'm sure I will be using ColumnControlOfIndex a lot in the future. I have much to learn still. Adjusting from a lifetime of procedural programming takes time.
Thanks also to all who replied and helped.
Things I learned:
1: When you need to address a particular column of a DataGrid use ColumnControlOfIndex not it's name and if your fudging the row number into it's name your almost certain to be making a mistake.
2: Macs behave differently than PCs in subtle but distinct ways. And jacque: I will not expect or force all platforms to look and behave identically, I will allow each to do what comes naturally to it and it's users.
3: The LiveCode community is fantastic and makes a world of difference.
4: I love LiveCode more today than I did yesterday, if that's even possible.
thims