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


C++ BColumn::StatField方法代码示例

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


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

示例1: Location

void
BPose::UpdateWidgetAndModel(Model* resolvedModel, const char* attrName,
	uint32 attrType, int32, BPoint poseLoc, BPoseView* poseView, bool visible)
{
	if (poseView->ViewMode() != kListMode)
		poseLoc = Location(poseView);

	ASSERT(resolvedModel == NULL || resolvedModel->IsNodeOpen());

	if (attrName != NULL) {
		// pick up new attributes and find out if icon needs updating
		if (resolvedModel->AttrChanged(attrName) && visible)
			UpdateIcon(poseLoc, poseView);

		// ToDo: the following code is wrong, because this sort of hashing
		// may overlap and we get aliasing
		uint32 attrHash = AttrHashString(attrName, attrType);
		BTextWidget* widget = WidgetFor(attrHash);
		if (widget) {
			BColumn* column = poseView->ColumnFor(attrHash);
			if (column)
				widget->CheckAndUpdate(poseLoc, column, poseView, visible);
		} else if (attrType == 0) {
			// attribute got likely removed, so let's search the
			// column for the matching attribute name
			int32 count = fWidgetList.CountItems();
			for (int32 i = 0; i < count; i++) {
				BTextWidget* widget = fWidgetList.ItemAt(i);
				BColumn* column = poseView->ColumnFor(widget->AttrHash());
				if (column != NULL && !strcmp(column->AttrName(), attrName)) {
					widget->CheckAndUpdate(poseLoc, column, poseView,
						visible);
					break;
				}
			}
		}
	} else {
		// no attr name means check all widgets for stat info changes

		// pick up stat changes
		if (resolvedModel && resolvedModel->StatChanged()) {
			if (resolvedModel->InitCheck() != B_OK)
				return;

			if (visible)
				UpdateIcon(poseLoc, poseView);
		}

		// distribute stat changes
		for (int32 index = 0; ; index++) {
			BColumn* column = poseView->ColumnAt(index);
			if (column == NULL)
				break;

			if (column->StatField()) {
				BTextWidget* widget = WidgetFor(column->AttrHash());
				if (widget) {
					widget->CheckAndUpdate(poseLoc, column, poseView,
						visible);
				}
			}
		}
	}
}
开发者ID:mylegacy,项目名称:haiku,代码行数:64,代码来源:Pose.cpp


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