diff options
author | Christopher James Lahey <clahey@helixcode.com> | 2000-02-12 07:53:07 +0800 |
---|---|---|
committer | Chris Lahey <clahey@src.gnome.org> | 2000-02-12 07:53:07 +0800 |
commit | 07d9ddab8e2b6759bbe1b2364371bf5c7b6fe6de (patch) | |
tree | 9aef6228256888d44b8466e1b98c24296147fa2c | |
parent | e8fbeb4881f1920446adc9a2e6a8cb0b914aa737 (diff) | |
download | gsoc2013-evolution-07d9ddab8e2b6759bbe1b2364371bf5c7b6fe6de.tar.gz gsoc2013-evolution-07d9ddab8e2b6759bbe1b2364371bf5c7b6fe6de.tar.zst gsoc2013-evolution-07d9ddab8e2b6759bbe1b2364371bf5c7b6fe6de.zip |
Add an editable argument to e_cell_text_new.
2000-02-11 Christopher James Lahey <clahey@helixcode.com>
* e-cell-text.h, e-cell-text.c: Add an editable argument to
e_cell_text_new.
* test-table.c, test-cols.c, test-check.c: Set the editable
argument to e_cell_text_new.
svn path=/trunk/; revision=1738
-rw-r--r-- | widgets/e-table/ChangeLog | 8 | ||||
-rw-r--r-- | widgets/e-table/e-cell-text.c | 11 | ||||
-rw-r--r-- | widgets/e-table/e-cell-text.h | 2 | ||||
-rw-r--r-- | widgets/e-table/test-check.c | 2 | ||||
-rw-r--r-- | widgets/e-table/test-cols.c | 2 | ||||
-rw-r--r-- | widgets/e-table/test-table.c | 4 | ||||
-rw-r--r-- | widgets/table/e-cell-text.c | 11 | ||||
-rw-r--r-- | widgets/table/e-cell-text.h | 2 | ||||
-rw-r--r-- | widgets/table/test-check.c | 2 | ||||
-rw-r--r-- | widgets/table/test-cols.c | 2 | ||||
-rw-r--r-- | widgets/table/test-table.c | 4 |
11 files changed, 32 insertions, 18 deletions
diff --git a/widgets/e-table/ChangeLog b/widgets/e-table/ChangeLog index 7e7e0b118a..76b2d2ceea 100644 --- a/widgets/e-table/ChangeLog +++ b/widgets/e-table/ChangeLog @@ -1,5 +1,13 @@ 2000-02-11 Christopher James Lahey <clahey@helixcode.com> + * e-cell-text.h, e-cell-text.c: Add an editable argument to + e_cell_text_new. + + * test-table.c, test-cols.c, test-check.c: Set the editable + argument to e_cell_text_new. + +2000-02-11 Christopher James Lahey <clahey@helixcode.com> + * e-table-header-item.h, e-table-header-item.c: Added reordering of columns. diff --git a/widgets/e-table/e-cell-text.c b/widgets/e-table/e-cell-text.c index f0a8d082cb..8131d16384 100644 --- a/widgets/e-table/e-cell-text.c +++ b/widgets/e-table/e-cell-text.c @@ -752,7 +752,7 @@ ect_event (ECellView *ecell_view, GdkEvent *event, int model_col, int view_col, return TRUE; } - if (!edit_display) { + if ((!edit_display) && ect->editable) { e_table_item_enter_edit (text_view->cell_view.e_table_item_view, view_col, row); ect_edit_select_all (text_view); edit = text_view->edit; @@ -776,7 +776,10 @@ ect_event (ECellView *ecell_view, GdkEvent *event, int model_col, int view_col, break; case GDK_BUTTON_PRESS: /* Fall Through */ case GDK_BUTTON_RELEASE: - if (!edit_display && event->type == GDK_BUTTON_RELEASE && event->button.button == 1) { + if ((!edit_display) + && ect->editable + && event->type == GDK_BUTTON_RELEASE + && event->button.button == 1) { GdkEventButton button = event->button; e_table_item_enter_edit (text_view->cell_view.e_table_item_view, view_col, row); @@ -1069,14 +1072,14 @@ e_cell_text_class_init (GtkObjectClass *object_class) E_MAKE_TYPE(e_cell_text, "ECellText", ECellText, e_cell_text_class_init, NULL, PARENT_TYPE); ECell * -e_cell_text_new (ETableModel *etm, const char *fontname, GtkJustification justify) +e_cell_text_new (ETableModel *etm, const char *fontname, GtkJustification justify, gboolean editable) { ECellText *ect = gtk_type_new (e_cell_text_get_type ()); ect->ellipsis = NULL; ect->use_ellipsis = TRUE; - ect->editable = TRUE; + ect->editable = editable; ect->font_name = g_strdup (fontname); ect->justify = justify; diff --git a/widgets/e-table/e-cell-text.h b/widgets/e-table/e-cell-text.h index 379ccf30a8..80afdf46ac 100644 --- a/widgets/e-table/e-cell-text.h +++ b/widgets/e-table/e-cell-text.h @@ -56,7 +56,7 @@ typedef struct { } ECellTextClass; GtkType e_cell_text_get_type (void); -ECell *e_cell_text_new (ETableModel *model, const char *fontname, GtkJustification justify); +ECell *e_cell_text_new (ETableModel *model, const char *fontname, GtkJustification justify, gboolean editable); #endif /* _E_CELL_TEXT_H_ */ diff --git a/widgets/e-table/test-check.c b/widgets/e-table/test-check.c index 8cc5f6834e..61fe161ca1 100644 --- a/widgets/e-table/test-check.c +++ b/widgets/e-table/test-check.c @@ -105,7 +105,7 @@ check_test (void) */ e_table_header = e_table_header_new (); - cell_left_just = e_cell_text_new (e_table_model, NULL, GTK_JUSTIFY_LEFT); + cell_left_just = e_cell_text_new (e_table_model, NULL, GTK_JUSTIFY_LEFT, TRUE); cell_image_check = e_cell_checkbox_new (); col_0 = e_table_col_new (0, "", 18, 18, cell_image_check, g_int_equal, TRUE); diff --git a/widgets/e-table/test-cols.c b/widgets/e-table/test-cols.c index 288e2bd408..3fe17ae555 100644 --- a/widgets/e-table/test-cols.c +++ b/widgets/e-table/test-cols.c @@ -105,7 +105,7 @@ multi_cols_test (void) */ e_table_header = e_table_header_new (); - cell_left_just = e_cell_text_new (e_table_model, NULL, GTK_JUSTIFY_LEFT); + cell_left_just = e_cell_text_new (e_table_model, NULL, GTK_JUSTIFY_LEFT, TRUE); { GdkPixbuf **images = g_new (GdkPixbuf *, 3); diff --git a/widgets/e-table/test-table.c b/widgets/e-table/test-table.c index 428bb52c52..27e1ac59f1 100644 --- a/widgets/e-table/test-table.c +++ b/widgets/e-table/test-table.c @@ -202,7 +202,7 @@ table_browser_test (void) * Header */ e_table_header = e_table_header_new (); - cell_left_just = e_cell_text_new (e_table_model, NULL, GTK_JUSTIFY_LEFT); + cell_left_just = e_cell_text_new (e_table_model, NULL, GTK_JUSTIFY_LEFT, TRUE); for (i = 0; i < cols; i++){ ETableCol *ecol = e_table_col_new ( @@ -269,7 +269,7 @@ do_e_table_demo (const char *col_spec, const char *group_spec) set_value_at, is_cell_editable, NULL); full_header = e_table_header_new (); - cell_left_just = e_cell_text_new (e_table_model, NULL, GTK_JUSTIFY_LEFT); + cell_left_just = e_cell_text_new (e_table_model, NULL, GTK_JUSTIFY_LEFT, TRUE); for (i = 0; i < cols; i++){ ETableCol *ecol = e_table_col_new ( diff --git a/widgets/table/e-cell-text.c b/widgets/table/e-cell-text.c index f0a8d082cb..8131d16384 100644 --- a/widgets/table/e-cell-text.c +++ b/widgets/table/e-cell-text.c @@ -752,7 +752,7 @@ ect_event (ECellView *ecell_view, GdkEvent *event, int model_col, int view_col, return TRUE; } - if (!edit_display) { + if ((!edit_display) && ect->editable) { e_table_item_enter_edit (text_view->cell_view.e_table_item_view, view_col, row); ect_edit_select_all (text_view); edit = text_view->edit; @@ -776,7 +776,10 @@ ect_event (ECellView *ecell_view, GdkEvent *event, int model_col, int view_col, break; case GDK_BUTTON_PRESS: /* Fall Through */ case GDK_BUTTON_RELEASE: - if (!edit_display && event->type == GDK_BUTTON_RELEASE && event->button.button == 1) { + if ((!edit_display) + && ect->editable + && event->type == GDK_BUTTON_RELEASE + && event->button.button == 1) { GdkEventButton button = event->button; e_table_item_enter_edit (text_view->cell_view.e_table_item_view, view_col, row); @@ -1069,14 +1072,14 @@ e_cell_text_class_init (GtkObjectClass *object_class) E_MAKE_TYPE(e_cell_text, "ECellText", ECellText, e_cell_text_class_init, NULL, PARENT_TYPE); ECell * -e_cell_text_new (ETableModel *etm, const char *fontname, GtkJustification justify) +e_cell_text_new (ETableModel *etm, const char *fontname, GtkJustification justify, gboolean editable) { ECellText *ect = gtk_type_new (e_cell_text_get_type ()); ect->ellipsis = NULL; ect->use_ellipsis = TRUE; - ect->editable = TRUE; + ect->editable = editable; ect->font_name = g_strdup (fontname); ect->justify = justify; diff --git a/widgets/table/e-cell-text.h b/widgets/table/e-cell-text.h index 379ccf30a8..80afdf46ac 100644 --- a/widgets/table/e-cell-text.h +++ b/widgets/table/e-cell-text.h @@ -56,7 +56,7 @@ typedef struct { } ECellTextClass; GtkType e_cell_text_get_type (void); -ECell *e_cell_text_new (ETableModel *model, const char *fontname, GtkJustification justify); +ECell *e_cell_text_new (ETableModel *model, const char *fontname, GtkJustification justify, gboolean editable); #endif /* _E_CELL_TEXT_H_ */ diff --git a/widgets/table/test-check.c b/widgets/table/test-check.c index 8cc5f6834e..61fe161ca1 100644 --- a/widgets/table/test-check.c +++ b/widgets/table/test-check.c @@ -105,7 +105,7 @@ check_test (void) */ e_table_header = e_table_header_new (); - cell_left_just = e_cell_text_new (e_table_model, NULL, GTK_JUSTIFY_LEFT); + cell_left_just = e_cell_text_new (e_table_model, NULL, GTK_JUSTIFY_LEFT, TRUE); cell_image_check = e_cell_checkbox_new (); col_0 = e_table_col_new (0, "", 18, 18, cell_image_check, g_int_equal, TRUE); diff --git a/widgets/table/test-cols.c b/widgets/table/test-cols.c index 288e2bd408..3fe17ae555 100644 --- a/widgets/table/test-cols.c +++ b/widgets/table/test-cols.c @@ -105,7 +105,7 @@ multi_cols_test (void) */ e_table_header = e_table_header_new (); - cell_left_just = e_cell_text_new (e_table_model, NULL, GTK_JUSTIFY_LEFT); + cell_left_just = e_cell_text_new (e_table_model, NULL, GTK_JUSTIFY_LEFT, TRUE); { GdkPixbuf **images = g_new (GdkPixbuf *, 3); diff --git a/widgets/table/test-table.c b/widgets/table/test-table.c index 428bb52c52..27e1ac59f1 100644 --- a/widgets/table/test-table.c +++ b/widgets/table/test-table.c @@ -202,7 +202,7 @@ table_browser_test (void) * Header */ e_table_header = e_table_header_new (); - cell_left_just = e_cell_text_new (e_table_model, NULL, GTK_JUSTIFY_LEFT); + cell_left_just = e_cell_text_new (e_table_model, NULL, GTK_JUSTIFY_LEFT, TRUE); for (i = 0; i < cols; i++){ ETableCol *ecol = e_table_col_new ( @@ -269,7 +269,7 @@ do_e_table_demo (const char *col_spec, const char *group_spec) set_value_at, is_cell_editable, NULL); full_header = e_table_header_new (); - cell_left_just = e_cell_text_new (e_table_model, NULL, GTK_JUSTIFY_LEFT); + cell_left_just = e_cell_text_new (e_table_model, NULL, GTK_JUSTIFY_LEFT, TRUE); for (i = 0; i < cols; i++){ ETableCol *ecol = e_table_col_new ( |