1
0
mirror of git://projects.qi-hardware.com/fped.git synced 2024-11-25 18:55:19 +02:00

gui_frame.c: display a question mark before variables used as key

This commit is contained in:
Werner Almesberger 2012-05-28 02:53:01 -03:00
parent 101bd11c98
commit 326a480b63

View File

@ -220,7 +220,6 @@ static GtkItemFactory *factory_single_var;
static GtkWidget *popup_single_var_widget; static GtkWidget *popup_single_var_widget;
static void add_row_here(struct table *table, struct row **anchor) static void add_row_here(struct table *table, struct row **anchor)
{ {
struct row *row; struct row *row;
@ -801,7 +800,7 @@ static void build_assignment(GtkWidget *vbox, struct frame *frame,
struct table *table) struct table *table)
{ {
GtkWidget *hbox, *field; GtkWidget *hbox, *field;
char *expr; char *name, *expr;
if (!table->vars || table->vars->next) if (!table->vars || table->vars->next)
return; return;
@ -811,8 +810,11 @@ static void build_assignment(GtkWidget *vbox, struct frame *frame,
hbox = gtk_hbox_new(FALSE, 0); hbox = gtk_hbox_new(FALSE, 0);
gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
field = label_in_box_new(table->vars->name, name = stralloc_printf("%s%s", table->vars->key ? "?" : "",
"Variable name. Click to edit."); table->vars->name);
field = label_in_box_new(name, "Variable name. Click to edit.");
free(name);
gtk_box_pack_start(GTK_BOX(hbox), box_of_label(field), FALSE, FALSE, 0); gtk_box_pack_start(GTK_BOX(hbox), box_of_label(field), FALSE, FALSE, 0);
label_in_box_bg(field, COLOR_VAR_PASSIVE); label_in_box_bg(field, COLOR_VAR_PASSIVE);
table->vars->widget = field; table->vars->widget = field;
@ -988,7 +990,7 @@ static void build_table(GtkWidget *vbox, struct frame *frame,
struct value *value; struct value *value;
int n_vars = 0, n_rows = 0; int n_vars = 0, n_rows = 0;
int n_var, n_row, pos; int n_var, n_row, pos;
char *expr; char *name, *expr;
GdkColor color; GdkColor color;
for (var = table->vars; var; var = var->next) for (var = table->vars; var; var = var->next)
@ -1022,8 +1024,11 @@ static void build_table(GtkWidget *vbox, struct frame *frame,
gtk_table_set_col_spacings(GTK_TABLE(tab), 1); gtk_table_set_col_spacings(GTK_TABLE(tab), 1);
} }
field = label_in_box_new(var->name, name = stralloc_printf("%s%s", var->key ? "?" : "", var->name);
field = label_in_box_new(name,
"Variable (column) name. Click to edit."); "Variable (column) name. Click to edit.");
free(name);
gtk_table_attach_defaults(GTK_TABLE(tab), box_of_label(field), gtk_table_attach_defaults(GTK_TABLE(tab), box_of_label(field),
n_vars, n_vars+1, 0, 1); n_vars, n_vars+1, 0, 1);
label_in_box_bg(field, COLOR_VAR_PASSIVE); label_in_box_bg(field, COLOR_VAR_PASSIVE);