예제 #1
0
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);
    }
}
예제 #2
0
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);
    }
}
예제 #3
0
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;
}
예제 #4
0
static void new_quote_via_menu(GtkWidget *menuitem, struct commodity_register *commodity_register) {
    new_quote(commodity_register);
}