本文整理汇总了C++中ProgressBar::get_size方法的典型用法代码示例。如果您正苦于以下问题:C++ ProgressBar::get_size方法的具体用法?C++ ProgressBar::get_size怎么用?C++ ProgressBar::get_size使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ProgressBar
的用法示例。
在下文中一共展示了ProgressBar::get_size方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: on_render
void ProgressBar_Impl::on_render(Canvas &canvas, const Rect &update_rect)
{
Rect rect = progressbar->get_size();
if (marquee_mode)
{
if (rect.get_width() > 0)
{
Rect content_box = progressbar->get_content_box();
Rect progress_rect;
progress_rect.left = content_box.left + marquee_position;
progress_rect.top = content_box.top;
progress_rect.bottom = content_box.bottom;
progress_rect.right = content_box.left + marquee_position + marquee_box_width;
if (progress_rect.left < content_box.left)
{
progress_rect.left = 0;
progress_rect.right -= (content_box.left - progress_rect.left);
}
if (progress_rect.right > content_box.right)
{
progress_rect.right -= (progress_rect.right - content_box.right);
}
part_progress.render_box(canvas, progress_rect);
}
}
else
{
if (progress_max >= progress_min &&
position >= progress_min &&
position <= progress_max &&
progress_min != progress_max &&
rect.get_width() > 0)
{
Rect content_box = progressbar->get_content_box();
Rect progress_rect;
progress_rect.left = content_box.left;
progress_rect.top = content_box.top;
progress_rect.bottom = content_box.bottom;
progress_rect.right = content_box.left + (position - progress_min) * content_box.get_width() / (progress_max - progress_min);
part_progress.render_box(canvas, progress_rect);
}
}
}