Commit 7fc73970 authored by Andreas J. Guelzow 's avatar Andreas J. Guelzow

fix interaction between tooltips and formula guru

2010-06-15  Andreas J. Guelzow <aguelzow@pyrshep.ca>

	* dialogs.h (dialog_formula_guru): change storage class of an arg
	* dialog-function-select.c (cb_dialog_function_select_ok_clicked):
	  change call of dialog_formula_guru
	* dialog-formula-guru.c (dialog_formula_guru_load_fd): remove
	  unneeded code
	(cb_dialog_formula_guru_destroy): reenable tips
	(dialog_formula_guru): change storage class of an arg and disable
	  tips

2010-06-15  Andreas J. Guelzow <aguelzow@pyrshep.ca>

	* gnumeric-expr-entry.h (gnm_expr_entry_enable_tips): new
	(gnm_expr_entry_disable_tips): new
	* gnumeric-expr-entry.c (gnm_expr_entry_enable_tips): new
	(gnm_expr_entry_disable_tips): new
	(_GnmExprEntry): new field
	(gee_check_tooltip): only create tooltips if enabled
	(gee_init): iitalize new fields
parent 230b222b
2010-06-15 Andreas J. Guelzow <aguelzow@pyrshep.ca>
* dialogs.h (dialog_formula_guru): change storage class of an arg
* dialog-function-select.c (cb_dialog_function_select_ok_clicked):
change call of dialog_formula_guru
* dialog-formula-guru.c (dialog_formula_guru_load_fd): remove
unneeded code
(cb_dialog_formula_guru_destroy): reenable tips
(dialog_formula_guru): change storage class of an arg and disable
tips
2010-06-10 Andreas J. Guelzow <aguelzow@pyrshep.ca>
* dialog-function-select.c
......
......@@ -370,15 +370,15 @@ dialog_formula_guru_adjust_varargs (GtkTreeIter *iter, FormulaGuruState *state)
static gint
dialog_formula_guru_load_fd (GtkTreePath *path, GnmFunc const *fd,
dialog_formula_guru_load_fd (GtkTreePath *path, GnmFunc *fd,
FormulaGuruState *state)
{
GtkTreeIter iter;
TokenizedHelp *help = tokenized_help_new (fd);
char const *f_syntax = tokenized_help_find (help, "SYNTAX");
gint min_arg, max_arg;
GtkTreePath *new_path;
gnm_func_load_if_stub (fd);
if (path == NULL) {
gtk_tree_store_clear (state->model);
gtk_tree_store_append (state->model, &iter, NULL);
......@@ -405,14 +405,12 @@ dialog_formula_guru_load_fd (GtkTreePath *path, GnmFunc const *fd,
function_def_count_args (fd, &min_arg, &max_arg);
gtk_tree_store_set (state->model, &iter,
FUN_ARG_ENTRY, f_syntax,
FUN_ARG_ENTRY, "",
IS_NON_FUN, FALSE,
FUNCTION, fd,
MIN_ARG, min_arg,
MAX_ARG, max_arg,
-1);
tokenized_help_destroy (help);
dialog_formula_guru_adjust_children (&iter, fd, state);
dialog_formula_guru_adjust_varargs (&iter, state);
......@@ -526,6 +524,7 @@ cb_dialog_formula_guru_destroy (FormulaGuruState *state)
g_object_unref (state->editable);
if (state->gui != NULL)
g_object_unref (G_OBJECT (state->gui));
gnm_expr_entry_enable_tips (wbcg_get_entry_logical (state->wbcg));
g_free (state);
}
......@@ -869,6 +868,7 @@ dialog_formula_guru_init (FormulaGuruState *state)
state->column = column;
gtk_tree_view_append_column (state->treeview, column);
gtk_tree_view_set_headers_visible (state->treeview, TRUE);
gtk_tree_view_set_enable_tree_lines (state->treeview, TRUE);
gtk_container_add (GTK_CONTAINER (scrolled), GTK_WIDGET (state->treeview));
g_signal_connect (state->treeview,
......@@ -942,7 +942,7 @@ dialog_formula_guru_show (FormulaGuruState *state)
* Pop up a function selector then a formula guru.
*/
void
dialog_formula_guru (WBCGtk *wbcg, GnmFunc const *fd)
dialog_formula_guru (WBCGtk *wbcg, GnmFunc *fd)
{
SheetView *sv;
GladeXML *gui;
......@@ -995,6 +995,8 @@ dialog_formula_guru (WBCGtk *wbcg, GnmFunc const *fd)
state->active_path = NULL;
state->pos = g_new (GnmParsePos, 1);
gnm_expr_entry_disable_tips (wbcg_get_entry_logical (wbcg));
sv = wb_control_cur_sheet_view (WORKBOOK_CONTROL (wbcg));
cell = sheet_cell_get (sv_sheet (sv), sv->edit_pos.col, sv->edit_pos.row);
if (cell != NULL) {
......
......@@ -342,7 +342,7 @@ cb_dialog_function_select_ok_clicked (G_GNUC_UNUSED GtkWidget *button,
{
GtkTreeIter iter;
GtkTreeModel *model;
GnmFunc const *func;
GnmFunc *func;
GtkTreeSelection *the_selection = gtk_tree_view_get_selection (state->treeview);
if (state->formula_guru_key != NULL &&
......
......@@ -18,7 +18,7 @@ typedef enum {
FD_LAST = FD_INPUT_MSG
} FormatDialogPosition_t;
void dialog_formula_guru (WBCGtk *wbcg, GnmFunc const *func);
void dialog_formula_guru (WBCGtk *wbcg, GnmFunc *func);
void dialog_plugin_manager (WBCGtk *wbcg);
void dialog_goto_cell (WBCGtk *wbcg);
void dialog_cell_format (WBCGtk *wbcg,
......
2010-06-15 Andreas J. Guelzow <aguelzow@pyrshep.ca>
* gnumeric-expr-entry.h (gnm_expr_entry_enable_tips): new
(gnm_expr_entry_disable_tips): new
* gnumeric-expr-entry.c (gnm_expr_entry_enable_tips): new
(gnm_expr_entry_disable_tips): new
(_GnmExprEntry): new field
(gee_check_tooltip): only create tooltips if enabled
(gee_init): iitalize new fields
2010-06-14 Andreas J. Guelzow <aguelzow@pyrshep.ca>
* gnumeric-expr-entry.c (cb_gee_configure_event): delete
......
......@@ -76,6 +76,7 @@ struct _GnmExprEntry {
GnmFunc *fd;
gint args;
guint handlerid;
gboolean enabled;
} tooltip;
GOFormat const *constant_format;
......@@ -726,6 +727,9 @@ gee_check_tooltip (GnmExprEntry *gee)
gchar sep = go_locale_get_arg_sep ();
gint para = 0;
if (!gee->tooltip.enabled)
return;
end = gtk_editable_get_position (editable);
if (end == 0) {
......@@ -1031,6 +1035,7 @@ gee_init (GnmExprEntry *gee)
gee->tooltip.tooltip = NULL;
gee->tooltip.fd = NULL;
gee->tooltip.handlerid = 0;
gee->tooltip.enabled = TRUE;
gee_rangesel_reset (gee);
gee->entry = GTK_ENTRY (gtk_entry_new ());
......@@ -2205,3 +2210,20 @@ gnm_expr_entry_enable_highlight (GnmExprEntry *gee)
gee->feedback_disabled = FALSE;
}
/*****************************************************************************/
void
gnm_expr_entry_disable_tips (GnmExprEntry *gee)
{
g_return_if_fail (gee != NULL);
gee_delete_tooltip (gee);
gee->tooltip.enabled = FALSE;
}
void
gnm_expr_entry_enable_tips (GnmExprEntry *gee)
{
g_return_if_fail (gee != NULL);
gee->tooltip.enabled = TRUE;
}
......@@ -77,6 +77,8 @@ void gnm_expr_entry_disable_highlight (GnmExprEntry *gee);
void gnm_expr_entry_enable_highlight (GnmExprEntry *gee);
void gnm_expr_entry_close_tips (GnmExprEntry *gee);
void gnm_expr_entry_enable_tips (GnmExprEntry *gee);
void gnm_expr_entry_disable_tips (GnmExprEntry *gee);
/* Cell Renderer Specific Method */
......
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