本文整理汇总了C++中BTranslatorRoster::AcquireTranslator方法的典型用法代码示例。如果您正苦于以下问题:C++ BTranslatorRoster::AcquireTranslator方法的具体用法?C++ BTranslatorRoster::AcquireTranslator怎么用?C++ BTranslatorRoster::AcquireTranslator使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BTranslatorRoster
的用法示例。
在下文中一共展示了BTranslatorRoster::AcquireTranslator方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: rect
status_t
DataTranslationsWindow::_ShowConfigView(int32 id)
{
// Shows the config panel for the translator with the given id
if (id < 0)
return B_BAD_VALUE;
BTranslatorRoster* roster = BTranslatorRoster::Default();
if (fConfigView != NULL) {
fRightBox->RemoveChild(fConfigView);
delete fConfigView;
fConfigView = NULL;
fInfoText = NULL;
if (fRelease != NULL) {
fRelease->Release();
fRelease = NULL;
}
}
BMessage emptyMessage;
BRect rect(0.0f, 0.0f, 200.0f, 233.0f);
status_t result = roster->MakeConfigurationView(id, &emptyMessage,
&fConfigView, &rect);
if (result != B_OK)
return result;
fConfigView->SetViewUIColor(B_PANEL_BACKGROUND_COLOR);
// force config views to all have the same color
fRightBox->AddChild(fConfigView);
// for default 12pt font size: 597 ≈ (0.85 * 12 * 49)
fConfigView->SetExplicitMinSize(
BSize(ceilf(be_control_look->DefaultItemSpacing() * 49)
- fTranslatorListView->Frame().Width(), B_SIZE_UNSET));
// Make sure the translator's image doesn't get unloaded while we are still
// showing a config view whose code is in the image
fRelease = roster->AcquireTranslator(id);
return B_OK;
}