本文整理汇总了C++中BPoseView::ActivePose方法的典型用法代码示例。如果您正苦于以下问题:C++ BPoseView::ActivePose方法的具体用法?C++ BPoseView::ActivePose怎么用?C++ BPoseView::ActivePose使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BPoseView
的用法示例。
在下文中一共展示了BPoseView::ActivePose方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
static filter_result
TextViewFilter(BMessage* message, BHandler**, BMessageFilter* filter)
{
uchar key;
if (message->FindInt8("byte", (int8*)&key) != B_OK)
return B_DISPATCH_MESSAGE;
ThrowOnAssert(filter != NULL);
BContainerWindow* window = dynamic_cast<BContainerWindow*>(
filter->Looper());
ThrowOnAssert(window != NULL);
BPoseView* poseView = window->PoseView();
ThrowOnAssert(poseView != NULL);
if (key == B_RETURN || key == B_ESCAPE) {
poseView->CommitActivePose(key == B_RETURN);
return B_SKIP_MESSAGE;
}
if (key == B_TAB) {
if (poseView->ActivePose()) {
if (message->FindInt32("modifiers") & B_SHIFT_KEY)
poseView->ActivePose()->EditPreviousWidget(poseView);
else
poseView->ActivePose()->EditNextWidget(poseView);
}
return B_SKIP_MESSAGE;
}
// the BTextView doesn't respect window borders when resizing itself;
// we try to work-around this "bug" here.
// find the text editing view
BView* scrollView = poseView->FindView("BorderView");
if (scrollView != NULL) {
BTextView* textView = dynamic_cast<BTextView*>(
scrollView->FindView("WidgetTextView"));
if (textView != NULL) {
BRect rect = scrollView->Frame();
if (rect.right + 3 > poseView->Bounds().right
|| rect.left - 3 < 0)
textView->MakeResizable(true, NULL);
}
}
return B_DISPATCH_MESSAGE;
}
示例2: if
static filter_result
key_down_filter(BMessage* message, BHandler** handler, BMessageFilter* filter)
{
ASSERT(filter != NULL);
if (filter == NULL)
return B_DISPATCH_MESSAGE;
TFilePanel* panel = dynamic_cast<TFilePanel*>(filter->Looper());
ASSERT(panel != NULL);
if (panel == NULL)
return B_DISPATCH_MESSAGE;
BPoseView* view = panel->PoseView();
if (panel->TrackingMenu())
return B_DISPATCH_MESSAGE;
uchar key;
if (message->FindInt8("byte", (int8*)&key) != B_OK)
return B_DISPATCH_MESSAGE;
int32 modifier = 0;
message->FindInt32("modifiers", &modifier);
if (!modifier && key == B_ESCAPE) {
if (view->ActivePose())
view->CommitActivePose(false);
else if (view->IsFiltering())
filter->Looper()->PostMessage(B_CANCEL, *handler);
else
filter->Looper()->PostMessage(kCancelButton);
return B_SKIP_MESSAGE;
}
if (key == B_RETURN && view->ActivePose()) {
view->CommitActivePose();
return B_SKIP_MESSAGE;
}
return B_DISPATCH_MESSAGE;
}