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


C++ ModelNode::TableCellRenderer方法代码示例

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


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

示例1: GetPreferredWidth

	float GetPreferredWidth(const BVariant& value, BView* targetView) const
	{
		// get the preferred width from the node's designated renderer
		if (value.Type() == VALUE_NODE_TYPE) {
			ModelNode* node = dynamic_cast<ModelNode*>(value.ToReferenceable());
			if (node != NULL && node->GetValue() != NULL
				&& node->TableCellRenderer() != NULL) {
				return node->TableCellRenderer()->PreferredValueWidth(
					node->GetValue(), targetView);
			}
		}

		return fColumn.BTitledColumn::GetPreferredWidth(NULL, targetView);
	}
开发者ID:,项目名称:,代码行数:14,代码来源:

示例2: DrawValue

	void DrawValue(const BVariant& value, BRect rect, BView* targetView)
	{
		// draw the node's value with the designated renderer
		if (value.Type() == VALUE_NODE_TYPE) {
			ModelNode* node = dynamic_cast<ModelNode*>(value.ToReferenceable());
			if (node != NULL && node->GetValue() != NULL
				&& node->TableCellRenderer() != NULL) {
				node->TableCellRenderer()->RenderValue(node->GetValue(), rect,
					targetView);
				return;
			}
		}

		// fall back to drawing an empty string
		fField.SetString("");
		fField.SetWidth(Width());
		fColumn.DrawField(&fField, rect, targetView);
	}
开发者ID:,项目名称:,代码行数:18,代码来源:

示例3: settingsMenuReference

void
VariablesView::TreeTableCellMouseDown(TreeTable* table,
	const TreeTablePath& path, int32 columnIndex, BPoint screenWhere,
	uint32 buttons)
{
	if ((buttons & B_SECONDARY_MOUSE_BUTTON) == 0)
		return;

	_FinishContextMenu(true);

	ModelNode* node = (ModelNode*)fVariableTableModel->NodeForPath(path);
	if (node == NULL)
		return;

	TableCellValueRenderer* cellRenderer = node->TableCellRenderer();
	if (cellRenderer == NULL)
		return;

	Settings* settings = cellRenderer->GetSettings();
	if (settings == NULL)
		return;

	SettingsMenu* settingsMenu;
	status_t error = node->GetValueHandler()->CreateTableCellValueSettingsMenu(
		node->GetValue(), settings, settingsMenu);
	BReference<SettingsMenu> settingsMenuReference(settingsMenu, true);
	if (error != B_OK)
		return;

	TableCellContextMenuTracker* tracker = new(std::nothrow)
		TableCellContextMenuTracker(node, Looper(), this);
	BReference<TableCellContextMenuTracker> trackerReference(tracker);
	if (tracker == NULL || tracker->Init(settings, settingsMenu) != B_OK)
		return;

	fTableCellContextMenuTracker = trackerReference.Detach();
	fTableCellContextMenuTracker->ShowMenu(screenWhere);
}
开发者ID:,项目名称:,代码行数:38,代码来源:


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