本文整理汇总了C++中ProgressBar::getProgress方法的典型用法代码示例。如果您正苦于以下问题:C++ ProgressBar::getProgress方法的具体用法?C++ ProgressBar::getProgress怎么用?C++ ProgressBar::getProgress使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ProgressBar
的用法示例。
在下文中一共展示了ProgressBar::getProgress方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: render
void FalagardProgressBarEx::render()
{
const StateImagery* imagery;
// get WidgetLookFeel for the assigned look.
const WidgetLookFeel& wlf = getLookNFeel();
// try and get imagery for our current state
imagery = &wlf.getStateImagery(d_window->isDisabled() ? "Disabled" : "Enabled");
// peform the rendering operation.
imagery->render(*d_window);
// get imagery for actual progress rendering
imagery = &wlf.getStateImagery(d_window->isDisabled() ? "DisabledProgress" : "EnabledProgress");
// get target rect for this imagery
Rect progressRect(wlf.getNamedArea("ProgressArea").getArea().getPixelRect(*d_window));
// calculate a clipper according to the current progress.
Rect progressClipper(progressRect);
ProgressBar* w = (ProgressBar*)d_window;
if (d_vertical)
{
float height = PixelAligned(progressClipper.getHeight() * w->getProgress());
if (d_reversed)
{
progressClipper.setHeight(height);
}
else
{
progressClipper.d_top = progressClipper.d_bottom - height;
}
}
else
{
float width = PixelAligned(progressClipper.getWidth() * w->getProgress());
if (d_reversed)
{
progressClipper.d_left = progressClipper.d_right - width;
}
else
{
progressClipper.setWidth(width);
}
}
// peform the rendering operation.
imagery->render(*d_window, progressRect, 0, &progressClipper);
// perform the text rendering operation
imagery = &wlf.getStateImagery("Label");
imagery->render(*d_window);
}