Commit 48d484dd authored by Jody Goldberg's avatar Jody Goldberg Committed by Jody Goldberg

Store the SheetObject and SheetView as object_data.


2000-11-10  Jody Goldberg <jgoldberg@home.com>

	* src/sheet-object.c (sheet_object_new_view) : Store the SheetObject
	  and SheetView as object_data.
	(cb_sheet_object_configure) : Pass the SheetView to configuration
	  routines.
	(sheet_object_populate_menu) : Pass the CanvasItem it has the useful
	  property of having the associated view and sheet object as user data.
	  This makes it handy for use in callbacks.
	(display_object_menu) : signature change.
	(control_point_handle_event) : changes to display_menu_object.
	(sheet_object_canvas_event) : Ditto.

	* src/sheet-object-widget.c (sheet_widget_checkbox_user_config) :
	  signature change.  This should get things working again.

	* src/sheet-object-bonobo.c (sheet_object_bonobo_populate_menu) :
	  signature change.
parent ab7e7fd8
......@@ -5,17 +5,14 @@ and longer term bugs.
Release Critical
----------------
- SheetObjects are broken (tentative patch from almer)
- po build is broken (flog kanikus)
- bisection bug (jpr)
- Look into ability to identify versions of gnumeric xml that are newer than we
are. As DV about name spaces.
Long term breakage
------------------
- We need a better error message when the file format is not understood.
This happens when old gnumerics read new files, so getting this fix
out there will take some time.
- Entering "=1e11111" yields "Syntax Error", not "overflow".
- Why does the number matching bother comparing against formats that are
......
2000-11-10 Jody Goldberg <jgoldberg@home.com>
* src/sheet-object.c (sheet_object_new_view) : Store the SheetObject
and SheetView as object_data.
(cb_sheet_object_configure) : Pass the SheetView to configuration
routines.
(sheet_object_populate_menu) : Pass the CanvasItem it has the useful
property of having the associated view and sheet object as user data.
This makes it handy for use in callbacks.
(display_object_menu) : signature change.
(control_point_handle_event) : changes to display_menu_object.
(sheet_object_canvas_event) : Ditto.
* src/sheet-object-widget.c (sheet_widget_checkbox_user_config) :
signature change. This should get things working again.
* src/sheet-object-bonobo.c (sheet_object_bonobo_populate_menu) :
signature change.
2000-11-10 Jody Goldberg <jgoldberg@home.com>
Patch from Juan Pablo Mendoza <pablo_juan@yahoo.com>
......
2000-11-10 Jody Goldberg <jgoldberg@home.com>
* src/sheet-object.c (sheet_object_new_view) : Store the SheetObject
and SheetView as object_data.
(cb_sheet_object_configure) : Pass the SheetView to configuration
routines.
(sheet_object_populate_menu) : Pass the CanvasItem it has the useful
property of having the associated view and sheet object as user data.
This makes it handy for use in callbacks.
(display_object_menu) : signature change.
(control_point_handle_event) : changes to display_menu_object.
(sheet_object_canvas_event) : Ditto.
* src/sheet-object-widget.c (sheet_widget_checkbox_user_config) :
signature change. This should get things working again.
* src/sheet-object-bonobo.c (sheet_object_bonobo_populate_menu) :
signature change.
2000-11-10 Jody Goldberg <jgoldberg@home.com>
Patch from Juan Pablo Mendoza <pablo_juan@yahoo.com>
......
2000-11-10 Jody Goldberg <jgoldberg@home.com>
* src/sheet-object.c (sheet_object_new_view) : Store the SheetObject
and SheetView as object_data.
(cb_sheet_object_configure) : Pass the SheetView to configuration
routines.
(sheet_object_populate_menu) : Pass the CanvasItem it has the useful
property of having the associated view and sheet object as user data.
This makes it handy for use in callbacks.
(display_object_menu) : signature change.
(control_point_handle_event) : changes to display_menu_object.
(sheet_object_canvas_event) : Ditto.
* src/sheet-object-widget.c (sheet_widget_checkbox_user_config) :
signature change. This should get things working again.
* src/sheet-object-bonobo.c (sheet_object_bonobo_populate_menu) :
signature change.
2000-11-10 Jody Goldberg <jgoldberg@home.com>
Patch from Juan Pablo Mendoza <pablo_juan@yahoo.com>
......
2000-11-10 Jody Goldberg <jgoldberg@home.com>
* src/sheet-object.c (sheet_object_new_view) : Store the SheetObject
and SheetView as object_data.
(cb_sheet_object_configure) : Pass the SheetView to configuration
routines.
(sheet_object_populate_menu) : Pass the CanvasItem it has the useful
property of having the associated view and sheet object as user data.
This makes it handy for use in callbacks.
(display_object_menu) : signature change.
(control_point_handle_event) : changes to display_menu_object.
(sheet_object_canvas_event) : Ditto.
* src/sheet-object-widget.c (sheet_widget_checkbox_user_config) :
signature change. This should get things working again.
* src/sheet-object-bonobo.c (sheet_object_bonobo_populate_menu) :
signature change.
2000-11-10 Jody Goldberg <jgoldberg@home.com>
Patch from Juan Pablo Mendoza <pablo_juan@yahoo.com>
......
2000-11-10 Jody Goldberg <jgoldberg@home.com>
* src/sheet-object.c (sheet_object_new_view) : Store the SheetObject
and SheetView as object_data.
(cb_sheet_object_configure) : Pass the SheetView to configuration
routines.
(sheet_object_populate_menu) : Pass the CanvasItem it has the useful
property of having the associated view and sheet object as user data.
This makes it handy for use in callbacks.
(display_object_menu) : signature change.
(control_point_handle_event) : changes to display_menu_object.
(sheet_object_canvas_event) : Ditto.
* src/sheet-object-widget.c (sheet_widget_checkbox_user_config) :
signature change. This should get things working again.
* src/sheet-object-bonobo.c (sheet_object_bonobo_populate_menu) :
signature change.
2000-11-10 Jody Goldberg <jgoldberg@home.com>
Patch from Juan Pablo Mendoza <pablo_juan@yahoo.com>
......
......@@ -236,6 +236,7 @@ open_cb (GtkMenuItem *item, SheetObjectBonobo *sheet_object)
static void
sheet_object_bonobo_populate_menu (SheetObject *sheet_object,
GnomeCanvasItem *obj_view,
GtkMenu *menu)
{
GtkWidget *item = gtk_menu_item_new_with_label (_("Open"));
......@@ -246,7 +247,8 @@ sheet_object_bonobo_populate_menu (SheetObject *sheet_object,
gtk_menu_append (menu, item);
if (sheet_object_bonobo_parent_class->populate_menu)
sheet_object_bonobo_parent_class->populate_menu (sheet_object, menu);
sheet_object_bonobo_parent_class->
populate_menu (sheet_object, obj_view, menu);
}
static void
......
......@@ -123,7 +123,7 @@ sheet_object_widget_new_view (SheetObject *so, SheetView *sheet_view)
}
/*
* This implemenationt moves the widget rather than
* This implemenation moves the widget rather than
* destroying/updating/creating the views
*/
static void
......@@ -532,7 +532,7 @@ cb_checkbox_config_clicked (GnomeDialog *dialog, gint button_number,
}
static void
sheet_widget_checkbox_user_config (SheetObject *so)
sheet_widget_checkbox_user_config (SheetObject *so, SheetView *sheet_view)
{
CheckboxConfigState *state;
SheetWidgetCheckbox *swc = SHEET_WIDGET_CHECKBOX (so);
......@@ -541,7 +541,7 @@ sheet_widget_checkbox_user_config (SheetObject *so)
state = g_new (CheckboxConfigState, 1);
state->swc = swc;
state->wbcg = /* FIXME */ NULL;
state->wbcg = sheet_view->wbcg;
state->dialog = gnome_dialog_new (_("Checkbox Configure"),
GNOME_STOCK_BUTTON_OK,
GNOME_STOCK_BUTTON_CANCEL,
......
......@@ -29,11 +29,14 @@
static GtkObjectClass *sheet_object_parent_class;
static void sheet_object_stop_editing (SheetObject *so);
static void sheet_object_populate_menu (SheetObject *so, GtkMenu *menu);
static int control_point_handle_event (GnomeCanvasItem *item,
GdkEvent *event, SheetObject *so);
static void update_bbox (SheetObject *so);
static void sheet_object_stop_editing (SheetObject *so);
static void sheet_object_populate_menu (SheetObject *so,
GnomeCanvasItem *obj_view,
GtkMenu *menu);
static int control_point_handle_event (GnomeCanvasItem *item,
GdkEvent *event,
SheetObject *so);
static void update_bbox (SheetObject *so);
static void
sheet_object_destroy (GtkObject *object)
......@@ -207,6 +210,12 @@ sheet_object_new_view (SheetObject *so, SheetView *sheet_view)
return NULL;
}
/* Store some useful information */
gtk_object_set_data (GTK_OBJECT (item),
SHEET_OBJ_VIEW_OBJECT_KEY, so);
gtk_object_set_data (GTK_OBJECT (item),
SHEET_OBJ_VIEW_SHEET_VIEW_KEY, sheet_view);
gtk_signal_connect (GTK_OBJECT (item), "event",
GTK_SIGNAL_FUNC (sheet_object_canvas_event), so);
gtk_signal_connect (GTK_OBJECT (item), "destroy",
......@@ -739,11 +748,19 @@ sheet_object_remove_cb (GtkWidget *widget, SheetObject *so)
}
static void
cb_sheet_object_configure (GtkWidget *widget, SheetObject *so)
cb_sheet_object_configure (GtkWidget *widget, GnomeCanvasItem *obj_view)
{
g_return_if_fail (so != NULL);
SheetView *sheet_view;
SheetObject *so;
g_return_if_fail (obj_view != NULL);
so = gtk_object_get_data (GTK_OBJECT (obj_view),
SHEET_OBJ_VIEW_OBJECT_KEY);
sheet_view = gtk_object_get_data (GTK_OBJECT (obj_view),
SHEET_OBJ_VIEW_SHEET_VIEW_KEY);
SO_CLASS(so)->user_config (so);
SO_CLASS(so)->user_config (so, sheet_view);
}
/**
......@@ -754,7 +771,9 @@ cb_sheet_object_configure (GtkWidget *widget, SheetObject *so)
* Add standard items to the object's popup menu.
**/
static void
sheet_object_populate_menu (SheetObject *so, GtkMenu *menu)
sheet_object_populate_menu (SheetObject *so,
GnomeCanvasItem *obj_view,
GtkMenu *menu)
{
GtkWidget *item = gnome_stock_menu_item (GNOME_STOCK_MENU_CLOSE,
_("Delete"));
......@@ -767,7 +786,7 @@ sheet_object_populate_menu (SheetObject *so, GtkMenu *menu)
item = gnome_stock_menu_item (GNOME_STOCK_MENU_PROP,
_("Configure"));
gtk_signal_connect (GTK_OBJECT (item), "activate",
GTK_SIGNAL_FUNC (cb_sheet_object_configure), so);
GTK_SIGNAL_FUNC (cb_sheet_object_configure), obj_view);
gtk_menu_append (menu, item);
}
}
......@@ -778,13 +797,14 @@ menu_unrealize_cb (GtkMenu *menu, SheetObject *so)
}
static void
display_object_menu (SheetObject *so, GdkEvent *event)
display_object_menu (SheetObject *so, GnomeCanvasItem *item,
GdkEvent *event)
{
GtkMenu *menu;
sheet_mode_edit_object (so);
menu = GTK_MENU (gtk_menu_new ());
SO_CLASS (so)->populate_menu (so, menu);
SO_CLASS (so)->populate_menu (so, item, menu);
gtk_signal_connect (GTK_OBJECT (menu), "unrealize",
GTK_SIGNAL_FUNC (menu_unrealize_cb), so);
......@@ -835,7 +855,7 @@ control_point_handle_event (GnomeCanvasItem *item, GdkEvent *event,
break;
case 3:
display_object_menu (so, event);
display_object_menu (so, item, event);
break;
default:
......@@ -960,7 +980,7 @@ sheet_object_canvas_event (GnomeCanvasItem *item, GdkEvent *event,
event_total_y = 0;
break;
case 3:
display_object_menu (so, event);
display_object_menu (so, item, event);
break;
default:
......
......@@ -51,15 +51,20 @@ typedef struct {
/* Virtual methods */
GnomeCanvasItem *(*new_view) (SheetObject *sheet_object,
SheetView *sheet_view);
void (*update_bounds) (SheetObject *sheet_object);
SheetView *s_view);
void (*populate_menu) (SheetObject *sheet_object,
GnomeCanvasItem *obj_view,
GtkMenu *menu);
void (*user_config) (SheetObject *sheet_object,
SheetView *s_view);
void (*update_bounds) (SheetObject *sheet_object);
void (*print) (SheetObject *so, SheetObjectPrintInfo *pi);
void (*user_config) (SheetObject *);
void (*set_active) (SheetObject *so, gboolean val);
} SheetObjectClass;
#define SHEET_OBJ_VIEW_SHEET_VIEW_KEY "SheetView"
#define SHEET_OBJ_VIEW_OBJECT_KEY "SheetObject"
GtkType sheet_object_get_type (void);
void sheet_object_construct (SheetObject *sheet_object, Sheet *sheet);
int sheet_object_canvas_event (GnomeCanvasItem *item, GdkEvent *event,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment