本文整理汇总了C++中ProgressBar::setProgressMessage方法的典型用法代码示例。如果您正苦于以下问题:C++ ProgressBar::setProgressMessage方法的具体用法?C++ ProgressBar::setProgressMessage怎么用?C++ ProgressBar::setProgressMessage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ProgressBar
的用法示例。
在下文中一共展示了ProgressBar::setProgressMessage方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: loadVolume
void VolumeURLListProperty::loadVolume(const std::string& url, bool invalidateUI /*=true*/)
throw (tgt::FileException, std::bad_alloc) {
if (!containsURL(url)) {
LWARNING("loadVolume(): passed URL not contained by this property: " << url);
return;
}
// delete volume, if already loaded and owned by the property
if (getVolume(url) && isOwner(url))
delete getVolume(url);
handleMap_.erase(url);
ownerMap_.erase(url);
ProgressBar* progressBar = getProgressBar();
if (progressBar) {
progressBar->setTitle("Loading volume");
progressBar->setProgressMessage("Loading volume ...");
}
VolumeSerializerPopulator serializerPopulator(progressBar);
VolumeBase* handle = serializerPopulator.getVolumeSerializer()->read(VolumeURL(url));
if (progressBar)
progressBar->hide();
if (handle) {
// url may have been altered by loading routine
if (url != handle->getOrigin().getURL()) {
bool selected = isSelected(url);
selectionMap_.erase(url);
selectionMap_[handle->getOrigin().getURL()] = selected;
for (size_t i=0; i<value_.size(); i++) {
if (value_[i] == url) {
value_[i] = handle->getOrigin().getURL();
break;
}
}
}
handleMap_[handle->getOrigin().getURL()] = handle;
ownerMap_[handle->getOrigin().getURL()] = true;
}
if(invalidateUI)
invalidate();
}
示例2: loadVolume
void VolumeURLProperty::loadVolume() throw (tgt::FileException, std::bad_alloc){
std::string url = get();
if (url.empty()) {
LWARNING("loadVolume(): empty URL");
return;
}
ProgressBar* progressBar = getProgressBar();
if (progressBar) {
progressBar->setTitle("Loading volume");
progressBar->setProgressMessage("Loading volume ...");
}
VolumeSerializerPopulator serializerPopulator(progressBar);
VolumeList* volumeList = serializerPopulator.getVolumeSerializer()->read(url);
if (progressBar)
progressBar->hide();
if (volumeList && !volumeList->empty()) {
VolumeBase* handle = volumeList->first();
tgtAssert(handle, "No handle");
setVolume(static_cast<Volume*>(handle));
// delete superfluous volumes
if (volumeList->size() > 1) {
LWARNING("More than one volume loaded from file: " + url + ". Discarding surplus volumes!");
for (size_t i=1; i<volumeList->size(); i++)
delete volumeList->at(i);
}
// property does take ownership of loaded handles
volumeOwner_ = true;
}
delete volumeList;
}