Exemple #1
0
static void drawCDKButtonText (CDKBUTTON *button)
{
   int boxWidth = button->boxWidth;
   int i;

   /* Draw in the message. */

   for (i = 0; i < boxWidth - 2 * BorderOf (button); i++)
   {
      chtype c;
      int pos = button->infoPos;
      int len = button->infoLen;

      if (i >= pos && (i - pos) < len)
	 c = button->info[i - pos];
      else
	 c = ' ';

      if (HasFocusObj (button))
      {
	 c = A_REVERSE | CharOf (c);
      }

      mvwaddch (button->win, BorderOf (button), i + BorderOf (button), c);
   }
}
Exemple #2
0
static void setFocus (CDKOBJS *obj)
{
    if (obj != 0)
    {
        HasFocusObj (obj) = TRUE;
        FocusObj (obj);
    }
    curs_set (1);
}
Exemple #3
0
static void unsetFocus (CDKOBJS *obj)
{
    curs_set (0);
    if (obj != 0)
    {
        HasFocusObj (obj) = FALSE;
        UnfocusObj (obj);
    }
}
Exemple #4
0
static void drawCDKScrollCurrent (CDKSCROLL *s)
{
   /* Rehighlight the current menu item. */
   int screenPos = s->itemPos[s->currentItem] - s->leftChar;
   chtype highlight = HasFocusObj (s) ? s->highlight : A_NORMAL;

   writeChtypeAttrib (s->listWin,
		      (screenPos >= 0) ? screenPos : 0,
		      s->currentHigh,
		      s->item[s->currentItem],
		      highlight,
		      HORIZONTAL,
		      (screenPos >= 0) ? 0 : (1 - screenPos),
		      s->itemLen[s->currentItem]);
}