Commit 8a547b92 authored by Michael Meeks's avatar Michael Meeks

function wizard fixes.

parent 8a3c4843
1999-04-11 Michael Meeks <michael@imaginator.com>
* src/dialog-function-select.c (function_select_row):
Check event is valid before using it, remove redundant
total redraw.
(category_select_row): Fix.
(function_select_create): Removed redundant call to
duplicated (create_description): Removed.
* src/fn-lookup.c: Actualy change the lookup function
tokens to the correct values.
1998-04-09 Zbigniew Chyla <cyba@t19.ds.pwr.wroc.pl>
* src/workbook.c: Creating auto_expr menu every time it is popped
......
1999-04-11 Michael Meeks <michael@imaginator.com>
* src/dialog-function-select.c (function_select_row):
Check event is valid before using it, remove redundant
total redraw.
(category_select_row): Fix.
(function_select_create): Removed redundant call to
duplicated (create_description): Removed.
* src/fn-lookup.c: Actualy change the lookup function
tokens to the correct values.
1998-04-09 Zbigniew Chyla <cyba@t19.ds.pwr.wroc.pl>
* src/workbook.c: Creating auto_expr menu every time it is popped
......
1999-04-11 Michael Meeks <michael@imaginator.com>
* src/dialog-function-select.c (function_select_row):
Check event is valid before using it, remove redundant
total redraw.
(category_select_row): Fix.
(function_select_create): Removed redundant call to
duplicated (create_description): Removed.
* src/fn-lookup.c: Actualy change the lookup function
tokens to the correct values.
1998-04-09 Zbigniew Chyla <cyba@t19.ds.pwr.wroc.pl>
* src/workbook.c: Creating auto_expr menu every time it is popped
......
1999-04-11 Michael Meeks <michael@imaginator.com>
* src/dialog-function-select.c (function_select_row):
Check event is valid before using it, remove redundant
total redraw.
(category_select_row): Fix.
(function_select_create): Removed redundant call to
duplicated (create_description): Removed.
* src/fn-lookup.c: Actualy change the lookup function
tokens to the correct values.
1998-04-09 Zbigniew Chyla <cyba@t19.ds.pwr.wroc.pl>
* src/workbook.c: Creating auto_expr menu every time it is popped
......
......@@ -363,10 +363,10 @@ gnumeric_rows (struct FunctionDefinition *i, Value *argv [], char **error_string
FunctionDefinition lookup_functions [] = {
{ "column", "?", "ref", &help_column, gnumeric_column, NULL },
{ "columns", "A", "ref", &help_column, NULL, gnumeric_columns },
{ "hlookup", "?rf|b","val,range,col_idx,approx", &help_hlookup, NULL, gnumeric_hlookup },
{ "hlookup", "Arf|b","val,range,col_idx,approx", &help_hlookup, NULL, gnumeric_hlookup },
{ "row", "?", "ref", &help_row, gnumeric_row, NULL },
{ "rows", "A", "ref", &help_rows, NULL, gnumeric_rows },
{ "vlookup", "?rf|b","val,range,col_idx,approx", &help_vlookup, NULL, gnumeric_vlookup },
{ "vlookup", "Arf|b","val,range,col_idx,approx", &help_vlookup, NULL, gnumeric_vlookup },
{ NULL, NULL }
};
......
......@@ -29,56 +29,6 @@ typedef struct {
static void function_select_create (SelectorState *state);
static void
category_select_row (GtkCList *clist, gint row, gint col,
GdkEvent *event, SelectorState *state)
{
state->selected_cat = row;
/* printf ("Row %d selected\n", row); */
gtk_container_remove (GTK_CONTAINER(state->dialog_box),
state->widget);
state->selected_func = 0;
function_select_create (state);
/* gtk_clist_select_row (state->cl_cats, row, 0); */
gtk_widget_show_all (GTK_WIDGET(state->dialog_box));
}
static GtkWidget *
create_description (FunctionDefinition *fd)
{
GtkBox *vbox;
TokenizedHelp *tok;
tok = tokenized_help_new (fd);
vbox = GTK_BOX (gtk_vbox_new (0, 0));
/* Syntax label */
{
GtkLabel *label =
GTK_LABEL(gtk_label_new (tokenized_help_find (tok, "SYNTAX")));
gtk_box_pack_start (vbox, GTK_WIDGET(label),
TRUE, TRUE, 0);
}
/* Description */
{
GtkText *text;
char *txt = tokenized_help_find (tok, "DESCRIPTION");
text = GTK_TEXT (gtk_text_new (NULL, NULL));
gtk_text_set_word_wrap (text, TRUE);
gtk_text_set_editable (text, FALSE);
gtk_text_insert (text, NULL, NULL, NULL,
txt, strlen(txt));
gtk_box_pack_start (vbox, GTK_WIDGET(text),
TRUE, TRUE, 0);
}
tokenized_help_destroy (tok);
return GTK_WIDGET (vbox);
}
static void
function_categories_fill (SelectorState *selector_state)
{
......@@ -134,16 +84,23 @@ static void
function_select_row (GtkCList *clist, gint row, gint col,
GdkEvent *event, SelectorState *selector_state)
{
if (event->type == GDK_2BUTTON_PRESS){
if (event && event->type == GDK_2BUTTON_PRESS){
gtk_signal_emit_by_name (GTK_OBJECT (selector_state->dlg),
"clicked", 0);
}
selector_state->selected_func = row;
gtk_widget_show_all (GTK_WIDGET (selector_state->dialog_box));
function_definition_update (selector_state);;
}
static void
category_select_row (GtkCList *clist, gint row, gint col,
GdkEvent *event, SelectorState *state)
{
state->selected_cat = row;
state->selected_func = 0;
function_definition_update (state);
gtk_widget_show_all (GTK_WIDGET(state->dialog_box));
}
#define USIZE_WIDTH 100
#define USIZE_HEIGHT 150
......@@ -200,38 +157,12 @@ function_select_create (SelectorState *selector_state)
}
gtk_box_pack_start (GTK_BOX(vbox), box, TRUE, TRUE, 0);
#if 0
{
GtkWidget *description;
if (fd && fd->help){
description = create_description (fd);
gtk_box_pack_start (GTK_BOX(vbox), description,
TRUE, TRUE, 0);
}
}
#endif
selector_state->widget = vbox;
gtk_box_pack_start (selector_state->dialog_box, vbox,
FALSE, FALSE, 0);
gtk_widget_show_all (GTK_WIDGET(selector_state->dialog_box));
/* FIXME: Something to keep currently selected function in scope
needs to be done.
hadj = gtk_scrolled_window_get_hadjustment (GTK_SCROLLED_WINDOW (scroll));
gtk_adjustment_set_value (hadj, ((float)SelectorState->selected_func));
gtk_scrolled_window_set_hadjustment (GTK_SCROLLED_WINDOW (scroll),
hadj);
max=SelectorState->cats->len;
hadj = gtk_scrolled_window_get_hadjustment (GTK_SCROLLED_WINDOW (scroll));
gtk_adjustment_set_value (hadj, ((float)SelectorState->selected_cat));
gtk_scrolled_window_set_hadjustment (GTK_SCROLLED_WINDOW (scroll),
hadj); */
}
/**
......
......@@ -29,56 +29,6 @@ typedef struct {
static void function_select_create (SelectorState *state);
static void
category_select_row (GtkCList *clist, gint row, gint col,
GdkEvent *event, SelectorState *state)
{
state->selected_cat = row;
/* printf ("Row %d selected\n", row); */
gtk_container_remove (GTK_CONTAINER(state->dialog_box),
state->widget);
state->selected_func = 0;
function_select_create (state);
/* gtk_clist_select_row (state->cl_cats, row, 0); */
gtk_widget_show_all (GTK_WIDGET(state->dialog_box));
}
static GtkWidget *
create_description (FunctionDefinition *fd)
{
GtkBox *vbox;
TokenizedHelp *tok;
tok = tokenized_help_new (fd);
vbox = GTK_BOX (gtk_vbox_new (0, 0));
/* Syntax label */
{
GtkLabel *label =
GTK_LABEL(gtk_label_new (tokenized_help_find (tok, "SYNTAX")));
gtk_box_pack_start (vbox, GTK_WIDGET(label),
TRUE, TRUE, 0);
}
/* Description */
{
GtkText *text;
char *txt = tokenized_help_find (tok, "DESCRIPTION");
text = GTK_TEXT (gtk_text_new (NULL, NULL));
gtk_text_set_word_wrap (text, TRUE);
gtk_text_set_editable (text, FALSE);
gtk_text_insert (text, NULL, NULL, NULL,
txt, strlen(txt));
gtk_box_pack_start (vbox, GTK_WIDGET(text),
TRUE, TRUE, 0);
}
tokenized_help_destroy (tok);
return GTK_WIDGET (vbox);
}
static void
function_categories_fill (SelectorState *selector_state)
{
......@@ -134,16 +84,23 @@ static void
function_select_row (GtkCList *clist, gint row, gint col,
GdkEvent *event, SelectorState *selector_state)
{
if (event->type == GDK_2BUTTON_PRESS){
if (event && event->type == GDK_2BUTTON_PRESS){
gtk_signal_emit_by_name (GTK_OBJECT (selector_state->dlg),
"clicked", 0);
}
selector_state->selected_func = row;
gtk_widget_show_all (GTK_WIDGET (selector_state->dialog_box));
function_definition_update (selector_state);;
}
static void
category_select_row (GtkCList *clist, gint row, gint col,
GdkEvent *event, SelectorState *state)
{
state->selected_cat = row;
state->selected_func = 0;
function_definition_update (state);
gtk_widget_show_all (GTK_WIDGET(state->dialog_box));
}
#define USIZE_WIDTH 100
#define USIZE_HEIGHT 150
......@@ -200,38 +157,12 @@ function_select_create (SelectorState *selector_state)
}
gtk_box_pack_start (GTK_BOX(vbox), box, TRUE, TRUE, 0);
#if 0
{
GtkWidget *description;
if (fd && fd->help){
description = create_description (fd);
gtk_box_pack_start (GTK_BOX(vbox), description,
TRUE, TRUE, 0);
}
}
#endif
selector_state->widget = vbox;
gtk_box_pack_start (selector_state->dialog_box, vbox,
FALSE, FALSE, 0);
gtk_widget_show_all (GTK_WIDGET(selector_state->dialog_box));
/* FIXME: Something to keep currently selected function in scope
needs to be done.
hadj = gtk_scrolled_window_get_hadjustment (GTK_SCROLLED_WINDOW (scroll));
gtk_adjustment_set_value (hadj, ((float)SelectorState->selected_func));
gtk_scrolled_window_set_hadjustment (GTK_SCROLLED_WINDOW (scroll),
hadj);
max=SelectorState->cats->len;
hadj = gtk_scrolled_window_get_hadjustment (GTK_SCROLLED_WINDOW (scroll));
gtk_adjustment_set_value (hadj, ((float)SelectorState->selected_cat));
gtk_scrolled_window_set_hadjustment (GTK_SCROLLED_WINDOW (scroll),
hadj); */
}
/**
......
......@@ -363,10 +363,10 @@ gnumeric_rows (struct FunctionDefinition *i, Value *argv [], char **error_string
FunctionDefinition lookup_functions [] = {
{ "column", "?", "ref", &help_column, gnumeric_column, NULL },
{ "columns", "A", "ref", &help_column, NULL, gnumeric_columns },
{ "hlookup", "?rf|b","val,range,col_idx,approx", &help_hlookup, NULL, gnumeric_hlookup },
{ "hlookup", "Arf|b","val,range,col_idx,approx", &help_hlookup, NULL, gnumeric_hlookup },
{ "row", "?", "ref", &help_row, gnumeric_row, NULL },
{ "rows", "A", "ref", &help_rows, NULL, gnumeric_rows },
{ "vlookup", "?rf|b","val,range,col_idx,approx", &help_vlookup, NULL, gnumeric_vlookup },
{ "vlookup", "Arf|b","val,range,col_idx,approx", &help_vlookup, NULL, gnumeric_vlookup },
{ NULL, NULL }
};
......
......@@ -363,10 +363,10 @@ gnumeric_rows (struct FunctionDefinition *i, Value *argv [], char **error_string
FunctionDefinition lookup_functions [] = {
{ "column", "?", "ref", &help_column, gnumeric_column, NULL },
{ "columns", "A", "ref", &help_column, NULL, gnumeric_columns },
{ "hlookup", "?rf|b","val,range,col_idx,approx", &help_hlookup, NULL, gnumeric_hlookup },
{ "hlookup", "Arf|b","val,range,col_idx,approx", &help_hlookup, NULL, gnumeric_hlookup },
{ "row", "?", "ref", &help_row, gnumeric_row, NULL },
{ "rows", "A", "ref", &help_rows, NULL, gnumeric_rows },
{ "vlookup", "?rf|b","val,range,col_idx,approx", &help_vlookup, NULL, gnumeric_vlookup },
{ "vlookup", "Arf|b","val,range,col_idx,approx", &help_vlookup, NULL, gnumeric_vlookup },
{ NULL, NULL }
};
......
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