Commit 72e75554 authored by Jody Goldberg's avatar Jody Goldberg

Make the justification toolbar buttons update the same way the

font buttons do.
parent 90388819
......@@ -4,9 +4,14 @@ and longer term bugs.
Release Critical
----------------
- Selection highlighting of spanning columns draws outside the lines.
- Selection highlighting of spanning columns draws columns outside the selection
range as if they were selected.
Long term breakage
------------------
- border style double_line does not respect the background colour of the cell
being painted. And does not handle intersection.
being painted.
- border style double_line does handle all of the different intersection cases.
- Borders above below cells spanning cols are lost.
2000-02-22 Jody Goldberg <jgoldberg@home.com>
* src/workbook-format-toolbar.c
(workbook_format_toolbutton_update) : new.
(workbook_format_halign_feedback_set) : new
(workbook_feedback_set) : Use the new functions.
(set_selection_halign) : ditto.
2000-02-25 Jukka-Pekka Iivonen <iivonen@iki.fi>
* src/mathfunc.[ch]: Implemented Branch-And-Bound algorithm for
......
2000-02-22 Jody Goldberg <jgoldberg@home.com>
* src/workbook-format-toolbar.c
(workbook_format_toolbutton_update) : new.
(workbook_format_halign_feedback_set) : new
(workbook_feedback_set) : Use the new functions.
(set_selection_halign) : ditto.
2000-02-25 Jukka-Pekka Iivonen <iivonen@iki.fi>
* src/mathfunc.[ch]: Implemented Branch-And-Bound algorithm for
......
2000-02-22 Jody Goldberg <jgoldberg@home.com>
* src/workbook-format-toolbar.c
(workbook_format_toolbutton_update) : new.
(workbook_format_halign_feedback_set) : new
(workbook_feedback_set) : Use the new functions.
(set_selection_halign) : ditto.
2000-02-25 Jukka-Pekka Iivonen <iivonen@iki.fi>
* src/mathfunc.[ch]: Implemented Branch-And-Bound algorithm for
......
2000-02-22 Jody Goldberg <jgoldberg@home.com>
* src/workbook-format-toolbar.c
(workbook_format_toolbutton_update) : new.
(workbook_format_halign_feedback_set) : new
(workbook_feedback_set) : Use the new functions.
(set_selection_halign) : ditto.
2000-02-25 Jukka-Pekka Iivonen <iivonen@iki.fi>
* src/mathfunc.[ch]: Implemented Branch-And-Bound algorithm for
......
2000-02-22 Jody Goldberg <jgoldberg@home.com>
* src/workbook-format-toolbar.c
(workbook_format_toolbutton_update) : new.
(workbook_format_halign_feedback_set) : new
(workbook_feedback_set) : Use the new functions.
(set_selection_halign) : ditto.
2000-02-25 Jukka-Pekka Iivonen <iivonen@iki.fi>
* src/mathfunc.[ch]: Implemented Branch-And-Bound algorithm for
......
2000-02-22 Jody Goldberg <jgoldberg@home.com>
* src/workbook-format-toolbar.c
(workbook_format_toolbutton_update) : new.
(workbook_format_halign_feedback_set) : new
(workbook_feedback_set) : Use the new functions.
(set_selection_halign) : ditto.
2000-02-25 Jukka-Pekka Iivonen <iivonen@iki.fi>
* src/mathfunc.[ch]: Implemented Branch-And-Bound algorithm for
......
2000-02-22 Jody Goldberg <jgoldberg@home.com>
* src/workbook-format-toolbar.c
(workbook_format_toolbutton_update) : new.
(workbook_format_halign_feedback_set) : new
(workbook_feedback_set) : Use the new functions.
(set_selection_halign) : ditto.
2000-02-25 Jukka-Pekka Iivonen <iivonen@iki.fi>
* src/mathfunc.[ch]: Implemented Branch-And-Bound algorithm for
......
......@@ -28,7 +28,8 @@ Description Difficulty Integration
- Add another selection type. Which would be used High High
to send formated cell contents between different
instances of gnumeric.
instances of gnumeric. modularize the xml format
to enable it to act as the transfer format.
Difficulty: an estimate of how hard the task would be for the average hacker.
(This is not an estimate of project size; a project can be very big, but
......
......@@ -1031,7 +1031,6 @@ sheet_start_editing_at_cursor (Sheet *sheet, gboolean blankp, gboolean cursorp)
void
sheet_update_controls (Sheet *sheet)
{
/* FIXME: hack for now, should be 'cursor cell' of selection */
MStyle *mstyle;
g_return_if_fail (sheet != NULL);
......
......@@ -38,6 +38,10 @@
static const char *money_format = "Default Money Format:$#,##0.00_);($#,##0.00)";
static const char *percent_format = "Default Percent Format:0.00%";
static void
workbook_format_halign_feedback_set (Workbook *wb,
StyleHAlignFlags h_align);
static void
set_selection_halign (Workbook *wb, StyleHAlignFlags align)
{
......@@ -49,6 +53,7 @@ set_selection_halign (Workbook *wb, StyleHAlignFlags align)
mstyle = mstyle_new ();
mstyle_set_align_h (mstyle, align);
workbook_format_halign_feedback_set (wb, align);
cmd_format (workbook_command_context_gui (wb),
sheet, mstyle, NULL);
......@@ -273,15 +278,12 @@ static GnomeUIInfo workbook_format_toolbar [] = {
GNOMEUIINFO_SEPARATOR,
GNOMEUIINFO_ITEM_STOCK (
N_("Left align"), N_("Left justifies the cell contents"),
left_align_cmd, GNOME_STOCK_PIXMAP_ALIGN_LEFT),
GNOMEUIINFO_ITEM_STOCK (
N_("Center"), N_("Centers the cell contents"),
center_cmd, GNOME_STOCK_PIXMAP_ALIGN_CENTER),
GNOMEUIINFO_ITEM_STOCK (
N_("Right align"), N_("Right justifies the cell contents"),
right_align_cmd, GNOME_STOCK_PIXMAP_ALIGN_RIGHT),
{ GNOME_APP_UI_TOGGLEITEM, N_("Left align"), N_("Left justifies the cell contents"),
&left_align_cmd, NULL, NULL, GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_PIXMAP_ALIGN_LEFT },
{ GNOME_APP_UI_TOGGLEITEM, N_("Center"), N_("Centers the cell contents"),
&center_cmd, NULL, NULL, GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_PIXMAP_ALIGN_CENTER },
{ GNOME_APP_UI_TOGGLEITEM, N_("Right align"), N_("Right justifies the cell contents"),
&right_align_cmd, NULL, NULL, GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_PIXMAP_ALIGN_RIGHT },
GNOMEUIINFO_SEPARATOR,
......@@ -600,13 +602,49 @@ workbook_create_format_toolbar (Workbook *wb)
return toolbar;
}
static void
workbook_format_toolbutton_update (Workbook * wb,
GnumericToolbar *toolbar,
int const button_index,
GtkSignalFunc func,
gboolean const flag)
{
GtkToggleButton *t = GTK_TOGGLE_BUTTON (
gnumeric_toolbar_get_widget (
toolbar,
button_index));
gtk_signal_handler_block_by_func (GTK_OBJECT (t), func, wb);
gtk_toggle_button_set_active (t, flag);
gtk_signal_handler_unblock_by_func (GTK_OBJECT (t), func, wb);
}
static void
workbook_format_halign_feedback_set (Workbook *workbook,
StyleHAlignFlags h_align)
{
GnumericToolbar *toolbar = GNUMERIC_TOOLBAR (workbook->priv->format_toolbar);
workbook_format_toolbutton_update (workbook, toolbar,
TOOLBAR_ALIGN_LEFT_BUTTON_INDEX,
(GtkSignalFunc)&left_align_cmd,
h_align == HALIGN_LEFT);
workbook_format_toolbutton_update (workbook, toolbar,
TOOLBAR_ALIGN_CENTER_BUTTON_INDEX,
(GtkSignalFunc)&center_cmd,
h_align == HALIGN_CENTER);
workbook_format_toolbutton_update (workbook, toolbar,
TOOLBAR_ALIGN_RIGHT_BUTTON_INDEX,
(GtkSignalFunc)&right_align_cmd,
h_align == HALIGN_RIGHT);
}
/*
* Updates the edit control state: bold, italic, font name and font size
*/
void
workbook_feedback_set (Workbook *workbook, MStyle *style)
{
GtkToggleButton *t;
GnumericToolbar *toolbar = GNUMERIC_TOOLBAR (workbook->priv->format_toolbar);
gboolean font_set;
char size_str [40];
......@@ -615,33 +653,23 @@ workbook_feedback_set (Workbook *workbook, MStyle *style)
g_return_if_fail (workbook != NULL);
g_return_if_fail (IS_WORKBOOK (workbook));
/* Handle font boldness */
g_return_if_fail (mstyle_is_element_set (style, MSTYLE_FONT_BOLD));
t = GTK_TOGGLE_BUTTON (
gnumeric_toolbar_get_widget (
toolbar,
TOOLBAR_BOLD_BUTTON_INDEX));
gtk_signal_handler_block_by_func (GTK_OBJECT (t),
(GtkSignalFunc)&bold_cmd,
workbook);
gtk_toggle_button_set_active (t, mstyle_get_font_bold (style));
gtk_signal_handler_unblock_by_func (GTK_OBJECT (t),
(GtkSignalFunc)&bold_cmd,
workbook);
workbook_format_toolbutton_update (workbook, toolbar,
TOOLBAR_BOLD_BUTTON_INDEX,
(GtkSignalFunc)&bold_cmd,
mstyle_get_font_bold (style));
/* Handle font italics */
g_return_if_fail (mstyle_is_element_set (style, MSTYLE_FONT_ITALIC));
t = GTK_TOGGLE_BUTTON (
gnumeric_toolbar_get_widget (
toolbar,
TOOLBAR_ITALIC_BUTTON_INDEX));
gtk_signal_handler_block_by_func (GTK_OBJECT (t),
(GtkSignalFunc)&italic_cmd,
workbook);
gtk_toggle_button_set_active (t, mstyle_get_font_italic (style));
gtk_signal_handler_unblock_by_func (GTK_OBJECT (t),
(GtkSignalFunc)&italic_cmd,
workbook);
workbook_format_toolbutton_update (workbook, toolbar,
TOOLBAR_ITALIC_BUTTON_INDEX,
(GtkSignalFunc)&italic_cmd,
mstyle_get_font_italic (style));
/* horizontal alignment */
g_return_if_fail (mstyle_is_element_set (style, MSTYLE_ALIGN_H));
workbook_format_halign_feedback_set (workbook, mstyle_get_align_h (style));
g_return_if_fail (mstyle_is_element_set (style, MSTYLE_FONT_SIZE));
sprintf (size_str, "%g", mstyle_get_font_size (style));
......
#ifndef GNUMERIC_WORKBOOK_FORMAT_TOOLBAR_H
#define GNUMERIC_WORKBOOK_FORMAT_TOOLBAR_H
#define TOOLBAR_BOLD_BUTTON_INDEX 2
#define TOOLBAR_ITALIC_BUTTON_INDEX 3
#define TOOLBAR_BOLD_BUTTON_INDEX 2
#define TOOLBAR_ITALIC_BUTTON_INDEX 3
#define TOOLBAR_ALIGN_LEFT_BUTTON_INDEX 4
#define TOOLBAR_ALIGN_CENTER_BUTTON_INDEX 5
#define TOOLBAR_ALIGN_RIGHT_BUTTON_INDEX 6
GtkWidget *workbook_create_format_toolbar (Workbook *wb);
......
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