コード例 #1
0
ファイル: uscale.c プロジェクト: Chaduke/bah.mod
/*
 * This function draws the widget.
 */
static void _drawCDKUScale (CDKOBJS *object, boolean Box)
{
    CDKUSCALE *widget = (CDKUSCALE *)object;

    /* Draw the shadow. */
    if (widget->shadowWin != 0)
    {
        drawShadow (widget->shadowWin);
    }

    /* Box the widget if asked. */
    if (Box)
    {
        drawObjBox (widget->win, ObjOf(widget));
    }

    drawCdkTitle (widget->win, object);

    /* Draw the label. */
    if (widget->labelWin != 0)
    {
        writeChtype (widget->labelWin, 0, 0,
                     widget->label,
                     HORIZONTAL, 0,
                     widget->labelLen);
        wrefresh (widget->labelWin);
    }
    wrefresh (widget->win);

    /* Draw the field window. */
    drawCDKUScaleField (widget);
}
コード例 #2
0
ファイル: button.c プロジェクト: Chaduke/bah.mod
/*
 * This draws the button widget.
 */
static void _drawCDKButton (CDKOBJS *object, boolean Box GCC_UNUSED)
{
   CDKBUTTON *button = (CDKBUTTON *)object;

   /* Is there a shadow? */
   if (button->shadowWin != (WINDOW *)NULL)
   {
      drawShadow (button->shadowWin);
   }

   /* Box the widget if asked. */
   if (ObjOf (button)->box)
   {
      drawObjBox (button->win, ObjOf (button));
   }
   drawCDKButtonText (button);
   wrefresh (button->win);
}
コード例 #3
0
ファイル: marquee.c プロジェクト: iamjamestl/school
/*
 * This draws the marquee widget on the screen.
 */
static void _drawCDKMarquee (CDKOBJS *object, boolean Box)
{
   CDKMARQUEE *widget = (CDKMARQUEE *)object;

   /* Keep the box information. */
   ObjOf (widget)->box = Box;

   /* Do we need to draw a shadow??? */
   if (widget->shadowWin != 0)
   {
      drawShadow (widget->shadowWin);
   }

   /* Box it if needed. */
   if (Box)
   {
      drawObjBox (widget->win, ObjOf (widget));
   }

   /* Refresh the window. */
   wrefresh (widget->win);
}
コード例 #4
0
ファイル: scroll.c プロジェクト: Chaduke/bah.mod
/*
 * This redraws the scrolling list.
 */
static void drawCDKScrollList (CDKSCROLL *scrollp, boolean Box)
{
   int j;

   /* If the list is empty, don't draw anything. */
   if (scrollp->listSize > 0)
   {
      /* Redraw the list */
      for (j = 0; j < scrollp->viewSize; j++)
      {
	 int k = j + scrollp->currentTop;

	 writeBlanks (scrollp->listWin,
		      0, j,
		      HORIZONTAL, 0,
		      scrollp->boxWidth - 2 * BorderOf (scrollp));

	 /* Draw the elements in the scrolling list. */
	 if (k < scrollp->listSize)
	 {
	    int screenPos = SCREENPOS (scrollp, k);
	    int ypos = SCREEN_YPOS (scrollp, j);

	    /* Write in the correct line. */
	    writeChtype (scrollp->listWin,
			 (screenPos >= 0) ? screenPos : 1,
			 ypos,
			 scrollp->item[k],
			 HORIZONTAL,
			 (screenPos >= 0) ? 0 : (1 - screenPos),
			 scrollp->itemLen[k]);
	 }
      }

      drawCDKScrollCurrent (scrollp);

      /* Determine where the toggle is supposed to be. */
      if (scrollp->scrollbarWin != 0)
      {
	 scrollp->togglePos = floorCDK (scrollp->currentItem * (double)scrollp->step);

	 /* Make sure the toggle button doesn't go out of bounds. */

	 if (scrollp->togglePos >= getmaxy (scrollp->scrollbarWin))
	    scrollp->togglePos = getmaxy (scrollp->scrollbarWin) - 1;

	 /* Draw the scrollbar. */
	 mvwvline (scrollp->scrollbarWin,
		   0, 0,
		   ACS_CKBOARD,
		   getmaxy (scrollp->scrollbarWin));
	 mvwvline (scrollp->scrollbarWin,
		   scrollp->togglePos, 0,
		   ' ' | A_REVERSE,
		   scrollp->toggleSize);
      }
   }

   /* Box it if needed. */
   if (Box)
   {
      drawObjBox (scrollp->win, ObjOf (scrollp));
   }

   /* Refresh the window. */
   wrefresh (scrollp->win);
}