本文整理汇总了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;
}
示例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;
}
示例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);
//.........这里部分代码省略.........