static void ChangeComment(char **args) { if (args != 0) { new_quote(&leftcmt, count_of(args) > 0 ? args[0] : L_CMT); new_quote(&rightcmt, count_of(args) > 1 ? args[1] : R_CMT); } }
static void ChangeQuote(char **args) { if (args != 0) { new_quote(&leftquote, count_of(args) > 0 ? args[0] : L_QUOTE); new_quote(&rightquote, count_of(args) > 1 ? args[1] : R_QUOTE); } }
static gboolean key_pressed(GtkWidget *treeview, GdkEventKey *event, struct commodity_register *commodity_register) { /* Ctrl key pressed? (I do the test this way because I don't want to assume that any of these masks are single bits. They are called masks, after all, not bits. */ if ((event->state & GDK_CONTROL_MASK) == GDK_CONTROL_MASK) switch (event->keyval) { case GDK_KEY_n: new_quote(commodity_register); return TRUE; case GDK_KEY_a: display_calendar_for_selected_row(commodity_register); return TRUE; default: return FALSE; /* Indicate we didn't handle the event */ } else if ((event->state & (GDK_CONTROL_MASK | GDK_SHIFT_MASK)) == (GDK_CONTROL_MASK | GDK_SHIFT_MASK)) switch (event->keyval) { case GDK_KEY_D: delete_quote(commodity_register); return TRUE; default: return FALSE; /* Indicate we didn't handle the event */ } else /* We didn't handle the event */ return FALSE; }
static void new_quote_via_menu(GtkWidget *menuitem, struct commodity_register *commodity_register) { new_quote(commodity_register); }