本文整理汇总了C++中SkinTheme::get_tab_selected_face_color方法的典型用法代码示例。如果您正苦于以下问题:C++ SkinTheme::get_tab_selected_face_color方法的具体用法?C++ SkinTheme::get_tab_selected_face_color怎么用?C++ SkinTheme::get_tab_selected_face_color使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SkinTheme
的用法示例。
在下文中一共展示了SkinTheme::get_tab_selected_face_color方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: drawTab
void Tabs::drawTab(BITMAP* bmp, JRect box, Tab* tab, int y_delta, bool selected)
{
// Is the tab outside the bounds of the widget?
if (box->x1 >= this->rc->x2 || box->x2 <= this->rc->x1)
return;
SkinTheme* theme = static_cast<SkinTheme*>(this->getTheme());
int text_color;
int face_color;
// Selected
if (selected) {
text_color = theme->get_tab_selected_text_color();
face_color = theme->get_tab_selected_face_color();
}
// Non-selected
else {
text_color = theme->get_tab_normal_text_color();
face_color = theme->get_tab_normal_face_color();
}
if (jrect_w(box) > 2) {
theme->draw_bounds_nw(bmp,
box->x1, box->y1+y_delta, box->x2-1, box->y2-1,
(selected) ? PART_TAB_SELECTED_NW:
PART_TAB_NORMAL_NW, face_color);
jdraw_text(bmp, this->getFont(), tab->text.c_str(),
box->x1+4*jguiscale(),
(box->y1+box->y2)/2-text_height(this->getFont())/2+1 + y_delta,
text_color, face_color, false, jguiscale());
}
if (selected) {
theme->draw_bounds_nw(bmp,
box->x1, box->y2, box->x2-1, this->rc->y2-1,
PART_TAB_BOTTOM_SELECTED_NW,
theme->get_tab_selected_face_color());
}
else {
theme->draw_part_as_hline(bmp,
box->x1, box->y2, box->x2-1, this->rc->y2-1,
PART_TAB_BOTTOM_NORMAL);
}
#ifdef CLOSE_BUTTON_IN_EACH_TAB
BITMAP* close_icon = theme->get_part(PART_WINDOW_CLOSE_BUTTON_NORMAL);
set_alpha_blender();
draw_trans_sprite(doublebuffer, close_icon,
box->x2-4*jguiscale()-close_icon->w,
(box->y1+box->y2)/2-close_icon->h/2+1*jguiscale());
#endif
}
示例2: onProcessMessage
//.........这里部分代码省略.........
case JM_BUTTONPRESSED:
if (m_hot != NULL) {
if (m_selected != m_hot) {
m_selected = m_hot;
invalidate();
}
if (m_selected && m_delegate)
m_delegate->clickTab(this,
m_selected->data,
msg->mouse.flags);
}
return true;
case JM_WHEEL: {
int dx = (jmouse_z(1) - jmouse_z(0)) * jrect_w(this->rc)/6;
// setScrollX(m_scrollX+dx);
m_begScrollX = m_scrollX;
if (m_ani != ANI_SMOOTH_SCROLL)
m_endScrollX = m_scrollX + dx;
else
m_endScrollX += dx;
// Limit endScrollX position (to improve animation ending to the correct position)
{
int max_x = getMaxScrollX();
m_endScrollX = MID(0, m_endScrollX, max_x);
}
startAni(ANI_SMOOTH_SCROLL);
return true;
}
case JM_TIMER: {
switch (m_ani) {
case ANI_NONE:
// Do nothing
break;
case ANI_SCROLL: {
int dir = (getManager()->getCapture() == m_button_left ? -1: 1);
setScrollX(m_scrollX + dir*8*msg->timer.count);
break;
}
case ANI_SMOOTH_SCROLL: {
if (m_ani_t == ANI_SMOOTH_SCROLL_TICKS) {
stopAni();
setScrollX(m_endScrollX);
}
else {
// Lineal
//setScrollX(m_begScrollX + m_endScrollX - m_begScrollX) * m_ani_t / 10);
// Exponential
setScrollX(m_begScrollX +
(m_endScrollX - m_begScrollX) * (1.0-std::exp(-10.0 * m_ani_t / (double)ANI_SMOOTH_SCROLL_TICKS)));
}
break;
}
case ANI_ADDING_TAB: {
if (m_ani_t == ANI_ADDING_TAB_TICKS)
stopAni();
invalidate();
break;
}
case ANI_REMOVING_TAB: {
if (m_ani_t == ANI_REMOVING_TAB_TICKS)
stopAni();
invalidate();
break;
}
}
++m_ani_t;
break;
}
case JM_SIGNAL:
if (msg->signal.num == JI_SIGNAL_INIT_THEME) {
m_button_left->setBgColor(theme->get_tab_selected_face_color());
m_button_right->setBgColor(theme->get_tab_selected_face_color());
}
else if (msg->signal.num == JI_SIGNAL_SET_FONT) {
TabsListIterator it, end = m_list_of_tabs.end();
for (it = m_list_of_tabs.begin(); it != end; ++it) {
Tab* tab = *it;
tab->width = calcTabWidth(tab);
}
}
else if (msg->signal.num == JI_SIGNAL_INIT_THEME) {
/* setup the background color */
jwidget_set_bg_color(this, ji_color_face());
}
break;
}
return Widget::onProcessMessage(msg);
}