TouchScreenMenu::TouchScreenMenu(TouchScreenMenuItem items[]){
    _controller = &TSC;
    setSpacing(5);
    setPadding(2);
    setFontSize(2);
    setTitleFontSize(2);
    setJustification(LEFTJ);
    setItems(items);
    setTitle(NULL);
    setTitleColors(0xffff, 0x001f);
    setClearScreenOnDraw(false);
}
TouchScreenMenu::TouchScreenMenu(TouchScreenMenuItem items[], unsigned int fontSize, unsigned int spacing, unsigned int padding, Justify justify){
    _controller = &TSC;
    setSpacing(spacing);
    setPadding(padding);
    setFontSize(fontSize);
    setTitleFontSize(2);
    setJustification(justify);
    setItems(items);
    setTitle(NULL);
    setTitleColors(0xffff, 0x001f);
    setClearScreenOnDraw(false);
}
Ejemplo n.º 3
0
int dispDrawPortal (PORTAL *p)
{
    if (p->type != PORTAL_TEXT)
    {
        setError (EDISP_INVAL, "Invalid portal type in dispDrawPortal");
        return -1;
    }

    if (p->scroll == 1)
        return scrollPortal (p);

    GLYPH g[p->content.text.size];

    //
    // Cycle through the letters in the text to be displayed. We have
    // to resolve justification before rendering the portal. Collect
    // all the glyphs, add up their widths, and move the start points
    // to the appropriate column.
    //

    for (int i = 0; i < p->content.text.size; ++i)
    {
        // get the next letter to render
        char letter = p->content.text.data[i];

        // get the glyph for that letter
        if (fntGetGlyph (p->content.text.font, &g[i], letter) != 0)
        {
            setError (EDISP_FONTERR, "Error getting glyph in dispDrawPortal");
            return -1;
        }
    }

    setJustification (p, g, sizeof g / sizeof g[0]);

    //
    // Draw the portal
    //

    int col = p->startCol;
    int maxCol = p->startCol + p->width;
    for (int i = 0; i < p->content.text.size; ++i)
        drawGlyph (&g[i], &col, p, maxCol);

    //dumpPortal (p);
    return 0;
}
void KstViewLabel::setHorizJustifyWrap(int justify) {
  Q_UINT8 justifySet;

  switch (justify) {
    case 0:
      justifySet = KST_JUSTIFY_H_LEFT;
      break;
    case 1:
      justifySet = KST_JUSTIFY_H_RIGHT;
      break;
    case 2:
      justifySet = KST_JUSTIFY_H_CENTER;
      break;
    default:
      justifySet = KST_JUSTIFY_H_LEFT;
  }
  setJustification(SET_KST_JUSTIFY(justifySet, KST_JUSTIFY_V(justification())));
}
Ejemplo n.º 5
0
//==============================================================================
void DrawableText::refreshFromValueTree (const ValueTree& tree, ComponentBuilder&)
{
    ValueTreeWrapper v (tree);
    setComponentID (v.getID());

    const RelativeParallelogram newBounds (v.getBoundingBox());
    const RelativePoint newFontPoint (v.getFontSizeControlPoint());
    const Colour newColour (v.getColour());
    const Justification newJustification (v.getJustification());
    const String newText (v.getText());
    const Font newFont (v.getFont());

    if (text != newText || font != newFont || justification != newJustification
         || colour != newColour || bounds != newBounds || newFontPoint != fontSizeControlPoint)
    {
        setBoundingBox (newBounds);
        setFontSizeControlPoint (newFontPoint);
        setColour (newColour);
        setFont (newFont, false);
        setJustification (newJustification);
        setText (newText);
    }
}