本文整理汇总了C++中TimeSlider::SetEnabled方法的典型用法代码示例。如果您正苦于以下问题:C++ TimeSlider::SetEnabled方法的具体用法?C++ TimeSlider::SetEnabled怎么用?C++ TimeSlider::SetEnabled使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TimeSlider
的用法示例。
在下文中一共展示了TimeSlider::SetEnabled方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
void
FadeView::UpdateStatus()
{
Window()->DisableUpdates();
bool enabled = fEnableCheckBox->Value() == B_CONTROL_ON;
fPasswordCheckBox->SetEnabled(enabled);
fTurnOffCheckBox->SetEnabled(enabled && fTurnOffScreenFlags != 0);
fRunSlider->SetEnabled(enabled);
fTurnOffSlider->SetEnabled(enabled && fTurnOffCheckBox->Value());
fPasswordSlider->SetEnabled(enabled && fPasswordCheckBox->Value());
fPasswordButton->SetEnabled(enabled && fPasswordCheckBox->Value());
Window()->EnableUpdates();
// Update the saved preferences
fSettings.SetWindowFrame(Frame());
fSettings.SetTimeFlags((enabled ? ENABLE_SAVER : 0)
| (fTurnOffCheckBox->Value() ? fTurnOffScreenFlags : 0));
fSettings.SetBlankTime(fRunSlider->Time());
bigtime_t offTime = fTurnOffSlider->Time() - fSettings.BlankTime();
fSettings.SetOffTime(offTime);
fSettings.SetSuspendTime(offTime);
fSettings.SetStandByTime(offTime);
fSettings.SetBlankCorner(fFadeNow->Corner());
fSettings.SetNeverBlankCorner(fFadeNever->Corner());
fSettings.SetLockEnable(fPasswordCheckBox->Value());
fSettings.SetPasswordTime(fPasswordSlider->Time());
// TODO - Tell the password window to update its stuff
}
示例2:
void
FadeView::MessageReceived(BMessage *message)
{
switch (message->what) {
case B_COLORS_UPDATED:
_UpdateColors();
break;
case kMsgRunSliderChanged:
case kMsgRunSliderUpdate:
if (fRunSlider->Value() > fTurnOffSlider->Value())
fTurnOffSlider->SetValue(fRunSlider->Value());
if (fRunSlider->Value() > fPasswordSlider->Value())
fPasswordSlider->SetValue(fRunSlider->Value());
break;
case kMsgTurnOffSliderChanged:
case kMsgTurnOffSliderUpdate:
if (fRunSlider->Value() > fTurnOffSlider->Value())
fRunSlider->SetValue(fTurnOffSlider->Value());
break;
case kMsgPasswordSliderChanged:
case kMsgPasswordSliderUpdate:
if (fPasswordSlider->Value() < fRunSlider->Value())
fRunSlider->SetValue(fPasswordSlider->Value());
break;
case kMsgTurnOffCheckBox:
fTurnOffSlider->SetEnabled(
fTurnOffCheckBox->Value() == B_CONTROL_ON);
break;
}
switch (message->what) {
case kMsgRunSliderChanged:
case kMsgTurnOffSliderChanged:
case kMsgPasswordSliderChanged:
case kMsgPasswordCheckBox:
case kMsgEnableScreenSaverBox:
case kMsgFadeCornerChanged:
case kMsgNeverFadeCornerChanged:
UpdateStatus();
fSettings.Save();
break;
default:
BView::MessageReceived(message);
}
}