1998-08-18 Miguel de Icaza * src/cell.c (cell_set_alignment): Provide a way to change the cell alignment. * src/dialog-cell-format.c (create_align_page): Implement the cell formats/alignment page. * src/item-cursor.c (item_cursor_realize): Add stypple support for drag and autofill cursors. * 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. 1998-08-18 Chris Lahey * src/format.c (format_number): Fixed the small '.' error. (decimal point shown even if not requested in numeric conversions.) 1998-08-17 Miguel de Icaza * 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. 1998-08-15 Chris Lahey * src/format.c: Merged format_text and format_date into format_number. Added parsing of am/pm. Added a short format description. 1998-08-15 Miguel de Icaza * src/item-cursor.c (item_cursor_drag_event): Make the drag cursor actually dragable. * src/item-grid.c (item_grid_event): Use the converted cordinates. (item_grid_find_row, item_grid_find_col): Rename and export these routines to be used by the ItemCursor. * src/gnumeric-sheet.c (gnumeric_sheet_key): Do not remove the selection string when the input has been accepted. * src/expr.c (expr_tree_ref): Strategy change: Now every ExprTree node is properly refcounted, as soon we will start sharing parts of the ExprTree between cells. (do_expr_decode_tree): Decoding an expression now takes into account the precedence of the operators and uses paretheses only when they are actually required. 1998-08-14 Miguel de Icaza * src/item-grid.c (item_grid_event): Implemented context sensitive menu for the grid. (item_grid_event): Use instead of for extending a selection * src/clipboard.c (clipboard_paste_region): After pasting, trigger a recalculation. 1998-08-14 Jaka Mocnik * src/clipboard.h: changed PASTE_ALL to PASTE_ALL_TYPES. * src/gnumeric-util.c (gtk_radio_group_get_selected): changed to work. I guess it is a bit weird trying to access a next member of an int ;). 1998-08-13 Miguel de Icaza * src/workbook.c (workbook_set_region_status): Support going to a cell by typing the cell name on the entry line. (workbook_parse_and_jump): new routine for jumpting to a specific cell. * src/dialog-goto-cell.c: New file. Implements the goto cell dialog box. * src/clipboard.c: implemented paste-special dialog box. (clipboard_paste_region): Redraw after clearing and after each cell is pasted. * src/sheet.c (sheet_selection_changed_hook): Display the current selection. (sheet_selection_walk_step): Fix the movememnt code to walk correctly over the selection. * src/cell.c (cell_formula_changed): New function used to notify of a cell formula change (required for recomputation and to add the cells to the proper computation lists). * src/expr.c (expr_decode_tree): Goes from ExprTree to a string representation. This is required when copying cell values to recompute the string that is displayed to the user. * src/util.c (cellref_name): New function, get a string representation for a CellRef. (parse_cell_name): New function, returns integers for col, row from a cell string representation. Thu Aug 13 19:08:28 1998 Tom Tromey * src/xml-io.c: Look in gnome-xml for tree.h and parser.h. Thu Aug 13 00:02:23 EDT 1998 Daniel Veillard * src/xml-io.c : adapated to the new version 0.2 of the xml lib 1998-08-11 Miguel de Icaza * src/fn-math.c (gnumeric_bin2dec): finish implementation of BIN2DEC * src/item-grid.c (item_grid_event): Call gnumeric_sheet_accept_pending_output before moving the cursor. * src/item-cursor.c (item_cursor_event): Event handler for the item_cursors. * src/item-cursor.h: More cursor types: ITEM_CURSOR_AUTOFILL (for the case where the small drag box is used) and ITEM_CURSOR_DRAG (for when the item is being dragged). * src/clipboard.c (clipboard_paste_region, clipboard_copy_cell_range): New functions for cut and paste support. * src/cell.c (cell_destroy, cell_copy): New functions. Preparing for cut and paste support. * src/expr.c (value_copy_to): Finish implementing all cases. (value_duplicate): New function. Duplicates a value. * src/sheet.c (sheet_cell_remove): Implement a way to remove cells. * src/eval.c (workbook_recalc): New recomputation strategy: We now keep a generation flag for determining whenever a cell value has been recomputed for this generation. The generation variable is a char. Everytime we are about to overflow the char, we walk the list of formulas and reset the generation flag. 1998-08-10 Miguel de Icaza * src/eval.c (workbook_recalc): Queue computation for cells that have been recomputed. * src/expr.c (eval_expr): Implement the concatenation operator. 1998-08-09 Miguel de Icaza * src/expr.c (eval_expr): Implement comparission. * src/str.c (string_unref_ptr, string_unref): Remove the string from the string_hash_table when the refcount reaches zero. * src/symbol.c (symbol_unref): Remove the symbol from the hash table when the refcount reaches zero. 1998-08-07 Miguel de Icaza * src/gnumeric-sheet.c: Renamed all references to (GnumericSheet *) called "sheet" to "gsheet". * src/sheet.h: Renamed parent_workbook in to be workbook. * src/cell.h: Include a Sheet * in the cell. Make routines that required a Sheet parameter only use the Cell parameter now. * src/eval.c (add_tree_deps, cell_add_dependencies, add_value_deps, dependency_hash_init, dependency_hash, dependency_equal): New functions to maintain the DependencyRanges. * src/fn-math.c (gnumeric_max): Implemented function MAX. (gnumeric_min): Implemented function MIN. 1998-08-06 Miguel de Icaza * src/expr.c (eval_expr): Implemented exponentiation. Removed the code that used GMP. * src/parser.y (yylex): Bug fix: allocate the string. * src/sheet.c (CRowSort): Sort in the other direction my list of cells. (sheet_cell_foreach_range): Iterate over the lists with ->next, not with ->data. Important bug fix. * src/parser.y (return_cellref): Fix the cell parsing routine to store the correct information. * src/fn-math.c: Moved the math functions to this file. (gnumeric_sum): Make it use the new function_iterate_argument_values. (gnumeric_and): Implement AND function. (gnumeric_or): Implement OR function. * src/func.c (function_iterate_argument_values): New function to ease the creation of functions with multiple arguments. It generates Value * for a list of expressions that might include arrays and cell ranges. * src/expr.c (cell_get_col_row): New routine to get the absolute cordinates with respect to an evaluation column and row. * src/parser.y (return_symbol): Support for constants. * src/expr.c (value_copy_to): Support for making Value copies (only used for our constants actually). * src/symbol.c (init_constants): Declare TRUE and FALSE. * src/sheet.c (sheet_selection_changed_hook): Autocomputation routine. Whenever selection changes this routine will execute an arbitrary expression (kept in the workbook) and display the result. 1998-08-05 Miguel de Icaza * src/expr.c (value_release): Release the value. (value_release): Add support for arrays. * src/symbol.c (g_strcase_hash): Use case insensitive hash tables. * src/item-bar.c (item_bar_unrealize): Call parent unrealize (item_bar_realize): Call parent realize * src/item-grid.c (item_bar_unrealize): Call parent unrealize (item_bar_realize): Call parent realize * src/item-cursor.c (item_bar_unrealize): Call parent unrealize (item_bar_realize): Call parent realize. (item_cursor_point): Implement correctly. * src/expr.c, parser.y (eval_expr): Added comparission operators. * src/fn-sheet.c (gnumeric_if): Implemented IF function. Implemented SELECTION function. * src/func.c (gnumeric_sum): Implement SUM function. 1998-08-05 * src/expr.c (eval_funcall): No need for the the extra argc parameter on the functions with strong prototypes. * src/func.c (gnumeric_cosh): More functions. * src/item-edit.c (item_edit_set_arg): * src/gnumeric-sheet.c (cancel_pending_input): Cancel changes made. (start_editing_at_cursor): Make a copy of the original text, and clear the actual text to fix the redraw problems. * src/item-edit.c (item_edit_set_editor): Make the cursor be in sync with the GtkEntry by hooking to the "event" signal and catching key press and key release events. * src/func.c: More functions added. * src/symbol.c (g_strcase_equal): Symbol hash table does is case-insensitive. * src/expr.c (eval_funcall): Added function evaluation. 1998-08-03 Miguel de Icaza * src/eval.c: New file. Move the evaluation routines here. * src/func.c: Functions will go here. * src/parser.y (alloc_glist): Keep track of argument lists. 1998-07-30 Federico Mena Quintero * 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. * 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(). * 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. 1998-07-30 * 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 * 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. 1998-07-28 * src/sheet.c (sheet_cell_new): Insert the row, not the cell in the column list. (sheet_cell_foreach_range): Fixety fix 1998-07-27 * src/sheet.c (sheet_cell_new): Cells are born with their propper width. (cell_set_text): Width should include the margins. * src/main.c (main): Rename currentWorkbook to current_workbook, so that it follows the style of the rest of my code ;-) * src/item-cursor.c (item_cursor_init): Add a timeout handler for drawing the anted animation. (item_cursor_set_bounds): Setup the Canvas Item bounding box when the bounds of the cursor change. * src/gnumeric-sheet.c (start_cell_selection): Create the selection cursor at the same position the regular cursor is. (gnumeric_sheet_init): Share colors between items and the canvas. Sun Jul 26 17:39:53 EDT 1998 Daniel Veillard * configure.in: added GNOME_XML_CHECK * src/Makefile.am: added xml-io.c to GNUMERIC_BASE_SOURCES and GNOME_XML_LIB to gnumeric_LDADD and test_parser_LDADD * src/xml-io.[ch]: Added, provides saving to XML format * src/main.c: added currentWorkbook global variable * sheet.h: added currentWorkbook global variable * workbook.c: added currentWorkbook global variable, a Save menu with save_cmd callback. * src/sheet.c: cell_set_text, initialized is_float to zero * doc/saving.txt: Added, what to be saved and first example. 1998-07-25 Miguel de Icaza * src/item-cursor.c (item_cursor_draw): Minimal code to support the anted-cursor. There is a bug, I just dont know where :-) * src/gnumeric-sheet.c (gnumeric_sheet_key): Added support for selecting cell values with the cursor keys. (start_cell_selection): Starts the interactive selection of a cell (stop_cell_selection): Stops the interactive selection of a cell. (selection_remove_selection_string): Removes the text that has been inserted into the text line for selection purposes. (selection_insert_selection_string): Updates the entry with the contents of the selection range. (selection_expand_vertical, selection_expand_horizontal): Expands the selection. * src/item-cursor.h (item_cursor_set_bounds): Change prototype to reflect actual argument names. I was a victim of my own lazyness. * src/gnumeric-sheet.c (move_cursor_vertical, move_cursor, move_cursor_horizontal): Renamed to allow formatting in 80 columns. * src/utils.c (cell_name): New routine. Renders a cell name. * src/sheet.h (IS_SHEET): Added a signature to Sheet strucutres and a signature to test with. * src/symbol.c (symbol_ref_string): New function: it makes sure a symbol exists: it either increases the refcount for an existing string, or creates it. 1998-07-24 Miguel de Icaza * src/workbook.c (workbook_get_current_sheet): New function. * src/sheet.c (cell_set_formula): New function. Loads a cell with a formula. * src/parser.y (eval_value_string): New routine to return a string representation of a Value *. This should use the format.c that Chris is working on, but we need Chris to commit his changes ;-). For now it uses %d and %g. * src/numbers.h: Compatibility functions to make the code work with or without GMP. * src/gnumeric-sheet.c (gnumeric_sheet_set_current_value): Sets the value to whatever happens to be on the input line. * src/expr.c (eval_cast_to_float): New function: casts a value to float. (eval_cell_value): new function. (eval_node_value): evaluates the expression tree. * src/cell.h: Keep the computed value as well. Sat Jul 25 14:10:23 1998 Tom Tromey * src/Makefile.am (test_parser_LDADD): Added INTLLIBS. (test_format_LDADD): Likewise. (check_PROGRAMS): Renamed from noinst_PROGRAMS. * src/format.c (do_roundup): Renamed from roundup (my Linux install has a 2-argument `roundup' macro in sys/types.h). Now static. 1998-07-25 Nuno Ferreira * configure.in (ALL_LINGUAS): Added "pt". 1998-07-21 Miguel de Icaza * src/parser.y (yylex): Numbers are parsed correctly. Bits of Oleo number parsing plugged in. * src/util.c, src/util.h: New files with assorted number utilities. * src/numbers.h: New file: takes care of using gmp or regular double/int. * src/expr.c (eval_release_node): Implement. (eval_release_value): New function. * src/sheet.c (sheet_col_selection_changed, sheet_row_selection_changed): Implement. (sheet_selection_clear, sheet_selection_clear_only): Splitted functionality into two routines. (sheet_selection_clear_only): Remove any marks from the bars. (sheet_row_set_selection, sheet_col_set_selection): Implement. * src/item-bar.c (is_pointer_on_division): Return the column changed. * src/item-grid.c (item_grid_draw_cell): Fix the computation for right indentation. 1998-07-17 Miguel de Icaza * src/gnumeric-sheet.c (gnumeric_sheet_key): Add support for keyboard-selection. * src/item-edit.c (item_edit_destroy): Request a repaint for every area we touched at destruction time. * src/sheet.c (sheet_redraw_cell_region, sheet_redraw_selection): New functions to request that only a specific range of cells be redrawn. (sheet_selection_extend_vertical, sheet_selection_extend_horizontal): new routines to deal with mouse selection. Use those functions all over sheet.c 1998-07-19 Federico Mena Quintero * src/gnumeric-sheet.c src/item-bar.c src/sheet.c: Removed the canvas parameter from calls to gnome_canvas_item_new(). 1998-07-18 Raja R Harinath * src/Makefile.am (noinst_PROGRAMS): Don't bother installing `test-format' and `test-token'. 1998-07-15 Miguel de Icaza * src/gnumeric-sheet.c (gnumeric_sheet_cursor_set): Add tracking. * src/sheet.c (sheet_destroy): Add destructor. (sheet_selection_append): New functions for managing the cell selection. * src/style.c (style_destroy): Add destructor. 1998-07-13 Miguel de Icaza * src/item-edit.c: New file. Adds the editing widget to the spreadsheet. 1998-07-15 Federico Mena Quintero * src/item-bar.c (item_bar_event): Use gnome_canvas_item_grab/ungrab() now that they exist. 1998-07-14 Federico Mena Quintero * src/item-bar.c (item_bar_realize): Set the item_bar->gc's foreground color to black (it is by default initialized to pixel value 0, which is not black on all default colormaps). (bar_draw_cell): Center the cell's text correctly. * src/gnumeric-sheet.c (gnumeric_sheet_create): Use gnome_canvas_construct() to initialize the canvas. * src/item-bar.c (get_col_name): Fixed generation of column names. (get_row_name): Rows are numbered from 1, not 0. Also, assert that the row number is less than 65536. (item_bar_event): Grab/ungrab the mouse on button press/release. (item_bar_event): On motion_notify, only call set_cursor() if we are not resizing. (item_bar_event): Only take care of enter_notify events if we are not resizing. * po/es.po configure.in: Added Spanish translation. 1998-07-12 Miguel de Icaza * src/item-bar.c (item_bar_event): Do world->canvas cordinate conversion to get zoomed resizng working). (bar_draw_cell): Minor look fix. * src/sheet.c (sheet_row_set_height): Silly mistake, add the newly created rowinfo to the row array, not the column array. 1998-07-11 Miguel de Icaza * src/style.c (style_duplicate): New function. Does style duplication. * src/sheet.c (sheet_new): Simple hook signals to test the code. * src/item-bar.c (item_bar_class_init): Added signals: size_changed and selection_changed. (item_bar_event): Add support for resizing columns and rows. 1998-07-10 Miguel de Icaza * src/style.c: New file. Implement the style manager for the spreadsheet. 1998-07-09 Miguel de Icaza * src/*: Dropped the ColInfo and RowInfo structures, they are now unified into a single ColRowInfo structure, they were really the same thing. Thanks to Federico for the suggestion. * src/item-grid.c: New paint strategy for the grid (uses what apparently Excel does); It now correctly uses the coordinate system from the canvas (ie, zoom in and zoom out work); * src/item-cursor.c: Implemented new version of the cursor. I am using black lines for the cursor. One day, when I find the strenght, I will use inversion and the inversion will do the right thing. * src/item-bar.c: New file. Implements the titles for the columns and rows; * src/*: made stuff fit together. 1998-07-06 Raja R Harinath * configure.in: Remove duplicated AM_GNU_GETTEXT. Sat Jul 4 15:07:49 PDT 1998 Manish Singh * fixed up intl autoconf stuff 1998-07-04 Chris Lahey * src/Makefile.am (bin_PROGRAMS): Added test-format to compile the formatting tests. * src/format.c (format_time): Added date formatting. (format_text): More accurate numeric formatting. 1998-07-03 Chris Lahey * src/format.c: New file to do excel style number formatting. 1998-07-03 Chris Lahey * ChangeLog: Cleared the gnome-games entries from the ChangeLog.