By default, XBrowse mostly behaves like Excel when columns are Editable and FastEdit is enabled.
Pressing any key enters edit mode with that key as the first key and if edit is exited with up or down arrow the cursor moves to the cell above or below the current cell like Excel.
If only some columns are editable, the behavior is identical to Excel where some cells are protected. Cursor jumps to the next editable cell in both cases. Editable cell is the cell where oCol:nEditType > 0 and oCol:bEvalWhen is nil or evaluates to .t..
One difference betwen Excel and Xbrowse is that in Excel, pressing Enter key does not invoke edit but moves the cursor to the next column, whereas in XBrowse, by default, Enter key enters edit. F2 key invokes edit in Excel, where as this key is ignored in XBrowse.
Even in this case, XBrowse can be set to mimic fully Excel behavior by setting
- Code: Select all Expand view
oBrw:lEnterKey2Edit := .f. // ( default .t. )
oBrw:lF2KeyToEdit := .t. // ( default .f. )
With these settings, XBrowse behaves fully like Excel.
There is another feature in Excel. We can enter "=400*20" to get 8000. By default this is not possible with XBrowse.
But by setting
- Code: Select all Expand view
oBrw:lFormulaEdit := .t. // (default .f. )
we can enter formulae in XBrowse cells too, like we do in Excel. One difference between Excel and XBrowse is that Excel remembers the fomula forever but XBrowse evaluates the expression and stores the result, discarding the formula. Still this feature is very useful to the users who can enter simple calculations directly into the cells, instead of using calculator before entering into the cells.
For automatically creating new rows, oBrw:bPastEof may be assigned with appropriate codeblock to instruct xbrowse what to do when the user is navigating past the eof. There are some samples in the samples folder explaining the usage.
XBrowse is feature rich, but many of the features are not available to those who still use the very old way of programming like using oCol:bStrData.... ,etc.