Commit 43215bb3 authored by Jody Goldberg's avatar Jody Goldberg Committed by Jody Goldberg

new. (sc_sheet) : const. (sc_update_cursor_pos) : delete.

2001-07-30  Jody Goldberg <jgoldberg@home.com>

	* src/sheet-control.c (sc_wbc) : new.
	(sc_sheet) : const.
	(sc_update_cursor_pos) : delete.

	* src/gnumeric-pane.c (gnm_pane_special_cursor_bound_set) : new.
	(gnm_pane_special_cursor_start) : ditto.
	(gnm_pane_special_cursor_start) : ditto.

	* src/sheet-control-gui.c (scg_update_cursor_pos)  : fold into
	  scg_resize.
	(scg_resize) : reposition all of the cursors.
	(scg_edit_start) renamed from scg_create_editor.
	(scg_edit_stop) : renamed from scg_stop_editing.
	(scg_special_cursor_start) : new.
	(scg_special_cursor_stop) : new.
	(scg_special_cursor_bound_set) : new.

	* src/item-cursor.c (item_cursor_selection_event) : Use
	  scg_special_cursor_start, and scg_special_cursor_bound_set.
	(item_cursor_do_action) : use scg_special_cursor_stop.
	(item_cursor_do_drop) : ditto.
	(item_cursor_autofill_event) : ditto.
	(item_cursor_set_bounds_visibly) : Doh! fix my stupidity.
	  We need to change the visibility here because we explicitly disable
	  doing it in the scroll handlers.  We are constraining the scroll
	  so we need to do it manually.

2001-07-30  Jody Goldberg <jgoldberg@home.com>

	s/GnumericSheet/GnumericCanvas/
	s/gsheet/gcanvas/
	s/gnumeric_sheet_*/gnm_canvas_/
	s/gnumeric_pane_*/gnm_pane_/
	Move the std and rangesel cursors from GnumericSheet -> GnumericPane
	Move the grid and editor from GnumericSheet -> GnumericPane

2001-07-28  Jody Goldberg <jgoldberg@home.com>

	* src/gnumeric-sheet.c (gnumeric_sheet_handle_motion) : fix autoscroll
	  from bottom/right panes into adjcant regions that do not scroll as
	  reported by almer.

2001-07-28  Jody Goldberg <jgoldberg@home.com>

	* src/gnumeric-sheet.c (gnumeric_sheet_handle_motion) : work towards
	  support h only or v only freezes by using the geometry of pane 1 or 3
	  in place of pane 2 which only exists in the h&v case.
	(gsheet_sliding_callback) : ditto.
	(gnumeric_sheet_slide_init: ditto.
parent d6f0344a
......@@ -31,7 +31,6 @@ Long term breakage
: keep the hash per sheet rather than per workbook.
- Panes
: cursor dragging only affects src pane.
: support horizontal or vertical only
- support negative durations with [h]
......
2001-07-30 Jody Goldberg <jgoldberg@home.com>
* src/sheet-control.c (sc_wbc) : new.
(sc_sheet) : const.
(sc_update_cursor_pos) : delete.
* src/gnumeric-pane.c (gnm_pane_special_cursor_bound_set) : new.
(gnm_pane_special_cursor_start) : ditto.
(gnm_pane_special_cursor_start) : ditto.
* src/sheet-control-gui.c (scg_update_cursor_pos) : fold into
scg_resize.
(scg_resize) : reposition all of the cursors.
(scg_edit_start) renamed from scg_create_editor.
(scg_edit_stop) : renamed from scg_stop_editing.
(scg_special_cursor_start) : new.
(scg_special_cursor_stop) : new.
(scg_special_cursor_bound_set) : new.
* src/item-cursor.c (item_cursor_selection_event) : Use
scg_special_cursor_start, and scg_special_cursor_bound_set.
(item_cursor_do_action) : use scg_special_cursor_stop.
(item_cursor_do_drop) : ditto.
(item_cursor_autofill_event) : ditto.
(item_cursor_set_bounds_visibly) : Doh! fix my stupidity.
We need to change the visibility here because we explicitly disable
doing it in the scroll handlers. We are constraining the scroll
so we need to do it manually.
2001-07-30 Jody Goldberg <jgoldberg@home.com>
s/GnumericSheet/GnumericCanvas/
s/gsheet/gcanvas/
s/gnumeric_sheet_*/gnm_canvas_/
s/gnumeric_pane_*/gnm_pane_/
Move the std and rangesel cursors from GnumericSheet -> GnumericPane
Move the grid and editor from GnumericSheet -> GnumericPane
2001-07-28 Jody Goldberg <jgoldberg@home.com>
* src/gnumeric-sheet.c (gnumeric_sheet_handle_motion) : fix autoscroll
from bottom/right panes into adjcant regions that do not scroll as
reported by almer.
2001-07-28 Jody Goldberg <jgoldberg@home.com>
* src/gnumeric-sheet.c (gnumeric_sheet_handle_motion) : work towards
support h only or v only freezes by using the geometry of pane 1 or 3
in place of pane 2 which only exists in the h&v case.
(gsheet_sliding_callback) : ditto.
(gnumeric_sheet_slide_init: ditto.
2001-07-28 Jody Goldberg <jgoldberg@home.com>
* src/gnumeric-pane.c (gnumeric_pane_colrow_resize_start) :
Switch GnumericSheet to using CellPos for consisency.
* src/gnumeric-sheet.c (gnumeric_sheet_key_mode_sheet) : ditto.
(gnumeric_sheet_button_release) : ditto.
(gnumeric_sheet_init) : ditto.
(gnumeric_sheet_find_col) : ditto.
(gnumeric_sheet_find_row) : ditto.
(gnumeric_sheet_create_editor) : ditto.
(gsheet_compute_visible_region) : ditto.
(gnumeric_sheet_redraw_region) : ditto.
(gsheet_sliding_callback): ditto.
(gnumeric_sheet_handle_motion) : ditto.
(gnumeric_sheet_slide_init) : ditto.
* src/item-bar.c (item_bar_draw) : ditto.
(item_bar_event) : ditto.
* src/item-cursor.c (item_cursor_update) : ditto.
(item_cursor_draw) : ditto.
* src/item-edit.c (recalc_spans) : ditto.
(item_edit_set_arg) : ditto.
* src/sheet-control-gui.c (scg_redraw_headers) : ditto.
(scg_resize) : ditto.
(scg_scrollbar_config) : ditto.
(scg_colrow_select) : ditto.
(gnumeric_sheet_update_inital_top_left) : ditto.
(bar_set_left_col) : ditto.
(bar_set_top_row) : ditto.
(gnumeric_sheet_set_left_col) : ditto.
(gnumeric_sheet_set_top_row) : ditto.
(gnumeric_sheet_set_top_left) : ditto.
(gnumeric_sheet_make_cell_visible) : ditto.
(scg_set_panes) : ditto.
(cb_slide_handler) : ditto.
* src/workbook-control-gui.c (cb_view_freeze_panes) : ditto.
2001-07-24 Jody Goldberg <jgoldberg@home.com>
* plugins/Makefile.am (SUBDIRS) : Add psion plugin from
......
......@@ -17,6 +17,7 @@ Andreas:
Jody:
* XL export for panes.
* Some autoscroll bugs with panes.
* Cursor support for panes.
Morten:
* Fix MODE.
......
2001-07-30 Jody Goldberg <jgoldberg@home.com>
* src/sheet-control.c (sc_wbc) : new.
(sc_sheet) : const.
(sc_update_cursor_pos) : delete.
* src/gnumeric-pane.c (gnm_pane_special_cursor_bound_set) : new.
(gnm_pane_special_cursor_start) : ditto.
(gnm_pane_special_cursor_start) : ditto.
* src/sheet-control-gui.c (scg_update_cursor_pos) : fold into
scg_resize.
(scg_resize) : reposition all of the cursors.
(scg_edit_start) renamed from scg_create_editor.
(scg_edit_stop) : renamed from scg_stop_editing.
(scg_special_cursor_start) : new.
(scg_special_cursor_stop) : new.
(scg_special_cursor_bound_set) : new.
* src/item-cursor.c (item_cursor_selection_event) : Use
scg_special_cursor_start, and scg_special_cursor_bound_set.
(item_cursor_do_action) : use scg_special_cursor_stop.
(item_cursor_do_drop) : ditto.
(item_cursor_autofill_event) : ditto.
(item_cursor_set_bounds_visibly) : Doh! fix my stupidity.
We need to change the visibility here because we explicitly disable
doing it in the scroll handlers. We are constraining the scroll
so we need to do it manually.
2001-07-30 Jody Goldberg <jgoldberg@home.com>
s/GnumericSheet/GnumericCanvas/
s/gsheet/gcanvas/
s/gnumeric_sheet_*/gnm_canvas_/
s/gnumeric_pane_*/gnm_pane_/
Move the std and rangesel cursors from GnumericSheet -> GnumericPane
Move the grid and editor from GnumericSheet -> GnumericPane
2001-07-28 Jody Goldberg <jgoldberg@home.com>
* src/gnumeric-sheet.c (gnumeric_sheet_handle_motion) : fix autoscroll
from bottom/right panes into adjcant regions that do not scroll as
reported by almer.
2001-07-28 Jody Goldberg <jgoldberg@home.com>
* src/gnumeric-sheet.c (gnumeric_sheet_handle_motion) : work towards
support h only or v only freezes by using the geometry of pane 1 or 3
in place of pane 2 which only exists in the h&v case.
(gsheet_sliding_callback) : ditto.
(gnumeric_sheet_slide_init: ditto.
2001-07-28 Jody Goldberg <jgoldberg@home.com>
* src/gnumeric-pane.c (gnumeric_pane_colrow_resize_start) :
Switch GnumericSheet to using CellPos for consisency.
* src/gnumeric-sheet.c (gnumeric_sheet_key_mode_sheet) : ditto.
(gnumeric_sheet_button_release) : ditto.
(gnumeric_sheet_init) : ditto.
(gnumeric_sheet_find_col) : ditto.
(gnumeric_sheet_find_row) : ditto.
(gnumeric_sheet_create_editor) : ditto.
(gsheet_compute_visible_region) : ditto.
(gnumeric_sheet_redraw_region) : ditto.
(gsheet_sliding_callback): ditto.
(gnumeric_sheet_handle_motion) : ditto.
(gnumeric_sheet_slide_init) : ditto.
* src/item-bar.c (item_bar_draw) : ditto.
(item_bar_event) : ditto.
* src/item-cursor.c (item_cursor_update) : ditto.
(item_cursor_draw) : ditto.
* src/item-edit.c (recalc_spans) : ditto.
(item_edit_set_arg) : ditto.
* src/sheet-control-gui.c (scg_redraw_headers) : ditto.
(scg_resize) : ditto.
(scg_scrollbar_config) : ditto.
(scg_colrow_select) : ditto.
(gnumeric_sheet_update_inital_top_left) : ditto.
(bar_set_left_col) : ditto.
(bar_set_top_row) : ditto.
(gnumeric_sheet_set_left_col) : ditto.
(gnumeric_sheet_set_top_row) : ditto.
(gnumeric_sheet_set_top_left) : ditto.
(gnumeric_sheet_make_cell_visible) : ditto.
(scg_set_panes) : ditto.
(cb_slide_handler) : ditto.
* src/workbook-control-gui.c (cb_view_freeze_panes) : ditto.
2001-07-24 Jody Goldberg <jgoldberg@home.com>
* plugins/Makefile.am (SUBDIRS) : Add psion plugin from
......
2001-07-30 Jody Goldberg <jgoldberg@home.com>
* src/sheet-control.c (sc_wbc) : new.
(sc_sheet) : const.
(sc_update_cursor_pos) : delete.
* src/gnumeric-pane.c (gnm_pane_special_cursor_bound_set) : new.
(gnm_pane_special_cursor_start) : ditto.
(gnm_pane_special_cursor_start) : ditto.
* src/sheet-control-gui.c (scg_update_cursor_pos) : fold into
scg_resize.
(scg_resize) : reposition all of the cursors.
(scg_edit_start) renamed from scg_create_editor.
(scg_edit_stop) : renamed from scg_stop_editing.
(scg_special_cursor_start) : new.
(scg_special_cursor_stop) : new.
(scg_special_cursor_bound_set) : new.
* src/item-cursor.c (item_cursor_selection_event) : Use
scg_special_cursor_start, and scg_special_cursor_bound_set.
(item_cursor_do_action) : use scg_special_cursor_stop.
(item_cursor_do_drop) : ditto.
(item_cursor_autofill_event) : ditto.
(item_cursor_set_bounds_visibly) : Doh! fix my stupidity.
We need to change the visibility here because we explicitly disable
doing it in the scroll handlers. We are constraining the scroll
so we need to do it manually.
2001-07-30 Jody Goldberg <jgoldberg@home.com>
s/GnumericSheet/GnumericCanvas/
s/gsheet/gcanvas/
s/gnumeric_sheet_*/gnm_canvas_/
s/gnumeric_pane_*/gnm_pane_/
Move the std and rangesel cursors from GnumericSheet -> GnumericPane
Move the grid and editor from GnumericSheet -> GnumericPane
2001-07-28 Jody Goldberg <jgoldberg@home.com>
* src/gnumeric-sheet.c (gnumeric_sheet_handle_motion) : fix autoscroll
from bottom/right panes into adjcant regions that do not scroll as
reported by almer.
2001-07-28 Jody Goldberg <jgoldberg@home.com>
* src/gnumeric-sheet.c (gnumeric_sheet_handle_motion) : work towards
support h only or v only freezes by using the geometry of pane 1 or 3
in place of pane 2 which only exists in the h&v case.
(gsheet_sliding_callback) : ditto.
(gnumeric_sheet_slide_init: ditto.
2001-07-28 Jody Goldberg <jgoldberg@home.com>
* src/gnumeric-pane.c (gnumeric_pane_colrow_resize_start) :
Switch GnumericSheet to using CellPos for consisency.
* src/gnumeric-sheet.c (gnumeric_sheet_key_mode_sheet) : ditto.
(gnumeric_sheet_button_release) : ditto.
(gnumeric_sheet_init) : ditto.
(gnumeric_sheet_find_col) : ditto.
(gnumeric_sheet_find_row) : ditto.
(gnumeric_sheet_create_editor) : ditto.
(gsheet_compute_visible_region) : ditto.
(gnumeric_sheet_redraw_region) : ditto.
(gsheet_sliding_callback): ditto.
(gnumeric_sheet_handle_motion) : ditto.
(gnumeric_sheet_slide_init) : ditto.
* src/item-bar.c (item_bar_draw) : ditto.
(item_bar_event) : ditto.
* src/item-cursor.c (item_cursor_update) : ditto.
(item_cursor_draw) : ditto.
* src/item-edit.c (recalc_spans) : ditto.
(item_edit_set_arg) : ditto.
* src/sheet-control-gui.c (scg_redraw_headers) : ditto.
(scg_resize) : ditto.
(scg_scrollbar_config) : ditto.
(scg_colrow_select) : ditto.
(gnumeric_sheet_update_inital_top_left) : ditto.
(bar_set_left_col) : ditto.
(bar_set_top_row) : ditto.
(gnumeric_sheet_set_left_col) : ditto.
(gnumeric_sheet_set_top_row) : ditto.
(gnumeric_sheet_set_top_left) : ditto.
(gnumeric_sheet_make_cell_visible) : ditto.
(scg_set_panes) : ditto.
(cb_slide_handler) : ditto.
* src/workbook-control-gui.c (cb_view_freeze_panes) : ditto.
2001-07-24 Jody Goldberg <jgoldberg@home.com>
* plugins/Makefile.am (SUBDIRS) : Add psion plugin from
......
2001-07-30 Jody Goldberg <jgoldberg@home.com>
* src/sheet-control.c (sc_wbc) : new.
(sc_sheet) : const.
(sc_update_cursor_pos) : delete.
* src/gnumeric-pane.c (gnm_pane_special_cursor_bound_set) : new.
(gnm_pane_special_cursor_start) : ditto.
(gnm_pane_special_cursor_start) : ditto.
* src/sheet-control-gui.c (scg_update_cursor_pos) : fold into
scg_resize.
(scg_resize) : reposition all of the cursors.
(scg_edit_start) renamed from scg_create_editor.
(scg_edit_stop) : renamed from scg_stop_editing.
(scg_special_cursor_start) : new.
(scg_special_cursor_stop) : new.
(scg_special_cursor_bound_set) : new.
* src/item-cursor.c (item_cursor_selection_event) : Use
scg_special_cursor_start, and scg_special_cursor_bound_set.
(item_cursor_do_action) : use scg_special_cursor_stop.
(item_cursor_do_drop) : ditto.
(item_cursor_autofill_event) : ditto.
(item_cursor_set_bounds_visibly) : Doh! fix my stupidity.
We need to change the visibility here because we explicitly disable
doing it in the scroll handlers. We are constraining the scroll
so we need to do it manually.
2001-07-30 Jody Goldberg <jgoldberg@home.com>
s/GnumericSheet/GnumericCanvas/
s/gsheet/gcanvas/
s/gnumeric_sheet_*/gnm_canvas_/
s/gnumeric_pane_*/gnm_pane_/
Move the std and rangesel cursors from GnumericSheet -> GnumericPane
Move the grid and editor from GnumericSheet -> GnumericPane
2001-07-28 Jody Goldberg <jgoldberg@home.com>
* src/gnumeric-sheet.c (gnumeric_sheet_handle_motion) : fix autoscroll
from bottom/right panes into adjcant regions that do not scroll as
reported by almer.
2001-07-28 Jody Goldberg <jgoldberg@home.com>
* src/gnumeric-sheet.c (gnumeric_sheet_handle_motion) : work towards
support h only or v only freezes by using the geometry of pane 1 or 3
in place of pane 2 which only exists in the h&v case.
(gsheet_sliding_callback) : ditto.
(gnumeric_sheet_slide_init: ditto.
2001-07-28 Jody Goldberg <jgoldberg@home.com>
* src/gnumeric-pane.c (gnumeric_pane_colrow_resize_start) :
Switch GnumericSheet to using CellPos for consisency.
* src/gnumeric-sheet.c (gnumeric_sheet_key_mode_sheet) : ditto.
(gnumeric_sheet_button_release) : ditto.
(gnumeric_sheet_init) : ditto.
(gnumeric_sheet_find_col) : ditto.
(gnumeric_sheet_find_row) : ditto.
(gnumeric_sheet_create_editor) : ditto.
(gsheet_compute_visible_region) : ditto.
(gnumeric_sheet_redraw_region) : ditto.
(gsheet_sliding_callback): ditto.
(gnumeric_sheet_handle_motion) : ditto.
(gnumeric_sheet_slide_init) : ditto.
* src/item-bar.c (item_bar_draw) : ditto.
(item_bar_event) : ditto.
* src/item-cursor.c (item_cursor_update) : ditto.
(item_cursor_draw) : ditto.
* src/item-edit.c (recalc_spans) : ditto.
(item_edit_set_arg) : ditto.
* src/sheet-control-gui.c (scg_redraw_headers) : ditto.
(scg_resize) : ditto.
(scg_scrollbar_config) : ditto.
(scg_colrow_select) : ditto.
(gnumeric_sheet_update_inital_top_left) : ditto.
(bar_set_left_col) : ditto.
(bar_set_top_row) : ditto.
(gnumeric_sheet_set_left_col) : ditto.
(gnumeric_sheet_set_top_row) : ditto.
(gnumeric_sheet_set_top_left) : ditto.
(gnumeric_sheet_make_cell_visible) : ditto.
(scg_set_panes) : ditto.
(cb_slide_handler) : ditto.
* src/workbook-control-gui.c (cb_view_freeze_panes) : ditto.
2001-07-24 Jody Goldberg <jgoldberg@home.com>
* plugins/Makefile.am (SUBDIRS) : Add psion plugin from
......
This diff is collapsed.
#ifndef GNUMERIC_GNUMERIC_SHEET_H
#define GNUMERIC_GNUMERIC_SHEET_H
#ifndef GNUMERIC_GNUMERIC_CANVAS_H
#define GNUMERIC_GNUMERIC_CANVAS_H
#include "gui-gnumeric.h"
#define GNUMERIC_TYPE_SHEET (gnumeric_sheet_get_type ())
#define GNUMERIC_SHEET(obj) (GTK_CHECK_CAST((obj), GNUMERIC_TYPE_SHEET, GnumericSheet))
#define GNUMERIC_SHEET_CLASS(k) (GTK_CHECK_CLASS_CAST ((k), GNUMERIC_TYPE_SHEET))
#define GNUMERIC_IS_SHEET(o) (GTK_CHECK_TYPE((o), GNUMERIC_TYPE_SHEET))
#define GNUMERIC_TYPE_CANVAS (gnumeric_canvas_get_type ())
#define GNUMERIC_CANVAS(obj) (GTK_CHECK_CAST((obj), GNUMERIC_TYPE_CANVAS, GnumericCanvas))
#define GNUMERIC_CANVAS_CLASS(k) (GTK_CHECK_CLASS_CAST ((k), GNUMERIC_TYPE_CANVAS))
#define IS_GNUMERIC_CANVAS(o) (GTK_CHECK_TYPE((o), GNUMERIC_TYPE_CANVAS))
#define GNUMERIC_SHEET_FACTOR_X 1000000
#define GNUMERIC_SHEET_FACTOR_Y 2000000
#define GNUMERIC_CANVAS_FACTOR_X 1000000
#define GNUMERIC_CANVAS_FACTOR_Y 2000000
/* FIXME : standardize names (gnm_canvas_ ?) */
struct _GnumericSheet {
struct _GnumericCanvas {
GnomeCanvas canvas;
SheetControlGUI *scg;
......@@ -20,11 +19,6 @@ struct _GnumericSheet {
CellPos first, last_full, last_visible, first_offset;
ItemGrid *item_grid;
ItemEdit *item_editor;
ItemCursor *item_cursor;
ItemCursor *sel_cursor;
GnomeCanvasGroup *anted_group;
GnomeCanvasGroup *object_group;
......@@ -33,7 +27,7 @@ struct _GnumericSheet {
GdkICAttr *ic_attr;
/* Sliding scroll */
GnumericSheetSlideHandler slide_handler;
GnumericCanvasSlideHandler slide_handler;
gpointer slide_data;
int sliding; /* a gtk_timeout tag, -1 means not set */
int sliding_x, sliding_y;
......@@ -41,26 +35,20 @@ struct _GnumericSheet {
gboolean sliding_adjacent_h, sliding_adjacent_v;
};
GtkType gnumeric_sheet_get_type (void);
GnumericSheet *gnumeric_sheet_new (SheetControlGUI *scg, GnumericPane *pane);
int gnumeric_sheet_find_col (GnumericSheet *gsheet, int x, int *col_origin);
int gnumeric_sheet_find_row (GnumericSheet *gsheet, int y, int *row_origin);
GtkType gnumeric_canvas_get_type (void);
GnumericCanvas *gnumeric_canvas_new (SheetControlGUI *scg, GnumericPane *pane);
void gnumeric_sheet_set_bound (GnumericSheet *gsheet, Range const *bound);
void gnumeric_sheet_create_editor (GnumericSheet *gsheet);
void gnumeric_sheet_stop_editing (GnumericSheet *gsheet);
void gnumeric_sheet_cursor_bound (GnumericSheet *gsheet, Range const *r);
void gnumeric_sheet_rangesel_bound (GnumericSheet *gsheet, Range const *r);
void gnumeric_sheet_rangesel_start (GnumericSheet *gsheet, int col, int row);
void gnumeric_sheet_rangesel_stop (GnumericSheet *gsheet);
int gnm_canvas_find_col (GnumericCanvas *gsheet, int x, int *col_origin);
int gnm_canvas_find_row (GnumericCanvas *gsheet, int y, int *row_origin);
void gsheet_compute_visible_region (GnumericSheet *gsheet,
gboolean const full_recompute);
void gnm_canvas_compute_visible_region (GnumericCanvas *gsheet,
gboolean const full_recompute);
void gnm_canvas_redraw_region (GnumericCanvas *gsheet,
int start_col, int start_row,
int end_col, int end_row);
void gnumeric_sheet_redraw_region (GnumericSheet *gsheet,
int start_col, int start_row,
int end_col, int end_row);
void gnm_canvas_create_editor (GnumericCanvas *gsheet);
void gnm_canvas_stop_editing (GnumericCanvas *gsheet);
typedef enum {
GNM_SLIDE_X = 1,
......@@ -68,13 +56,13 @@ typedef enum {
GNM_SLIDE_EXTERIOR_ONLY = 4,
GNM_SLIDE_AT_COLROW_BOUND = 8, /* not implemented */
} GnumericSlideFlags;
void gnumeric_sheet_slide_stop (GnumericSheet *gsheet);
void gnumeric_sheet_slide_init (GnumericSheet *gsheet);
gboolean gnumeric_sheet_handle_motion (GnumericSheet *gsheet,
void gnm_canvas_slide_stop (GnumericCanvas *gsheet);
void gnm_canvas_slide_init (GnumericCanvas *gsheet);
gboolean gnm_canvas_handle_motion (GnumericCanvas *gsheet,
GnomeCanvas *canvas,
GdkEventMotion *event,
GnumericSlideFlags slide_flags,
GnumericSheetSlideHandler callback,
GnumericCanvasSlideHandler callback,
gpointer user_data);
#endif /* GNUMERIC_GNUMERIC_SHEET_H */
#endif /* GNUMERIC_GNUMERIC_CANVAS_H */
......@@ -10,7 +10,12 @@
#include <gnumeric-pane.h>
#include <gnumeric-sheet.h>
#include <item-bar.h>
#include <item-cursor.h>
#include <item-edit.h>
#include <item-grid.h>
#include <sheet-control-gui.h>
#include <workbook-control.h>
#include <sheet.h>
#include <ranges.h>
static void
......@@ -26,7 +31,7 @@ gnumeric_pane_header_init (GnumericPane *pane, gboolean is_col_header)
GnomeCanvasGroup *group = GNOME_CANVAS_GROUP (canvas->root);
GnomeCanvasItem *item = gnome_canvas_item_new (group,
item_bar_get_type (),
"ItemBar::GnumericSheet", pane->gsheet,
"ItemBar::GnumericCanvas", pane->gcanvas,
"ItemBar::IsColHeader", is_col_header,
NULL);
......@@ -47,10 +52,10 @@ gnumeric_pane_header_init (GnumericPane *pane, gboolean is_col_header)
*/
if (is_col_header)
gtk_layout_set_hadjustment (GTK_LAYOUT (canvas),
gtk_layout_get_hadjustment (GTK_LAYOUT (pane->gsheet)));
gtk_layout_get_hadjustment (GTK_LAYOUT (pane->gcanvas)));
else
gtk_layout_set_vadjustment (GTK_LAYOUT (canvas),
gtk_layout_get_vadjustment (GTK_LAYOUT (pane->gsheet)));
gtk_layout_get_vadjustment (GTK_LAYOUT (pane->gcanvas)));
#endif
gtk_signal_connect (GTK_OBJECT (canvas), "realize",
......@@ -58,12 +63,34 @@ gnumeric_pane_header_init (GnumericPane *pane, gboolean is_col_header)
}
void
gnumeric_pane_init (GnumericPane *pane, SheetControlGUI *scg,
gnm_pane_init (GnumericPane *pane, SheetControlGUI *scg,
gboolean headers, int index)
{
pane->gsheet = gnumeric_sheet_new (scg, pane);
GnomeCanvasItem *item;
GnomeCanvasGroup *gcanvas_group;
Range r;
pane->gcanvas = gnumeric_canvas_new (scg, pane);
pane->index = index;
gcanvas_group = GNOME_CANVAS_GROUP (GNOME_CANVAS (pane->gcanvas)->root);
item = gnome_canvas_item_new (gcanvas_group,
item_grid_get_type (),
"ItemGrid::SheetControlGUI", scg,
NULL);
pane->grid = ITEM_GRID (item);
item = gnome_canvas_item_new (gcanvas_group,
item_cursor_get_type (),
"ItemCursor::SheetControlGUI", scg,
NULL);
pane->cursor.std = ITEM_CURSOR (item);
gnm_pane_cursor_bound_set (pane, range_init (&r, 0, 0, 0, 0)); /* A1 */
pane->editor = NULL;
pane->cursor.rangesel = NULL;
pane->cursor.special = NULL;
if (headers) {
gnumeric_pane_header_init (pane, TRUE);
gnumeric_pane_header_init (pane, FALSE);
......@@ -72,11 +99,11 @@ gnumeric_pane_init (GnumericPane *pane, SheetControlGUI *scg,
}
void
gnumeric_pane_release (GnumericPane *pane)
gnm_pane_release (GnumericPane *pane)
{
g_return_if_fail (pane->gsheet != NULL);
gtk_object_destroy (GTK_OBJECT (pane->gsheet));
pane->gsheet = NULL;
g_return_if_fail (pane->gcanvas != NULL);
gtk_object_destroy (GTK_OBJECT (pane->gcanvas));
pane->gcanvas = NULL;
if (pane->col.canvas != NULL) {
gtk_object_destroy (GTK_OBJECT (pane->col.canvas));
......@@ -90,27 +117,27 @@ gnumeric_pane_release (GnumericPane *pane)
}
void
gnumeric_pane_set_bounds (GnumericPane *pane,
int start_col, int start_row,
int end_col, int end_row)
gnm_pane_bound_set (GnumericPane *pane,
int start_col, int start_row,
int end_col, int end_row)
{
Range r;
g_return_if_fail (pane != NULL);
g_return_if_fail (pane->gsheet != NULL);
g_return_if_fail (pane->gcanvas != NULL);
range_init (&r, start_col, start_row, end_col, end_row);
gnome_canvas_item_set (GNOME_CANVAS_ITEM (pane->gsheet->item_grid),
gnome_canvas_item_set (GNOME_CANVAS_ITEM (pane->grid),
"ItemGrid::Bound", &r,
NULL);
}
void
gnumeric_pane_colrow_resize_start (GnumericPane *pane,
gboolean is_cols, int resize_pos)
gnm_pane_colrow_resize_start (GnumericPane *pane,
gboolean is_cols, int resize_pos)
{
SheetControlGUI const *scg;
GnumericSheet const *gsheet;
GnumericCanvas const *gcanvas;
GnomeCanvasPoints *points;
GnomeCanvasItem *item;
double zoom;
......@@ -120,9 +147,9 @@ gnumeric_pane_colrow_resize_start (GnumericPane *pane,
g_return_if_fail (pane->colrow_resize.start == NULL);
g_return_if_fail (pane->colrow_resize.points == NULL);
gsheet = pane->gsheet;
scg = gsheet->scg;
zoom = GNOME_CANVAS (gsheet)->pixels_per_unit;
gcanvas = pane->gcanvas;
scg = gcanvas->scg;
zoom = GNOME_CANVAS (gcanvas)->pixels_per_unit;
points = pane->colrow_resize.points = gnome_canvas_points_new (2);
if (is_cols) {
......@@ -130,23 +157,23 @@ gnumeric_pane_colrow_resize_start (GnumericPane *pane,
0, resize_pos) / zoom;
points->coords [0] = x;
points->coords [1] = scg_colrow_distance_get (scg, FALSE,
0, gsheet->first.row) / zoom;
0, gcanvas->first.row) / zoom;
points->coords [2] = x;
points->coords [3] = scg_colrow_distance_get (scg, FALSE,
0, gsheet->last_visible.row+1) / zoom;
0, gcanvas->last_visible.row+1) / zoom;
} else {
double const y = scg_colrow_distance_get (scg, FALSE,
0, resize_pos) / zoom;
points->coords [0] = scg_colrow_distance_get (scg, TRUE,
0, gsheet->first.col) / zoom;
0, gcanvas->first.col) / zoom;
points->coords [1] = y;
points->coords [2] = scg_colrow_distance_get (scg, TRUE,
0, gsheet->last_visible.col+1) / zoom;
0, gcanvas->last_visible.col+1) / zoom;
points->coords [3] = y;
}
/* Position the stationary only. Guide line is handled elsewhere. */
item = gnome_canvas_item_new (pane->gsheet->object_group,
item = gnome_canvas_item_new (pane->gcanvas->object_group,
gnome_canvas_line_get_type (),
"points", points,
"fill_color", "black",
......@@ -154,7 +181,7 @@ gnumeric_pane_colrow_resize_start (GnumericPane *pane,
NULL);
pane->colrow_resize.start = GTK_OBJECT (item);
item = gnome_canvas_item_new (pane->gsheet->object_group,
item = gnome_canvas_item_new (pane->gcanvas->object_group,
gnome_canvas_line_get_type (),
"fill_color", "black",
"width_pixels", 1,
......@@ -163,7 +190,7 @@ gnumeric_pane_colrow_resize_start (GnumericPane *pane,
}
void
gnumeric_pane_colrow_resize_end (GnumericPane *pane)
gnm_pane_colrow_resize_end (GnumericPane *pane)
{
g_return_if_fail (pane != NULL);
......@@ -182,8 +209,8 @@ gnumeric_pane_colrow_resize_end (GnumericPane *pane)
}
void
gnumeric_pane_colrow_resize_move (GnumericPane *pane,
gboolean is_cols, int resize_pos)
gnm_pane_colrow_resize_move (GnumericPane *pane,
gboolean is_cols, int resize_pos)
{
GnomeCanvasItem *resize_guide;
GnomeCanvasPoints *points;
......@@ -193,7 +220,7 @@ gnumeric_pane_colrow_resize_move (GnumericPane *pane,
resize_guide = GNOME_CANVAS_ITEM (pane->colrow_resize.guide);
points = pane->colrow_resize.points;
zoom = GNOME_CANVAS (pane->gsheet)->pixels_per_unit;
zoom = GNOME_CANVAS (pane->gcanvas)->pixels_per_unit;
if (is_cols)
points->coords [0] = points->coords [2] = resize_pos / zoom;
......@@ -204,3 +231,155 @@ gnumeric_pane_colrow_resize_move (GnumericPane *pane,
"points", points,
NULL);
}
/****************************************************************************/
void
gnm_pane_reposition_cursors (GnumericPane *pane)
{
GList *l;
item_cursor_reposition (pane->cursor.std);
if (NULL != pane->cursor.rangesel)
item_cursor_reposition (pane->cursor.rangesel);
if (NULL != pane->cursor.special)
item_cursor_reposition (pane->cursor.special);
for (l = pane->anted_cursors; l; l = l->next)
item_cursor_reposition (ITEM_CURSOR (l->data));
}
gboolean
gnm_pane_cursor_bound_set (GnumericPane *pane, Range const *r)
{
return item_cursor_bound_set (pane->cursor.std, r);
}
/****************************************************************************/
gboolean
gnm_pane_rangesel_bound_set (GnumericPane *pane, Range const *r)
{
return item_cursor_bound_set (pane->cursor.special, r);
}
void
gnm_pane_rangesel_start (GnumericPane *pane, int col, int row)
{
GnomeCanvas *canvas = GNOME_CANVAS (pane->gcanvas);
GnomeCanvasItem *tmp;
GnomeCanvasGroup *group = GNOME_CANVAS_GROUP (canvas->root);
SheetControl *sc = (SheetControl *) pane->gcanvas->scg;
Range r;
g_return_if_fail (pane->cursor.rangesel == NULL);
/* Hide the primary cursor while the range selection cursor is visible
* and we are selecting on a different sheet than the expr being edited
*/
if (sc_sheet (sc) != wb_control_cur_sheet (sc_wbc(sc)))
item_cursor_set_visibility (pane->cursor.std, FALSE);
tmp = gnome_canvas_item_new (group,
item_cursor_get_type (),
"SheetControlGUI", pane->gcanvas->scg,
"Style", ITEM_CURSOR_ANTED, NULL);
pane->cursor.rangesel = ITEM_CURSOR (tmp);
item_cursor_bound_set (pane->cursor.rangesel,
range_init (&r, col, row, col, row));
/* If we are selecting a range on a different sheet this may be NULL */
if (pane->editor)
item_edit_disable_highlight (ITEM_EDIT (pane->editor));
}
void