Spreadsheet
v 0.3
This is to provide spreadsheet-style code editing, for highly tedious
editing, like
renumbering numerous equates, creating
large Select Case structures, and so on.
It will also be used in list operations for "flex-editing" which is the
reason for the
extra features for selection, column grouping and special
editing modes. It will
hopefully support fancy formatting too, eventually.
It seems this could become fairly useful as a general
purpose spreadsheet too. As
a spreadsheet it is intended more as a utility, but it might eventually
be full-featured.
Last updated: October 17,
2005
Some current features:
- 65536 rows and up to 700 columns (it's set at the
standard 256 for now)
- Compiles to about 90KB
- Most, if not all standard spreadsheet keyboard navigation
- Selection expansion to contiguous used cells by Ctrl + *
- Selection expansion by Ctrl+Shift+ Arrow keys
- Selection of rows or columns by clicking
- Selections are additive and toggle when pressing Ctrl
- Open file by toolbar or drag-and-drop (tab-delimited
format only)
- Cut, copy and paste
- Rows and columns resizeable with the mouse, Alt+Arrow keys
or Alt+Shift+Arrow keys
- Math evaluation (no cell references supported yet)
- Auto recalculation of sheet
- Formulas are checked when they're entered
- Drag-fill is partly done (just the mouse-ability)
- Scrolling, including mouse wheel
- Panning with middle button (jerky)
Some current (temporary)
limitations:
No file save
No insert/delete rows and columns
Single sheet
No undo/redo
No sorting
No fancy formatting
Some of the Planned Design Details and Features:
Auto, or manual sorting
Selections may be partly or completely discontinuous. The current
selection
at any stage should also be preservable to prevent accidental loss of
complex
selections. An additional safeguard will be the undo and redo for
selection
changes.
Switch to edit mode with Ctrl+Enter or Shift+Enter
To quickly change the direction of cell cursor movement when Enter is
pressed: press ??? then an arrow key (undecided).
Data in several columns can be "grouped", so that they can be operated
on
all together. The grouped columns need not be adjacent. This
is
to simplify
operations such as selecting, dragging and sorting.
Selection Behaviour
- It will be similar to that of the listview control, and
have some
enhancements.
- No selection is made at the current cursor position until
the user
makes it (in contrast of the listview)
- Pressing SHIFT sets the selection anchor
- Holding SHIFT and pressing the arrow or page keys adjusts
the
selection
- from the current anchor position to the new cursor position
- Holding the Ctrl key without the SHIFT key allows the
anchor to be moved
by the arrow and page keys while preserving the current
selection
- In contrast to the listview control, dragging selects
multiple items
- Selections can be made in either additive or toggle mode.
In toggle
mode,
overlapping portions of two or more selections will be deselected.
Toggle
mode is activated by ???
- Existing selections can be preserved while making
additional ones
by...???
- Pressing ESC clears all selections
- Undo a selection action by pressing Ctrl+Shift+Z...???
- Redo a selection action by pressing Ctrl+Shift+Y...???
Editing Operations
These operations are done by clicking, shortcuts or using the menu on
a selection.
- Delete contents
- Delete row
- Merge cell contents with a space
- Merge cell contents without a space
- Split cell contents
- Sort ascending or descending
- Join selected items
- Send selected items to the end of the list
- Send selected items to the top of the list
- Group cells by column
Spreadsheet Internals
This covers a few of the more difficult aspects of the
spreadsheet code (the design
has been changed from that originally described here).
Keeping Track of Used
Cells
A one-dimensional string array is used for the cells' contents, and a
UDT
array to hold each one's row and column positions.
Type CELLCOORD Dword
col As Word
row As Word
End Type
Selection State Storage
This is stored in the form of descriptions of selection actions. This
allows
it to function as an undo/redo buffer for selections, in addition to
being a
compact form of storage. A multiple selection uses two elements of the
array.
Type SELECTIONEVENT Byte
typ As Byte
col As Word
row As Word
End Type
The type can be any compatible combination of the following:
- Additive
- Toggle
- None
- Single
- Block
- Done
Format State Storage
This will be done the same way as for the selection states.
Applying Selection State
and Format
Information to the
Current Display
A two-dimensional byte array is used to hold the selection states and
formatting of all cells which are currently visible. It is refilled
each time the
grid is displayed from the data in the selection-event and format-event
arrays.
As the grid is drawn, the cell-coordinate (CELLCOORD) array
is searched
for each visible cell's column and row positions, determine whether
it's used
or not, and its contents are displayed if so.
The source code is
in the "grid" folder of the CVS directory.
Browse
CVS
Website Home
Project Summary Page at SourceForge.net
This project is sponsored by TheirCorp
(formerly TheirWare Corporation)