~ubuntu-branches/ubuntu/trusty/libcdk5/trusty

« back to all changes in this revision

Viewing changes to gen-scale.c

  • Committer: Bazaar Package Importer
  • Author(s): John Goerzen
  • Date: 2007-06-06 03:54:31 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20070606035431-ba4gdvw0h6ybffsu
Tags: 5.0.20060507-1
* New upstream release.
* Fixed header patching.  Patch from Robert Schiele.
  Closes: #402978, #416336.
* Update widget count in description.  Closes: #294709.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
 
3
3
/*
4
4
 * $Author: tom $
5
 
 * $Date: 2004/08/31 22:18:03 $
6
 
 * $Revision: 1.14 $
 
5
 * $Date: 2006/05/05 00:27:44 $
 
6
 * $Revision: 1.19 $
7
7
 */
8
8
 
9
9
/*
175
175
   for (x = 0; x < (int) SIZEOF(bindings); ++x)
176
176
      bindCDKObject (v<UPPER>, widget, bindings[x].from, getcCDKBind, (void *)(long)bindings[x].to);
177
177
 
178
 
   /* Register this baby. */
179
178
   registerCDKObject (cdkscreen, v<UPPER>, widget);
180
179
 
181
 
   /* Return the pointer. */
182
180
   return (widget);
183
181
}
184
182
 
192
190
   /* Draw the widget. */
193
191
   drawCDK<MIXED> (widget, ObjOf(widget)->box);
194
192
 
195
 
   /* Check if actions is null. */
196
193
   if (actions == 0)
197
194
   {
198
195
      chtype input = 0;
 
196
      boolean functionKey;
 
197
 
199
198
      for (;;)
200
199
      {
201
 
         /* Get the input. */
202
 
         input = getcCDKObject (ObjOf(widget));
 
200
         input = getchCDKObject (ObjOf(widget), &functionKey);
203
201
 
204
202
         /* Inject the character into the widget. */
205
203
         ret = injectCDK<MIXED> (widget, input);
381
379
   return result;
382
380
}
383
381
 
 
382
#define Decrement(value,by) if (value - by < value) value -= by
 
383
#define Increment(value,by) if (value + by > value) value += by
 
384
 
384
385
/*
385
386
 * This function injects a single character into the widget.
386
387
 */
426
427
                 break;
427
428
 
428
429
            case KEY_DOWN :
429
 
                 widget->current -= widget->inc;
 
430
                 Decrement(widget->current, widget->inc);
430
431
                 break;
431
432
 
432
433
            case KEY_UP :
433
 
                 widget->current += widget->inc;
 
434
                 Increment(widget->current, widget->inc);
434
435
                 break;
435
436
 
436
437
            case KEY_PPAGE :
437
 
                 widget->current += widget->fastinc;
 
438
                 Increment(widget->current, widget->fastinc);
438
439
                 break;
439
440
 
440
441
            case KEY_NPAGE :
441
 
                 widget->current -= widget->fastinc;
 
442
                 Decrement(widget->current, widget->fastinc);
442
443
                 break;
443
444
 
444
445
            case KEY_HOME :
590
591
                   widget->labelLen);
591
592
      wrefresh (widget->labelWin);
592
593
   }
593
 
   refreshCDKWindow (widget->win);
 
594
   wrefresh (widget->win);
594
595
 
595
596
   /* Draw the field window. */
596
597
   drawCDK<MIXED>Field (widget);
627
628
                    (int)strlen(temp));
628
629
 
629
630
   moveToEditPosition(widget, widget->fieldEdit);
630
 
   refreshCDKWindow (widget->fieldWin);
 
631
   wrefresh (widget->fieldWin);
631
632
}
632
633
 
633
634
/*
666
667
      deleteCursesWindow (widget->shadowWin);
667
668
      deleteCursesWindow (widget->win);
668
669
 
 
670
      /* Clean the key bindings. */
 
671
      cleanCDKObjectBindings (v<UPPER>, widget);
 
672
 
669
673
      /* Unregister this object. */
670
674
      unregisterCDKObject (v<UPPER>, widget);
671
675
   }