本文整理汇总了C++中Progress::getPos方法的典型用法代码示例。如果您正苦于以下问题:C++ Progress::getPos方法的具体用法?C++ Progress::getPos怎么用?C++ Progress::getPos使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Progress
的用法示例。
在下文中一共展示了Progress::getPos方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: onPaint
void StatusBar::onPaint(ui::PaintEvent& ev)
{
SkinTheme* theme = static_cast<SkinTheme*>(this->getTheme());
ui::Color textColor = theme->getColorById(kStatusBarText);
Rect rc = getClientBounds();
Graphics* g = ev.getGraphics();
g->fillRect(getBgColor(), rc);
rc.shrink(Border(2, 1, 2, 2)*jguiscale());
int x = rc.x + 4*jguiscale();
// Color
if (m_state == SHOW_COLOR) {
// Draw eyedropper icon
BITMAP* icon = theme->get_toolicon("eyedropper");
if (icon) {
g->drawAlphaBitmap(icon, x, rc.y + rc.h/2 - icon->h/2);
x += icon->w + 4*jguiscale();
}
// Draw color
draw_color_button(g, gfx::Rect(x, rc.y, 32*jguiscale(), rc.h),
true, true, true, true,
true, true, true, true,
app_get_current_pixel_format(), m_color,
false, false);
x += (32+4)*jguiscale();
// Draw color description
std::string str = m_color.toHumanReadableString(app_get_current_pixel_format(),
app::Color::LongHumanReadableString);
if (m_alpha < 255) {
char buf[512];
usprintf(buf, ", Alpha %d", m_alpha);
str += buf;
}
g->drawString(str, textColor, ColorNone, false,
gfx::Point(x, rc.y + rc.h/2 - text_height(getFont())/2));
x += ji_font_text_len(getFont(), str.c_str()) + 4*jguiscale();
}
// Show tool
if (m_state == SHOW_TOOL) {
// Draw eyedropper icon
BITMAP* icon = theme->get_toolicon(m_tool->getId().c_str());
if (icon) {
g->drawAlphaBitmap(icon, x, rc.y + rc.h/2 - icon->h/2);
x += icon->w + 4*jguiscale();
}
}
// Status bar text
if (getTextLength() > 0) {
g->drawString(getText(), textColor, ColorNone, false,
gfx::Point(x, rc.y + rc.h/2 - text_height(getFont())/2));
x += ji_font_text_len(getFont(), getText().c_str()) + 4*jguiscale();
}
// Draw progress bar
if (!m_progress.empty()) {
int width = 64;
int x = rc.x2() - (width+4);
for (ProgressList::iterator it = m_progress.begin(); it != m_progress.end(); ++it) {
Progress* progress = *it;
theme->paintProgressBar(g,
gfx::Rect(x, rc.y, width, rc.h),
progress->getPos());
x -= width+4;
}
}
updateSubwidgetsVisibility();
}