bool TimeoutCounter::expired() const { if (unlimited()) { return false; } return remained() <= 0; }
int TimeoutCounter::remained() const { if (unlimited()) { return UNLIMITED_TIME; } return timeout_ - elapsed(); }
bool cancel() { if (unlimited()) return false; bool cancel = int(lst.size()) >= maxCount_; if (cancel) mayStop(true); return cancel; }
bool cancel() { if (unlimited()) return false; bool cancel = index_ >= maxCount_; if (cancel) mayStop(true); return cancel; }
void MediaWindow::_MakeEmptyParamView() { fParamWeb = NULL; BStringView* stringView = new BStringView("noControls", B_TRANSLATE("This hardware has no controls.")); BSize unlimited(B_SIZE_UNLIMITED, B_SIZE_UNLIMITED); stringView->SetExplicitMaxSize(unlimited); BAlignment centered(B_ALIGN_HORIZONTAL_CENTER, B_ALIGN_VERTICAL_CENTER); stringView->SetExplicitAlignment(centered); stringView->SetAlignment(B_ALIGN_CENTER); fContentLayout->AddView(stringView); fContentLayout->SetVisibleItem(fContentLayout->CountItems() - 1); rgb_color panel = stringView->LowColor(); stringView->SetHighColor(tint_color(panel, B_DISABLED_LABEL_TINT)); }
void CHistoryDlg::OnUnlimited(UINT /*uNotifyCode*/, int /*nID*/, CWindow /*wndCtl*/) { CButton unlimited(GetDlgItem(IDC_UNLIMITED)); m_unlimited = unlimited.GetCheck() == BST_CHECKED; UpdateUi(); }
void consume(int x) { EXPECT_TRUE(unlimited() or int(lst.size()) < maxCount_); lst.push_back(x); }
int produce() { EXPECT_TRUE(unlimited() or index_ < maxCount_); return index_++; }