1. 22 Aug, 1998 1 commit
    • Miguel de Icaza's avatar
      Today: · ac57f8df
      Miguel de Icaza authored
      
      
      Today:
      
      	- Row insertion works.
      
      	- Dialog box for adding various things (equivalent to
      	  excel's Insert/Cells dialog box, any similarities
      	  with Excel are accidental).
      
      	- Plus the usual exciting features you would expect.
      
      Miguel
      
      1998-08-21  Miguel de Icaza  <miguel@nuclecu.unam.mx>
      
      	* src/dialog-insert-cells.c: New file.  Handle the insert cells
      	dialog box.  This uses GtkCauldron for the first time.  That
      	routine is soooo cool!
      
      	* src/sheet.c (sheet_cell_remove): Remove the memory used by the
      	key in the hashtable as well.
      	(sheet_insert_col): new routine used to insert columns in the
      	spreadsheet, it is pretty elaborate.
      	(sheet_col_destroy, sheet_row_destroy): New routine used by the
      	column-overflow logic in the insertion routines.
      	(sheet_cell_add): Only attach a style to a cell if it does not
      	have any yet.
      	(sheet_move_row): New routine: shifts a row a number of columns.
      	(sheet_verify_selection_simple): New routine for warnging about
      	the multiple-selections case.  In the future it should provide a
      	help context.
      	(sheet_insert_row): Implement this new routine.
      
      	* src/clipboard.c (paste_cell): Simplify.
      
      	* src/cell.c (cell_make_value, cell_formula_relocate): New routines
      	based on the code that was done for the clipboard.  Now they are
      	used in other places as well.  cell_make_value actually fixes a
      	potential bug that caused formulas to reappear magically on
      	paste-values commands (never hit the bug, but it was there, I
      	swear to god).
      ac57f8df
  2. 21 Aug, 1998 2 commits
    • Arturo Espinosa's avatar
      Last night hacking got us: · 04ea538e
      Arturo Espinosa authored
      
      
      Last night hacking got us:
      
      	- Column insertion.
      	- COlumn shifting (insert and delete).
      
      Next step: row insertion.
      
      Miguel.
      04ea538e
    • Arturo Espinosa's avatar
      Format fixes · 4ee2ee43
      Arturo Espinosa authored
      
      
      Format fixes
      
      Paste works just like Excel now.  Dragging a selection
      moves the cursor and the selection properly.
      
      Move the paste-special dialog box to its own file.
      
      Other misc fixes.
      
      Miguel.
      4ee2ee43
  3. 20 Aug, 1998 2 commits
    • Chris Lahey's avatar
      Multi-field format type. · 4fc1f950
      Chris Lahey authored
      4fc1f950
    • Miguel de Icaza's avatar
      New value format framework installed. · e32cdefe
      Miguel de Icaza authored
      
      
      New value format framework installed.
      
      The idea is that we will precompile formats to avoid parsing the
      format everytime a cell is repainted.
      
      Miguel.
      
      1998-08-19  Miguel de Icaza  <miguel@nuclecu.unam.mx>
      
      	* src/format.c (format_value): The new entry point for formating
      	values.  This takes a Value instead of a float.
      	NULL is never returned from format_value now: if there is a format
      	error, then value_string is used to display it.
      
      	(format_compile): This routine should always return, it cant fail,
      	in the worst * case it should just downgrade to simplistic formatting.
      
      	(format_destroy): This routine is invoked when the last user of
      	the format is gone (ie, refcount has reached zero) just before the
      	StyleFormat structure is actually released.  resources allocated
      	in format_compile should be disposed here
      e32cdefe
  4. 19 Aug, 1998 3 commits
    • Miguel de Icaza's avatar
      Basically: · af81b693
      Miguel de Icaza authored
      
      
      Basically:
      
      	- auto-alignment on cells without style works.
      
      	- Clean ups (use the new cell_ routines).
      
      	- Couple of bug fixes.
      
      	- Figured that aligment code works better if you
      	  actually call the routine on the cell.
      
      Miguel
      
      1998-08-19  Miguel de Icaza  <miguel@nuclecu.unam.mx>
      
      	* src/sheet.c (sheet_cursor_set): New function.  Use this instead
      	of the view-specific routine (gnumeric_cursor_set).
      
      	* src/gnumeric-sheet.c (gnumeric_sheet_can_move_cursor): ':' is a
      	valid separator for activating the cursor-cell selection mode.
      
      	* src/cell.c (cell_auto_align): New function.  This tries to
      	auto-align the cell contents depending on the value type.
      
      	* src/dialog-cell-format.c (cell_properties_apply): Create a
      	single style that is attached to a region and let each property
      	page fill the structure in.
      	(apply_align_format): Implement.  No wonder it was not working
      	last night.
      	(apply_number_formats): Fill the passed Style structure only.
      	Remove obsolete code.
      
      	* src/sheet.c (sheet_cell_new): New cells are born with auto-style
      	flag turned on.
      
      	* src/clipboard.c (paste_cell): Render the cell after computation
      	is finished.  Clean up the usage of the cell manipulation;  make
      	auto-style work on pasted cells.
      
      	* src/str.c (string_ref): Return the value referenced.
      af81b693
    • Arturo Espinosa's avatar
      Drag and Drop editing actions work now: · c3468eb6
      Arturo Espinosa authored
      
      
      Drag and Drop editing actions work now:
      
      	- Copy cells by contorl-dragging the border of a selection
      	- Move cells by dragging border of a selection
      	- Do other operations by right-button-dragging the selection border
      
      Miguel
      c3468eb6
    • Arturo Espinosa's avatar
      Alignment dialog box (does not work though, wonder why). · c73132df
      Arturo Espinosa authored
      
      
      Alignment dialog box (does not work though, wonder why).
      
      Various fixes to the cursor handling;
      
      Stippled cursors for autofill and drag;
      
      check in before going home.
      
      Miguel.
      c73132df
  5. 18 Aug, 1998 3 commits
    • Miguel de Icaza's avatar
      Make the selected column and row be always fully visible (ie, use the · 3c5f135d
      Miguel de Icaza authored
      1998-08-18  Miguel de Icaza  <miguel@nuclecu.unam.mx>
      
      	* src/gnumeric-sheet.c (gnumeric_sheet_compute_visible_ranges):
      	Make the selected column and row be always fully visible (ie, use
      	the ->last_full_[col|row] instead of last_visible_[col|row].
      
      	* src/cell.c (cell_set_format): Call cell_queue_redraw after
      	changing the cell contents.
      3c5f135d
    • Chris Lahey's avatar
      Fixed the '.' bug. · ccd87b37
      Chris Lahey authored
      ccd87b37
    • Miguel de Icaza's avatar
      Today: · 8df6dcc8
      Miguel de Icaza authored
      
      
      Today:
      
      	- Cell format dialog box + working number formats.
      
      Miguel.
      
      1998-08-17  Miguel de Icaza  <miguel@nuclecu.unam.mx>
      
      	* src/eval.c (cell_eval): Use the formating routine now.
      
      	* src/expr.c (value_format): Format a Value with a StyleFormat.
      
      	* src/item-cursor.c (item_cursor_set_bounds_visibly): Force a
      	canvas update after moving the selection.
      
      	* src/sheet.c (sheet_selection_to_list): New function: generates a
      	list of cells from the sheet->selections list.
      
      	* src/style.c: Now styles have a "valid_flag" that has a bit
      	turned on for those parts of the style that are actually used.
      	This is required for adding the regions of style application in a
      	Sheet.
      	(style_destroy): destroy only those valid parts in a style.
      
      	* src/dialog-cell-format.c: New file.   Implements the cell/format
      	dialog box.
      
      	* src/cell.c (cell_render_value): new routine used to render the
      	cell->value into cell->text.
      	(cell_queue_redraw): new routine to queue individual redraws of
      	the screen.  I believe it is buggy, as the screen does not update
      	after an apply in the cell/format dialog box.
      	(cell_set_format): New routine to change the format of an existing
      	cell.
      
      	* src/format.c (format_number): Added color argument;  smaller
      	fixes to use it within gnumeric.
      
      	* src/main.c (main): Include i18n setup as per namsh's suggetion.
      8df6dcc8
  6. 17 Aug, 1998 1 commit
  7. 15 Aug, 1998 2 commits
    • Chris Lahey's avatar
      Latest version of format.c. · 178555c3
      Chris Lahey authored
      178555c3
    • Arturo Espinosa's avatar
      Various little fixes here and there: · c3a522d6
      Arturo Espinosa authored
      
      
      Various little fixes here and there:
      
      	- Basic support for dragging the selection is in (still does
      	  not do anything, will do the action binding later).
      
      	- Fixes to the cell-selection-code-when-you-type-a-formula code
      
      	- ExprTrees are now properly refcounted (instead of only
      	  refcounting the root node).  This is required for the
      	  Paste special/with-arithmetic operation feature.
      
      	- Expression decoding (for pasting a formula with relative
      	  references) now takes into account operator precedence to
      	  avoid cluttering the pasted expression with extra paretheses.
      
      	Other smallish fixes which I forget now.
      
      Miguel.
      c3a522d6
  8. 14 Aug, 1998 4 commits
  9. 13 Aug, 1998 1 commit
  10. 12 Aug, 1998 2 commits
  11. 11 Aug, 1998 1 commit
  12. 10 Aug, 1998 1 commit
  13. 08 Aug, 1998 2 commits
    • Arturo Espinosa's avatar
      It autocalcs! · d2c3b2ba
      Arturo Espinosa authored
      
      
      It autocalcs!
      
      My technique is incredibly cool!  The engine should support
      most excel features for recursive computations (we just need
      the dialog boxes now).
      
      It still has a wierdo crash from a mismatched string ref/unref
      but that is going to be trivial to fix.
      
      Next step:  Functions in Perl.
      d2c3b2ba
    • Arturo Espinosa's avatar
      Today it probably does not compile, but I have to leave now. · 6b09bc61
      Arturo Espinosa authored
      
      
      Today it probably does not compile, but I have to leave now.
      
      This is basically the framework for getting computations working.
      
      My current approach is to register areas of interest for a cell.
      This is not perfect, but good enough:
      
      	The idea is to walk the expression tree and look for
      	cell references (cell references or ranges) and register
      	those areas of "interest" for a cell.
      
      	When a new text is entered into a cell, the "regions" of
      	interest list is checked and if a match is found, then
      	the cells on that region of interest are queued for
      	recomputation.
      
      Of course, I do not know yet how to handle the recursive references.
      
      One option is to keep a counter (that starts at zero) during
      recomputation, ie something like:
      
      eval_cell (Cell *cell)
      {
      	cell->use_count++;
      	if (cell->use_count > threshold)
      		return "Cycle too depth";
      	...
      	on value lookup:
      		eval_cell (cell);
      	...
      	cell->use_count--;
      }
      6b09bc61
  14. 07 Aug, 1998 4 commits
  15. 06 Aug, 1998 1 commit
    • Arturo Espinosa's avatar
      Lots of things today: · b261e986
      Arturo Espinosa authored
      
      
      Lots of things today:
      
      - New functions implemented:
      	SELECTION(),  SUM(),  IF()
      
      - Autocompute of an expression that applies to the selection.
      
      - Added comparission to the expression grammar.
      
      - Added array values.
      
      Bug fixes as usual and lots other thingies I forget.
      
      Miguel
      b261e986
  16. 05 Aug, 1998 4 commits
  17. 04 Aug, 1998 1 commit
  18. 31 Jul, 1998 1 commit
    • Federico Mena Quintero's avatar
      Neat X hack: set the window backing pixmap to NULL, so that the window · a0190b68
      Federico Mena Quintero authored
      1998-07-30  Federico Mena Quintero  <federico@nuclecu.unam.mx>
      
      	* src/sheet.c (canvas_bar_realized):
      	* src/gnumeric-sheet.c (gnumeric_sheet_realize): Neat X hack:  set
      	the window backing pixmap to NULL, so that the window does not get
      	cleared when it receives an exposure event.  It will just leave
      	whatever bits were on the window when the expose happened.  This
      	allows us to avoid flicker.  *** MIGUEL, LOOK AT THIS ***
      
      	* src/gnumeric-sheet.c (gnumeric_sheet_make_cell_visible): Fixed
      	width/height confusion (cut&paste bug).
      
      	* src/sheet.c (new_canvas_bar): Set outrageously big scrolling
      	limits.  This has to be fixed to use the real sheet's dimensions.
      	(sheet_new): Use correct table expansion parameters.
      a0190b68
  19. 30 Jul, 1998 3 commits
    • Federico Mena Quintero's avatar
      Use gnome_canvas_scroll_to(). · 83801a54
      Federico Mena Quintero authored
      1998-07-30  Federico Mena Quintero  <federico@nuclecu.unam.mx>
      
      	* src/sheet.c (sheet_set_zoom_factor): Use gnome_canvas_scroll_to().
      
      	* src/gnumeric-sheet.c (gnumeric_sheet_set_top_row): Scroll using
      	gnome_canvas_scroll_to().
      	(gnumeric_sheet_set_top_col): Likewise.
      	(gnumeric_sheet_make_cell_visible): Get the offsets using
      	gnome_canvas_get_scroll_offsets().
      	(gnumeric_sheet_make_cell_visible): Use gnome_canvas_scroll_to().
      83801a54
    • Federico Mena Quintero's avatar
      Query the colormap with gtkdget_get_colormap(), because the canvas · ed5aa7d4
      Federico Mena Quintero authored
      1998-07-30  Federico Mena Quintero  <federico@nuclecu.unam.mx>
      
      	* src/gnumeric-sheet.c (gnumeric_sheet_color_alloc): Query the
      	colormap with gtkdget_get_colormap(), because the canvas structure
      	no longer has a colormap field in it.
      	(gnumeric_sheet_set_top_row): Use the canvas layout adjustment to
      	scroll.
      	(gnumeric_sheet_set_top_col): Use the canvas layout adjustment to
      	scroll.
      	(gnumeric_sheet_make_cell_visible): Get the values from the canvas
      	adjustments.
      
      	* src/sheet.c (new_canvas_bar): Call gnome_canvas_new() correctly.
      	(scroll_to): New helper function to scroll a canvas.
      	(sheet_set_zoom_factor): Use scroll_to().
      
      	* src/gnumeric-sheet.c (gnumeric_sheet_create): Do not call
      	gnome_canvas_construct() at is does not exist anymore.
      	(gnumeric_sheet_new): Use outrageously big values for the canvas
      	scrolling region, for now.  This needs to be fixed.
      	(gnumeric_sheet_make_cell_visible): Use the canvas layout
      	adjustment to scroll.
      ed5aa7d4
    • 0's avatar
      Free the record that tracks the allocation records. (alloc_clean): Handle · 69def31c
      0 authored
      1998-07-30    <miguel@nuclecu.unam.mx>
      
      	* src/parser.y (alloc_clean): Free the record that tracks the
      	allocation records.
      	(alloc_clean): Handle Strings.
      	(alloc_list_free): New function: cleans up the allocation list.
      
      	* src/gnumeric-sheet.c (gnumeric_sheet_load_cell_val): Fix to use
      	the new Strings.
      
      	* src/cell.h: Use the new Strings instead of the Symbols.  That
      	was just a stupid idea.
      
      	* src/str.c (string_ref): New file:  Implements string sharing.
      
      	* src/symbol.c (symbol_install): Use our copy of the allocated key
      	when installing the symbol.
      
      1998-07-29    <miguel@nuclecu.unam.mx>
      
      	* src/symbol.c (symbol_unref_ptr): New function that does symbol
      	unreferencing and if the reference count reaches zero, it also
      	sets the value pointed to NULL.
      
      	* src/sheet.c (cell_set_text): Release evaluation tree after
      	entering new contents in a cell.
      
      	* src/sheet.h (Cell): We now keep all of the character information
      	as refcounted Symbols.
      
      	* src/expr.c (eval_node_release): Renamed and made static.  New
      	allocation strategy: EvalTree's top node are now refcounted to
      	simplify cell duplication.
      	(eval_expr): Now it takes column and row arguments for evaluating
      	the expression in that context.
      	(expr_parse_string): Same.
      
      	* src/parser.y: Renamed EvalNode to EvalTree.
      	(return_cellref): CellRefs now contain offsets relative to the
      	current column/row if the references are not absolute.
      
      	* src/gnumeric-sheet.c (gnumeric_sheet_make_cell_visible): Use new
      	helper routines for doing the scrolling.  Scroll vertically.
      	(gnumeric_sheet_set_top_row, gnumeric_sheet_set_top_col): New
      	routines for keeping the contents of the canvas and the bars in
      	sync.
      	(gnumeric_sheet_new): Take the ItemBars for the columns and rows
      	as a parameter now.
      
      	* src/sheet.c (sheet_select_all): New routine: select the complete spreadsheet.
      
      	* src/item-bar.c (item_bar_class_init): Signal now takes an extra
      	argument which indicates the beginning of a column selection.
      
      	* src/sheet.c (sheet_selection_col_extend_to,
      	sheet_selection_row_extend_to): New methods for implementing the
      	extending column and row selection.
      	(sheet_row_selection_changed, sheet_col_selection_changed): Now
      	they use the new parameter to start the selection.
      69def31c
  20. 28 Jul, 1998 1 commit