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


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

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


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

示例1: WidgetFor

BRect
BPose::CalcRect(BPoint loc, const BPoseView* poseView, bool minimalRect) const
{
	ASSERT(poseView->ViewMode() == kListMode);

	BColumn* column = poseView->LastColumn();
	BRect rect;
	rect.left = loc.x;
	rect.top = loc.y;
	rect.right = loc.x + column->Offset() + column->Width();
	rect.bottom = rect.top + poseView->ListElemHeight();

	if (minimalRect) {
		BTextWidget* widget = WidgetFor(poseView->FirstColumn()->AttrHash());
		if (widget != NULL) {
			rect.right = widget->CalcRect(loc, poseView->FirstColumn(),
				poseView).right;
		}
	}

	return rect;
}
开发者ID:mylegacy,项目名称:haiku,代码行数:22,代码来源:Pose.cpp

示例2: GetConfiguration

status_t SeqManageRosterWindow::GetConfiguration(BMessage* config)
{
	ArpASSERT(config);
	config->what = ConfigWhat();
	status_t	err = GetDimensions(config, this);
	if (err != B_OK) return err;
	/* Add the columns
	 */
	BColumnListView* table = dynamic_cast<BColumnListView*>( FindView(TABLE_STR) );
	if (table) {
		BColumn*	col;
		for( int32 k = 0; (col = table->ColumnAt(k)); k++ ) {
			BMessage	colMsg;
			BString		colName;
			col->GetColumnName(&colName);
			if( colMsg.AddString("name", colName.String() ) == B_OK
					&& colMsg.AddFloat("width", col->Width() ) == B_OK
					&& colMsg.AddBool("visible", col->IsVisible() ) == B_OK ) {
				config->AddMessage("column", &colMsg);
			}
		}
	}
	return B_OK;
}
开发者ID:tgkokk,项目名称:Sequitur,代码行数:24,代码来源:SeqManageRosterWindows.cpp

示例3: modelOpener

void
BPose::Draw(BRect rect, const BRect& updateRect, BPoseView* poseView,
	BView* drawView, bool fullDraw, BPoint offset, bool selected)
{
	// If the background wasn't cleared and Draw() is not called after
	// having edited a name or similar (with fullDraw)
	if (!fBackgroundClean && !fullDraw) {
		fBackgroundClean = true;
		poseView->Invalidate(rect);
		return;
	} else
		fBackgroundClean = false;

	bool directDraw = (drawView == poseView);
	bool windowActive = poseView->Window()->IsActive();
	bool showSelectionWhenInactive = poseView->fShowSelectionWhenInactive;
	bool isDrawingSelectionRect = poseView->fIsDrawingSelectionRect;

	ModelNodeLazyOpener modelOpener(fModel);

	if (poseView->ViewMode() == kListMode) {
		uint32 size = poseView->IconSizeInt();
		BRect iconRect(rect);
		iconRect.left += kListOffset;
		iconRect.right = iconRect.left + size;
		iconRect.top = iconRect.bottom - size;
		if (updateRect.Intersects(iconRect)) {
			iconRect.OffsetBy(offset);
			DrawIcon(iconRect.LeftTop(), drawView, poseView->IconSize(),
				directDraw, !windowActive && !showSelectionWhenInactive);
		}

		// draw text
		int32 columnsToDraw = 1;
		if (fullDraw)
			columnsToDraw = poseView->CountColumns();

		for (int32 index = 0; index < columnsToDraw; index++) {
			BColumn* column = poseView->ColumnAt(index);
			if (column == NULL)
				break;

			// if widget doesn't exist, create it
			BTextWidget* widget = WidgetFor(column, poseView, modelOpener);

			if (widget && widget->IsVisible()) {
				BRect widgetRect(widget->ColumnRect(rect.LeftTop(), column,
					poseView));

				if (updateRect.Intersects(widgetRect)) {
					BRect widgetTextRect(widget->CalcRect(rect.LeftTop(),
						column, poseView));

					bool selectDuringDraw = directDraw && selected
						&& windowActive;

					if (index == 0 && selectDuringDraw) {
						//draw with dark background to select text
						drawView->PushState();
						drawView->SetLowColor(0, 0, 0);
					}

					if (index == 0) {
						widget->Draw(widgetRect, widgetTextRect,
							column->Width(), poseView, drawView, selected,
							fClipboardMode, offset, directDraw);
					} else {
						widget->Draw(widgetTextRect, widgetTextRect,
							column->Width(), poseView, drawView, false,
							fClipboardMode, offset, directDraw);
					}

					if (index == 0 && selectDuringDraw)
						drawView->PopState();
					else if (index == 0 && selected) {
						if (windowActive || isDrawingSelectionRect) {
							widgetTextRect.OffsetBy(offset);
							drawView->InvertRect(widgetTextRect);
						} else if (!windowActive
							&& showSelectionWhenInactive) {
							widgetTextRect.OffsetBy(offset);
							drawView->PushState();
							drawView->SetDrawingMode(B_OP_BLEND);
							drawView->SetHighColor(128, 128, 128, 255);
							drawView->FillRect(widgetTextRect);
							drawView->PopState();
						}
					}
				}
			}
		}
	} else {
		// draw in icon mode
		BPoint location(Location(poseView));
		BPoint iconOrigin(location);
		iconOrigin += offset;

		DrawIcon(iconOrigin, drawView, poseView->IconSize(), directDraw,
			!windowActive && !showSelectionWhenInactive);

//.........这里部分代码省略.........
开发者ID:mylegacy,项目名称:haiku,代码行数:101,代码来源:Pose.cpp


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