本文整理汇总了C++中BTextControl::Bounds方法的典型用法代码示例。如果您正苦于以下问题:C++ BTextControl::Bounds方法的具体用法?C++ BTextControl::Bounds怎么用?C++ BTextControl::Bounds使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BTextControl
的用法示例。
在下文中一共展示了BTextControl::Bounds方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
void
DocInfoWindow::FrameResized(float newWidth, float newHeight)
{
BTextControl *textControl = dynamic_cast<BTextControl*> (fTable->ChildAt(0));
if (textControl) {
float width, height;
textControl->GetPreferredSize(&width, &height);
int32 count = fKeyList->CountItems();
float fieldsHeight = (height * count) + (2 * count);
_AdjustScrollBar(height, fieldsHeight);
while (textControl) {
textControl->SetDivider(textControl->Bounds().Width() / 2.0);
textControl = dynamic_cast<BTextControl*> (textControl->NextSibling());
}
}
}
示例2: rect
void
DocInfoWindow::_BuildTable(const BMessage& docInfo)
{
_EmptyKeyList();
while (fTable->ChildAt(0)) {
BView *child = fTable->ChildAt(0);
fTable->RemoveChild(child);
delete child;
}
fTable->ScrollTo(0, 0);
#ifdef B_BEOS_VERSION_DANO
const
#endif
char *name;
uint32 type;
int32 count;
float rowHeight = 20.0;
float fieldsHeight = 2.0;
float width = fTable->Bounds().Width() - 4.0;
for (int32 i = 0; docInfo.GetInfo(B_STRING_TYPE, i, &name, &type, &count)
== B_OK; i++) {
if (type != B_STRING_TYPE)
continue;
BString value;
BTextControl* textControl;
if (docInfo.FindString(name, &value) == B_OK) {
BRect rect(2.0, fieldsHeight, width, rowHeight);
textControl = _AddFieldToTable(rect, name, value.String());
rowHeight = textControl->Bounds().Height();
fieldsHeight += rowHeight + 2.0;
}
}
_AdjustScrollBar(rowHeight, fieldsHeight);
}