Ejemplo n.º 1
0
void MAS::HyperText::Draw(Bitmap &canvas) {
    // get the button state
    int state = Disabled() ? 2 : ((Selected() || (Flags() & D_PRESSED)) ? 1 : (HasFocus() ? 3 : 0));

    // get the button colors and font
    Color fg = GetFontColor(state);
    Color bg = GetShadowColor(state);
    Font f = GetFont(state);
    Color textMode = GetTextMode();

    canvas.Clear(textMode);

    switch (state) {
    case 0:
    case 2:
        f.GUITextoutEx(canvas, text, 1, 1, fg, bg, textMode, 0);
        canvas.Hline(1, h()-3, w()-2, fg);
        break;

    case 1:
        f.GUITextoutEx(canvas, text, 2, 2, fg, bg, textMode, 0);
        canvas.DrawDottedRect(1, 1, w()-1, h()-1, skin->c_font);
        canvas.Hline(1, h()-2, w()-2, fg);
        break;

    case 3:
        f.GUITextoutEx(canvas, text, 1, 1, fg, bg, textMode, 0);
        canvas.DrawDottedRect(0, 0, w()-2, h()-2, skin->c_font);
        canvas.Hline(1, h()-3, w()-2, fg);
        break;
    };
}
Ejemplo n.º 2
0
void MAS::RadioButton::MsgInitSkin() {
   Button::MsgInitSkin();
   for (int i=0; i<4; i++) {
      if (GetFontColor(i) == Color::transparent) SetFontColor(skin->fcol[Skin::INFO_RADIO][i], skin->scol[Skin::INFO_RADIO][i], i);
      if (GetFontIndex(i) == -1) SetFont(skin->fnt[Skin::INFO_RADIO][i], i);
   }
   if (GetTextMode() == Color::transparent) SetTextMode(skin->c_face);
   if (GetBitmapIndex() == Skin::BUTTON) SetBitmap(Skin::RADIO);
   SetFlag(D_TOGGLE);
   ClearFlag(D_SPINNER | D_AUTOSIZE);
}
Ejemplo n.º 3
0
void MAS::HyperText::MsgInitSkin() {
    for (int i=0; i<4; i++) {
        if (GetFontColor(i) == Color::transparent) SetFontColor(skin->fcol[Skin::INFO_HYPER][i], skin->scol[Skin::INFO_HYPER][i], i);
        if (GetFontIndex(i) == -1) SetFont(skin->fnt[Skin::INFO_HYPER][i], i);
    }
    if (GetTextMode() == Color::transparent) SetTextMode(skin->c_face);
    SetFlag(D_AUTOSIZE);
    UpdateSize();
    ClearFlag(D_TOGGLE | D_SPINNER);
    Button::MsgInitSkin();
}
Ejemplo n.º 4
0
void CRichEditCtrlX::SetSyntaxColoring(const LPCTSTR* ppszKeywords, LPCTSTR pszSeperators)
{
	int i = 0;
	while (ppszKeywords[i] != NULL)
		m_astrKeywords.Add(ppszKeywords[i++]);
	m_strSeperators = pszSeperators;

	if (m_astrKeywords.GetCount() == 0)
		m_strSeperators.Empty();
	else
	{
		SetEventMask(GetEventMask() | ENM_CHANGE);
		GetDefaultCharFormat(m_cfDef);
		m_cfKeyword = m_cfDef;
		m_cfKeyword.dwMask |= CFM_COLOR;
		m_cfKeyword.dwEffects &= ~CFE_AUTOCOLOR;
		m_cfKeyword.crTextColor = RGB(0,0,255);

		ASSERT( GetTextMode() & TM_MULTILEVELUNDO );
	}
}