Beispiel #1
0
/*
 * This moves the scale field to the given location.
 */
static void _moveCDKFScale (CDKOBJS *object, int xplace, int yplace, boolean relative, boolean refresh_flag)
{
   CDKFSCALE *scale = (CDKFSCALE *)object;
   /* Declare local variables. */
   int currentX = getbegx(scale->win);
   int currentY = getbegy(scale->win);
   int xpos	= xplace;
   int ypos	= yplace;
   int xdiff	= 0;
   int ydiff	= 0;

   /*
    * If this is a relative move, then we will adjust where we want
    * to move to.
    */
   if (relative)
   {
      xpos = getbegx(scale->win) + xplace;
      ypos = getbegy(scale->win) + yplace;
   }

   /* Adjust the window if we need to. */
   alignxy (WindowOf(scale), &xpos, &ypos, scale->boxWidth, scale->boxHeight);

   /* Get the difference. */
   xdiff = currentX - xpos;
   ydiff = currentY - ypos;

   /* Move the window to the new location. */
   moveCursesWindow(scale->win, -xdiff, -ydiff);
   if (scale->labelWin != 0)
   {
      moveCursesWindow(scale->labelWin, -xdiff, -ydiff);
   }
   moveCursesWindow(scale->fieldWin, -xdiff, -ydiff);

   /* If there is a shadow box we have to move it too. */
   if (scale->shadowWin != 0)
   {
      moveCursesWindow(scale->shadowWin, -xdiff, -ydiff);
   }

   /* Touch the windows so they 'move'. */
   touchwin (WindowOf(scale));
   wrefresh (WindowOf(scale));

   /* Redraw the window, if they asked for it. */
   if (refresh_flag)
   {
      drawCDKFScale (scale, ObjOf(scale)->box);
   }
}
Beispiel #2
0
/*
 * This moves the alphalist field to the given location.
 */
static void _moveCDKAlphalist (CDKOBJS *object, int xplace, int yplace, boolean relative, boolean refresh_flag)
{
   CDKALPHALIST *alphalist = (CDKALPHALIST *)object;

   /* Declare local variables. */
   int currentX = getbegx(alphalist->win);
   int currentY = getbegy(alphalist->win);
   int xpos	= xplace;
   int ypos	= yplace;
   int xdiff	= 0;
   int ydiff	= 0;

   /*
    * If this is a relative move, then we will adjust where we want
    * to move to.
    */
   if (relative)
   {
      xpos = getbegx(alphalist->win) + xplace;
      ypos = getbegy(alphalist->win) + yplace;
   }

   /* Adjust the window if we need to. */
   alignxy (WindowOf(alphalist), &xpos, &ypos, alphalist->boxWidth, alphalist->boxHeight);

   /* Get the difference. */
   xdiff = currentX - xpos;
   ydiff = currentY - ypos;

   /* Move the window to the new location. */
   moveCursesWindow(alphalist->win, -xdiff, -ydiff);

   /* If there is a shadow box we have to move it too. */
   if (alphalist->shadowWin != 0)
   {
      moveCursesWindow(alphalist->shadowWin, -xdiff, -ydiff);
   }

   /* Move the sub-widgets. */
   moveCDKEntry (alphalist->entryField, xplace, yplace, relative, FALSE);
   moveCDKScroll (alphalist->scrollField, xplace, yplace, relative, FALSE);

   /* Touch the windows so they 'move'. */
   touchwin (WindowOf(alphalist));
   wrefresh (WindowOf(alphalist));

   /* Redraw the window, if they asked for it. */
   if (refresh_flag)
   {
      drawCDKAlphalist (alphalist, ObjOf(alphalist)->box);
   }
}
Beispiel #3
0
/*
 * This moves the scroll field to the given location.
 */
static void _moveCDKScroll (CDKOBJS *object,
			    int xplace,
			    int yplace,
			    boolean relative,
			    boolean refresh_flag)
{
   /* *INDENT-EQLS* */
   CDKSCROLL *scrollp = (CDKSCROLL *)object;
   int currentX       = getbegx (scrollp->win);
   int currentY       = getbegy (scrollp->win);
   int xpos           = xplace;
   int ypos           = yplace;
   int xdiff          = 0;
   int ydiff          = 0;

   /*
    * If this is a relative move, then we will adjust where we want
    * to move to.
    */
   if (relative)
   {
      xpos = getbegx (scrollp->win) + xplace;
      ypos = getbegy (scrollp->win) + yplace;
   }

   /* Adjust the window if we need to. */
   alignxy (WindowOf (scrollp), &xpos, &ypos, scrollp->boxWidth, scrollp->boxHeight);

   /* Get the difference. */
   xdiff = currentX - xpos;
   ydiff = currentY - ypos;

   /* Move the window to the new location. */
   moveCursesWindow (scrollp->win, -xdiff, -ydiff);
   moveCursesWindow (scrollp->listWin, -xdiff, -ydiff);
   moveCursesWindow (scrollp->shadowWin, -xdiff, -ydiff);
   moveCursesWindow (scrollp->scrollbarWin, -xdiff, -ydiff);

   /* Touch the windows so they 'move'. */
   refreshCDKWindow (WindowOf (scrollp));

   /* Redraw the window, if they asked for it. */
   if (refresh_flag)
   {
      drawCDKScroll (scrollp, ObjOf (scrollp)->box);
   }
}
Beispiel #4
0
/*
 * This moves the widget's data field to the given location.
 */
static void _moveCDKScale (CDKOBJS *object,
                           int xplace,
                           int yplace,
                           boolean relative,
                           boolean refresh_flag)
{
    CDKSCALE *widget = (CDKSCALE *) object;
    int currentX = getbegx (widget->win);
    int currentY = getbegy (widget->win);
    int xpos = xplace;
    int ypos = yplace;
    int xdiff = 0;
    int ydiff = 0;

    /*
     * If this is a relative move, then we will adjust where we want
     * to move to.
     */
    if (relative)
    {
        xpos = getbegx (widget->win) + xplace;
        ypos = getbegy (widget->win) + yplace;
    }

    /* Adjust the window if we need to. */
    alignxy (WindowOf (widget), &xpos, &ypos, widget->boxWidth, widget->boxHeight);

    /* Get the difference. */
    xdiff = currentX - xpos;
    ydiff = currentY - ypos;

    /* Move the window to the new location. */
    moveCursesWindow (widget->win, -xdiff, -ydiff);
    moveCursesWindow (widget->labelWin, -xdiff, -ydiff);
    moveCursesWindow (widget->fieldWin, -xdiff, -ydiff);
    moveCursesWindow (widget->shadowWin, -xdiff, -ydiff);

    /* Touch the windows so they 'move'. */
    refreshCDKWindow (WindowOf (widget));

    /* Redraw the window, if they asked for it. */
    if (refresh_flag)
    {
        drawCDKScale (widget, ObjOf (widget)->box);
    }
}