示例#1
0
InsetCaption::InsetCaption(Buffer * buf, string const & type)
    : InsetText(buf, InsetText::PlainLayout), type_(type)
{
	setAutoBreakRows(true);
	setDrawFrame(true);
	setFrameColor(Color_collapsableframe);
}
示例#2
0
InsetCaption::InsetCaption(Buffer * buf, string const & type)
    : InsetText(buf, InsetText::PlainLayout),
      labelwidth_(0), is_subfloat_(false), type_(type)
{
	setDrawFrame(true);
	setFrameColor(Color_collapsibleframe);
}
示例#3
0
InsetPreview::InsetPreview(Buffer * buf) 
	: InsetText(buf),
	  preview_(new RenderPreview(this)), use_preview_(true)
{
	setDrawFrame(true);
	setFrameColor(Color_previewframe);
}
	GuiCustomTextLabel::GuiCustomTextLabel(const CRect& size, UTF8StringPtr txt, const CFontRef& font, const CHoriTxtAlign& textAlign, const CColor& backgroundColor, const CColor& frameColor)
	: CTextLabel(size, txt, 0, 0) {

		setBackColor(backgroundColor);
		setFrameColor(frameColor);
		setFont(font);
		setHoriAlign(textAlign);
	}
//-----------------------------------------------------------------------------
void GdiplusDrawContext::drawPoint (const CPoint &point, const CColor& color)
{
	saveGlobalState ();
	setLineWidth (1);
	setFrameColor (color);
	CPoint point2 (point);
	point2.x++;
	COffscreenContext::drawLine (point, point2);
	restoreGlobalState ();
}
示例#6
0
void CGFrame::setPropsFromPalette(CGPalette *palette)
{
    CGWidget::setPropsFromPalette(palette);
    if (palette) {
        setFrameWidth(palette->size(CGPalette::srFrameWidth));
        setFrameColor(palette->color(CGPalette::crFrame));
        setFocusedFrameWidth(palette->size(CGPalette::srFocusedFrameWidth));
        setFocusedFrameColor(palette->color(CGPalette::crFocusedFrame));
    }
}
示例#7
0
//-----------------------------------------------------------------------------
void D2DDrawContext::drawPoint (const CPoint &point, const CColor& color)
{
    saveGlobalState ();
    setLineWidth (1);
    setFrameColor (color);
    CPoint point2 (point);
    point2.h++;
    moveTo (point);
    lineTo (point2);
    restoreGlobalState ();
}
示例#8
0
  Header(const int& w, const std::string& title)
    : APanel(w, 3) //frame + label
    , _lHeader(new ALabel)

  {
    setFrameColor(TCODColor::darkYellow);

    _lHeader->setPosition(2,1);
    _lHeader->setValue(title);

    addWidget(_lHeader);
  }
示例#9
0
CGLabel::CGLabel(CGWidget *parent):
    CGFrame(parent), CGFontPropsWithAlignment(this)
{
    m_verticalAlignment=cgalLeft;
    m_horizontalAlignment=cgalTop;
    m_textOffset=1;
    setFrameWidth(0);
    setFrameColor(CGColor::ccTransparent);
    setBackgroundColor(CGColor::ccTransparent);
    setTextColor(CGColor::ccBlack);
    setPropsFromDefaultPalette();
}
示例#10
0
//-----------------------------------------------------------------------------
void CDrawContext::init ()
{
	// set the default values
	setFrameColor (kWhiteCColor);
	setLineStyle (kLineSolid);
	setLineWidth (1);
	setFillColor (kBlackCColor);
	setFontColor (kWhiteCColor);
	setFont (kSystemFont);
	setDrawMode (kAliasing);
	setClipRect (surfaceRect);
}
示例#11
0
//-----------------------------------------------------------------------------
void D2DDrawContext::setGlobalAlpha (float newAlpha)
{
    if (currentState.globalAlpha == newAlpha)
        return;
    COffscreenContext::setGlobalAlpha (newAlpha);
    CColor color (currentState.frameColor);
    currentState.frameColor = kTransparentCColor;
    setFrameColor (color);
    color = currentState.fillColor;
    currentState.fillColor = kTransparentCColor;
    setFillColor (color);
    color = currentState.fontColor;
    currentState.fontColor = kTransparentCColor;
    setFontColor (color);
}
示例#12
0
CGLabel::CGLabel(int x, int y, int width, int height, CGWidget *parent):
    CGFrame(x,y,width,height,parent), CGFontPropsWithAlignment(this)
{
    m_verticalAlignment=cgalLeft;
    m_horizontalAlignment=cgalTop;
    m_lineSpacing=1.2;
    m_bold=false;
    m_italic=false;
    m_fontFace="sans";
    m_fontSize=10;
    m_textOffset=1;
    setFrameWidth(0);
    setFrameColor(CGColor::ccTransparent);
    setBackgroundColor(CGColor::ccTransparent);
    setTextColor(CGColor::ccBlack);
    setPropsFromDefaultPalette();
}
示例#13
0
SelectBox::SelectBox( const CRect& rcSize, CControlListener* listener, long tag ) :
    CControl (rcSize, listener, tag ),
    scrollbar_( NULL ),
    state_( 0 ),
    dropDir_( Dropdown ),
	font_( kSystemFont ),
    index_( 0 ), 
    indexSel_( 0 ),
    indexSaved_( 0 ),
    maxVisible_( 3 ),
    scrollOffset_( 0 )
{
    calcMetrics();

    CRect rcScrollbar( size.right-WidthButton, size.bottom, size.right, size.bottom+150 );
    scrollbar_ = new CScrollbar( rcScrollbar, this, 0, CScrollbar::kVertical, CRect( 0,0,0,0 ));

    setWantsFocus( true );
    setBackgroundColor( kWhiteCColor );
    setFrameColor( kBlackCColor );
    setTextColor( kBlackCColor );
    setSelectionColor( colOrange );
}
示例#14
0
文件: cbuttons.cpp 项目: DaniM/lyngo
//------------------------------------------------------------------------
//------------------------------------------------------------------------
//------------------------------------------------------------------------
CTextButton::CTextButton (const CRect& size, CControlListener* listener, int32_t tag, UTF8StringPtr title, Style style)
: CControl (size, listener, tag, 0)
, title (title)
, font (0)
, _path (0)
, frameWidth (1.)
, roundRadius (6.)
, textMargin (0.)
, iconPosition (kLeft)
, horiTxtAlign (kCenterText)
, style (style)
{
	setFont (kSystemFont);
	setTextColor (kBlackCColor);
	setTextColorHighlighted (kWhiteCColor);
	setGradientStartColor (CColor (220, 220, 220, 255));
	setGradientStartColorHighlighted (CColor (180, 180, 180, 255));
	setGradientEndColor (CColor (180, 180, 180, 255));
	setGradientEndColorHighlighted (CColor (100, 100, 100, 255));
	setFrameColor (kBlackCColor);
	setFrameColorHighlighted (kBlackCColor);
	setWantsFocus (true);
}
示例#15
0
KexiDBImageBox::KexiDBImageBox(bool designMode, QWidget *parent)
        : KexiFrame(parent /* Qt 4 not neede: , Qt::WNoAutoErase*/)
        , KexiFormDataItemInterface()
        , m_alignment(Qt::AlignAuto | Qt::AlignTop)
//2.0 moved to FormWidgetInterface      , m_designMode(designMode)
        , m_readOnly(false)
        , m_scaledContents(false)
        , m_smoothTransformation(true)
        , m_keepAspectRatio(true)
        , m_insideSetData(false)
        , m_setFocusOnButtonAfterClosingPopup(false)
//        , m_lineWidthChanged(false)
        , m_paintEventEnabled(true)
        , m_dropDownButtonVisible(true)
        , m_insideSetPalette(false)
{
    setDesignMode(designMode);
    installEventFilter(this);
    setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
    QPalette pal(palette());
    pal.setBrush(backgroundRole(), QBrush(Qt::transparent));
    KexiFrame::setPalette(pal);

    //setup context menu
    m_contextMenu = new KexiImageContextMenu(this);
    m_contextMenu->installEventFilter(this);

    if (designMode) {
        m_chooser = 0;
    } else {
        m_chooser = new KexiDropDownButton(this);
        m_chooser->setFocusPolicy(Qt::StrongFocus);
        m_chooser->setMenu(m_contextMenu);
        setFocusProxy(m_chooser);
        m_chooser->installEventFilter(this);
//  m_chooser->setPalette(qApp->palette());
//  hlyr->addWidget(m_chooser);
    }

    setFrameShape(QFrame::Box);
    setFrameShadow(QFrame::Plain);
    setFrameColor(palette().color(QPalette::Foreground));

    m_paletteBackgroundColorChanged = false; //set this here, not before

    connect(m_contextMenu, SIGNAL(updateActionsAvailabilityRequested(bool&,bool&)),
            this, SLOT(slotUpdateActionsAvailabilityRequested(bool&,bool&)));
    connect(m_contextMenu, SIGNAL(insertFromFileRequested(KUrl)),
            this, SLOT(handleInsertFromFileAction(KUrl)));
    connect(m_contextMenu, SIGNAL(saveAsRequested(QString)),
            this, SLOT(handleSaveAsAction(QString)));
    connect(m_contextMenu, SIGNAL(cutRequested()),
            this, SLOT(handleCutAction()));
    connect(m_contextMenu, SIGNAL(copyRequested()),
            this, SLOT(handleCopyAction()));
    connect(m_contextMenu, SIGNAL(pasteRequested()),
            this, SLOT(handlePasteAction()));
    connect(m_contextMenu, SIGNAL(clearRequested()),
            this, SLOT(clear()));
    connect(m_contextMenu, SIGNAL(showPropertiesRequested()),
            this, SLOT(handleShowPropertiesAction()));

// connect(m_contextMenu, SIGNAL(aboutToHide()), this, SLOT(slotAboutToHidePopupMenu()));
// if (m_chooser) {
    //we couldn't use m_chooser->setPopup() because of drawing problems
//  connect(m_chooser, SIGNAL(pressed()), this, SLOT(slotChooserPressed()));
//  connect(m_chooser, SIGNAL(released()), this, SLOT(slotChooserReleased()));
//  connect(m_chooser, SIGNAL(toggled(bool)), this, SLOT(slotToggled(bool)));
// }

    KexiFrame::setLineWidth(0);
    setDataSource(QString());   //to initialize popup menu and actions availability
}
示例#16
0
TextWindow& TextWindow::setWindowFrameColor(const TCODColor &frameColor)
{
  setFrameColor(frameColor);
  return *this;
}