当前位置: 首页>>代码示例>>C++>>正文


C++ TrackerSettings::FreeSpaceColor方法代码示例

本文整理汇总了C++中TrackerSettings::FreeSpaceColor方法的典型用法代码示例。如果您正苦于以下问题:C++ TrackerSettings::FreeSpaceColor方法的具体用法?C++ TrackerSettings::FreeSpaceColor怎么用?C++ TrackerSettings::FreeSpaceColor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TrackerSettings的用法示例。


在下文中一共展示了TrackerSettings::FreeSpaceColor方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1:

void
SpaceBarSettingsView::Revert()
{
	TTracker* tracker = dynamic_cast<TTracker*>(be_app);
	if (tracker == NULL)
		return;

	TrackerSettings settings;

	if (settings.ShowVolumeSpaceBar() != fSpaceBarShow) {
		settings.SetShowVolumeSpaceBar(fSpaceBarShow);
		send_bool_notices(kShowVolumeSpaceBar, "ShowVolumeSpaceBar",
			fSpaceBarShow);
	}

	if (settings.UsedSpaceColor() != fUsedSpaceColor
		|| settings.FreeSpaceColor() != fFreeSpaceColor
		|| settings.WarningSpaceColor() != fWarningSpaceColor) {
		settings.SetUsedSpaceColor(fUsedSpaceColor);
		settings.SetFreeSpaceColor(fFreeSpaceColor);
		settings.SetWarningSpaceColor(fWarningSpaceColor);
		tracker->SendNotices(kSpaceBarColorChanged);
	}

	ShowCurrentSettings();
}
开发者ID:AmirAbrams,项目名称:haiku,代码行数:26,代码来源:SettingsViews.cpp

示例2: Window

void
SpaceBarSettingsView::MessageReceived(BMessage* message)
{
	TTracker* tracker = dynamic_cast<TTracker*>(be_app);
	if (tracker == NULL)
		return;

	TrackerSettings settings;

	switch (message->what) {
		case kUpdateVolumeSpaceBar:
		{
			settings.SetShowVolumeSpaceBar(
				fSpaceBarShowCheckBox->Value() == 1);
			Window()->PostMessage(kSettingsContentsModified);
			tracker->PostMessage(kShowVolumeSpaceBar);
			break;
		}

		case kSpaceBarSwitchColor:
		{
			fCurrentColor = message->FindInt32("index");
			switch (fCurrentColor) {
				case 0:
					fColorControl->SetValue(settings.UsedSpaceColor());
					break;

				case 1:
					fColorControl->SetValue(settings.FreeSpaceColor());
					break;

				case 2:
					fColorControl->SetValue(settings.WarningSpaceColor());
					break;
			}
			break;
		}

		case kSpaceBarColorChanged:
		{
			rgb_color color = fColorControl->ValueAsColor();
			color.alpha = kSpaceBarAlpha;
				// alpha is ignored by BColorControl but is checked
				// in equalities

			switch (fCurrentColor) {
				case 0:
					settings.SetUsedSpaceColor(color);
					break;

				case 1:
					settings.SetFreeSpaceColor(color);
					break;

				case 2:
					settings.SetWarningSpaceColor(color);
					break;
			}

			BWindow* window = Window();
			if (window != NULL)
				window->PostMessage(kSettingsContentsModified);

			tracker->PostMessage(kSpaceBarColorChanged);
			break;
		}

		default:
			_inherited::MessageReceived(message);
			break;
	}
}
开发者ID:AmirAbrams,项目名称:haiku,代码行数:72,代码来源:SettingsViews.cpp


注:本文中的TrackerSettings::FreeSpaceColor方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。