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); } } }
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 */
/** * @brief Diff ペインにフォーカスを与えます。 * @param[in] paneIndex フォーカスを与えるペイン */ void TextDiffView::makeFocusToPane(TextDiffView::PaneIndex /* paneIndex */) { // ホイールイベントのために常に右ペインにフォーカスを与えます。 // 必要ならここでフォーカスのあるはずのペインを記憶してもいいかも BView* rightPaneView = FindView(NAME_RIGHT_PANE); if (NULL != rightPaneView) { rightPaneView->MakeFocus(); } }
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); }
void LiveTextControl::MakeFocus(bool focusState) { if (focusState) { fTextView->MakeFocus(); } else { BView::MakeFocus( false ); BView *view; if (!(view = NextSibling()) && !(Parent()->NextSibling())) view = Parent(); view->MakeFocus(); } }
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); }
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(); } }