本文整理汇总了C++中BView::MakeFocus方法的典型用法代码示例。如果您正苦于以下问题:C++ BView::MakeFocus方法的具体用法?C++ BView::MakeFocus怎么用?C++ BView::MakeFocus使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BView
的用法示例。
在下文中一共展示了BView::MakeFocus方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: MessageReceived
void ArpConfigureView::MessageReceived(BMessage *message)
{
switch( message->what ) {
case DONE_MSG: {
// This little bit of stupidity is to make any
// text control that has focus to report its changes
// before we apply the settings.
BView* lastFocus = Window()->CurrentFocus();
if (lastFocus) {
MakeFocus();
lastFocus->MakeFocus();
}
if (mDoneButton) mDoneButton->MakeFocus();
Invoke();
} break;
case MAKEDEFAULT_MSG: {
Config().WriteSettings();
} break;
case REVERT_MSG: {
if( mPanel ) mPanel->Revert();
} break;
default: {
inherited::MessageReceived(message);
}
}
}
示例2: HDialog
CCutContainingDialog::CCutContainingDialog(BRect frame, const char *name, window_type type, int flags,
BWindow *owner, BPositionIO* data)
: HDialog(frame, name, type, flags, owner, data)
{
SetOn("sel", sSelectionOnly);
BView *textView = FindView("text");
if (textView)
textView->MakeFocus(true);
} /* CCutContainingDialog::CCutContainingDialog */
示例3: makeFocusToPane
/**
* @brief Diff ペインにフォーカスを与えます。
* @param[in] paneIndex フォーカスを与えるペイン
*/
void TextDiffView::makeFocusToPane(TextDiffView::PaneIndex /* paneIndex */)
{
// ホイールイベントのために常に右ペインにフォーカスを与えます。
// 必要ならここでフォーカスのあるはずのペインを記憶してもいいかも
BView* rightPaneView = FindView(NAME_RIGHT_PANE);
if (NULL != rightPaneView)
{
rightPaneView->MakeFocus();
}
}
示例4: focusDocumentView
void EventHandler::focusDocumentView()
{
BView* view = m_frame->view()->platformWidget();
if (view)
view->MakeFocus();
Page* page = m_frame->page();
if (page)
page->focusController()->setFocusedFrame(m_frame);
}
示例5: MakeFocus
void LiveTextControl::MakeFocus(bool focusState) {
if (focusState) {
fTextView->MakeFocus();
}
else {
BView::MakeFocus( false );
BView *view;
if (!(view = NextSibling()) && !(Parent()->NextSibling())) view = Parent();
view->MakeFocus();
}
}
示例6: focusDocumentView
void EventHandler::focusDocumentView()
{
BView* view = m_frame->view()->platformWidget();
if (view && view->LockLooperWithTimeout(5000) == B_OK) {
view->MakeFocus(true);
view->UnlockLooper();
}
Page* page = m_frame->page();
if (page)
page->focusController()->setFocusedFrame(m_frame);
}
示例7: Window
void
BMenuBar::_RestoreFocus()
{
BWindow* window = Window();
if (window != NULL && window->Lock()) {
BHandler* handler = NULL;
if (fPrevFocusToken != -1
&& gDefaultTokens.GetToken(fPrevFocusToken, B_HANDLER_TOKEN,
(void**)&handler) == B_OK) {
BView* view = dynamic_cast<BView*>(handler);
if (view != NULL && view->Window() == window)
view->MakeFocus();
} else if (IsFocus())
MakeFocus(false);
fPrevFocusToken = -1;
window->Unlock();
}
}