~ubuntu-branches/ubuntu/maverick/gcalctool/maverick

« back to all changes in this revision

Viewing changes to src/gtk.c

  • Committer: Bazaar Package Importer
  • Author(s): Robert Ancell
  • Date: 2009-12-22 10:06:16 UTC
  • mfrom: (1.1.63 upstream)
  • Revision ID: james.westby@ubuntu.com-20091222100616-5ir8k6orw75omhdi
Tags: 5.29.4-0ubuntu1
* New upstream release:
  * Make 0^0 = 1
  * Use superscript digits for scientific notation
  * Clear display when entering a number after an equation
  * Make Ctrl+W a shortcut to quit
  * Updated translations

Show diffs side-by-side

added added

removed removed

Lines of Context:
375
375
    GtkTextIter start, end;
376
376
    gint cursor_start, cursor_end;
377
377
 
 
378
    /* Disable super/subscript mode when finished entering */
 
379
    if (function == FN_CALCULATE ||
 
380
        function == FN_CLEAR ||
 
381
        (function == FN_TEXT && strstr("⁻⁰¹²³⁴⁵⁶⁷⁸⁹₀₁₂₃₄₅₆₇₈₉", (char *)arg) == NULL)) {
 
382
        gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(X.subscript_toggle), FALSE);
 
383
        gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(X.superscript_toggle), FALSE);
 
384
    }
 
385
 
378
386
    if(gtk_text_buffer_get_selection_bounds(X.display_buffer, &start, &end)) {
379
387
        cursor_start = gtk_text_iter_get_offset(&start);
380
388
        cursor_end = gtk_text_iter_get_offset(&end);
1176
1184
            do_text("µ");
1177
1185
            return TRUE;
1178
1186
        case GDK_e:
1179
 
            do_text("×10^");
 
1187
            do_text("×10");
 
1188
            gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(X.superscript_toggle), TRUE);
1180
1189
            return TRUE;
1181
1190
        case GDK_f:
1182
1191
            do_button(FN_FACTORIZE, NULL);
1196
1205
        gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(X.superscript_toggle))) {
1197
1206
        switch(event->keyval)
1198
1207
        {
 
1208
        case GDK_minus:
 
1209
            do_text("⁻");
 
1210
            return TRUE;
1199
1211
        case GDK_0:
1200
1212
            do_text("⁰");
1201
1213
            return TRUE;